You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: flappy_jellyfish.rs
    path of file: ./repos/jumpy/src/core/elements
    
    the code of the file until where you have to start completion: use crate::prelude::*;

#[derive(HasSchema, Default, Debug, Clone)]
#[type_data(metadata_asset("flappy_jellyfish"))]
#[repr(C)]
pub struct FlappyJellyfishMeta {
    pub atlas: Handle<Atlas>,
    pub body_size: Vec2,
    pub start_frame: u32,
    pub end_frame: u32,
    pub fps: f32,
    pub spawn_offset: Vec2,
    pub explosion_atlas: Handle<Atlas>,
    pub explosion_lifetime: f32,
    pub explosion_frames: u32,
    pub explosion_fps: f32,
    pub explosion_volume: f64,
    pub explosion_sound: Handle<AudioSource>,
    pub damage_region_size: Vec2,
    pub damage_region_lifetime: f32,
}

impl FlappyJellyfishMeta {
    pub fn frames(&self) -> SVec<u32> {
        (self.start_frame..self.end_frame).collect()
    }
}

pub trait FlappyJellyfishMetaSchemaExts {
    /// Try to cast the `asset` to a `JellyfishMeta` and get the
    /// `FlappyJellyfishMeta` from it.
    fn try_get_flappy_meta(&self) -> Option<Handle<FlappyJellyfishMeta>>;
}

impl FlappyJellyfishMetaSchemaExts for SchemaBox {
    fn try_get_flappy_meta(&self) -> Option<Handle<FlappyJellyfishMeta>> {
        self.try_cast_ref::<JellyfishMeta>()
            .ok()
            .map(|m| m.flappy_meta)
    }
}

pub fn session_plugin(session: &mut Session) {
    session
        .stages
        .add_system_to_stage(CoreStage::PostUpdate, control_flappy_jellyfish)
        .add_system_to_stage(CoreStage::PostUpdate, explode_flappy_jellyfish);
}

#[derive(Clone, Copy, Debug, Default, HasSchema)]
pub struct FlappyJellyfish {
    pub owner: Entity,
    pub jellyfish: Entity,
}

/// A player with a jellyf
    
fn spawn(owner: Entity, jellyfish_ent: Entity) -> StaticSystem<(), ()> {
    (move |mut entities: ResMut<Entities>,
           element_handles: Comp<ElementHandle>,
           mut player_driving: CompMut<PlayerDrivingJellyfish>,
           mut jellyfishes: CompMut<Jellyfish>,
           mut flappy_jellyfishes: CompMut<FlappyJellyfish>,
           mut bodies: CompMut<KinematicBody>,
           assets: Res<AssetServer>,
           mut atlas_sprites: CompMut<AtlasSprite>,
           mut animated_sprites: CompMut<AnimatedSprite>,
           mut transforms: CompMut<Transform>,
           mut camera_subjects: CompMut<CameraSubject>| {
        let Some(flappy_meta) = element_handles
            .get(jellyfish_ent)
            .map(|element_h| assets.get(element_h.0))
            .map(|element_meta| assets.get(element_meta.data))
            .as_deref()
            .and_then(SchemaBox::try_get_flappy_meta)
            .map(|flappy_h| assets.get(flappy_h))
        else {
            return;
        };

        let flappy_ent = entities.create();

        player_driving.insert(owner, PlayerDrivingJellyfish { flappy: flappy_ent });
        if let Some(jellyfish) = jellyfishes.get_mut(jellyfish_ent) {
            jellyfish.flappy = Some(flappy_ent);
        }

        flappy_jellyfishes.insert(
            flappy_ent,
            FlappyJellyfish {
                owner,
                jellyfish: jellyfish_ent,
            },
        );
        bodies.insert(
            flappy_ent,
            KinematicBody {
                shape: ColliderShape::Rectangle {
                    size: flappy_meta.body_size,
                },
                has_mass: true,
                gravity: GRAVITY,
                fall_through: true,
                is_controlled: true,
                ..default()
            },
        );
        atlas_sprites.insert(flappy_ent, AtlasSprite::new(flappy_meta.atlas));
        animated_sprites.insert(
            flappy_ent,
            AnimatedSprite {
                frames: flappy_meta.frames(),
                fps: flappy_meta.fps,
                repeat: true,
                ..default()
            },
        );
        let mut transf = *transforms.get(owner).unwrap();
        transf.translation += flappy_meta.spawn_offset.extend(0.0);
        transforms.insert(flappy_ent, transf);
        camera_subjects.insert(flappy_ent, default());
    })
    .system()
}