fn update_sprites(
    stack: &Stack, 
    blocks: &mut WriteStorage<'_, Block>,
    sprites: &mut WriteStorage<'_, SpriteRender>,
    hiddens: &mut WriteStorage<'_, Hidden>) {
    for i in 0..BLOCKS {
        let b = blocks.get_mut(stack.from_i(i)).unwrap();

        // decrease all the time
        if b.anim_counter > 0 {
            b.anim_counter -= 1;
        }

        // render sprite with kind when its not -1
        if b.kind != -1 && !b.clearing {
            if hiddens.contains(stack.from_i(i)) {
                hiddens.remove(stack.from_i(i));
            }

            if b.y == 0 {
                b.anim_offset = 1;
            }

            sprites.get_mut(stack.from_i(i)).unwrap().sprite_number = b.kind as usize * 8 + b.anim_offset as usize;
        }
        else {
            if !hiddens.contains(stack.from_i(i)) {
                hiddens.insert(stack.from_i(i), Hidden::default()).expect("add hide component");
            }
        }
    }
}
// visibility is on when the blocks kind isnt -1
// also sets the frame of the sprite by its kind * 9 and an additional 
// animation offset used to stay at specific horizontal sprites
visibility is on when the blocks kind isnt -1
also sets the frame of the sprite by its kind * 9 and an additional
animation offset used to stay at specific horizontal sprites
visibility is on when the blocks kind isnt - 1 also sets the frame of the sprite by its kind * 9 and an additional animation offset used to stay at specific horizontal sprites
fn update_sprites(
    stack: &Stack, 
    blocks: &mut WriteStorage<'_, Block>,
    sprites: &mut WriteStorage<'_, SpriteRender>,
    hiddens: &mut WriteStorage<'_, Hidden>) {
    for i in 0..BLOCKS {
        let b = blocks.get_mut(stack.from_i(i)).unwrap();
        // decrease all the time
        if b.anim_counter > 0 {
            b.anim_counter -= 1;
        }
        // render sprite with kind when its not -1
        if b.kind != -1 && !b.clearing {
            if hiddens.contains(stack.from_i(i)) {
                hiddens.remove(stack.from_i(i));
            }
            if b.y == 0 {
                b.anim_offset = 1;
            }
            sprites.get_mut(stack.from_i(i)).unwrap().sprite_number = b.kind as usize * 8 + b.anim_offset as usize;
        }
        else {
            if !hiddens.contains(stack.from_i(i)) {
                hiddens.insert(stack.from_i(i), Hidden::default()).expect("add hide component");
            }
        }
    }
}
fn update_sprites ( stack : & Stack , blocks : & mut WriteStorage < ' _ , Block > , sprites : & mut WriteStorage < ' _ , SpriteRender > , hiddens : & mut WriteStorage < ' _ , Hidden > ) { for i in 0 .. BLOCKS { let b = blocks . get_mut ( stack . from_i ( i ) ) . unwrap ( ) ; // decrease all the time if b . anim_counter > 0 { b . anim_counter -= 1 ; } // render sprite with kind when its not -1 if b . kind != - 1 && ! b . clearing { if hiddens . contains ( stack . from_i ( i ) ) { hiddens . remove ( stack . from_i ( i ) ) ; } if b . y == 0 { b . anim_offset = 1 ; } sprites . get_mut ( stack . from_i ( i ) ) . unwrap ( ) . sprite_number = b . kind as usize * 8 + b . anim_offset as usize ; } else { if ! hiddens . contains ( stack . from_i ( i ) ) { hiddens . insert ( stack . from_i ( i ) , Hidden :: default ( ) ) . expect ( " " ) ; } } } }
visibility is on when the blocks kind isnt -1
also sets the frame of the sprite by its kind * 9 and an additional
animation offset used to stay at specific horizontal sprites
visibility is on when the blocks kind isnt - 1 also sets the frame of the sprite by its kind * 9 and an additional animation offset used to stay at specific horizontal sprites
stack
&Stack
blocks
&mut WriteStorage<'_, Block>
sprites
&mut WriteStorage<'_, SpriteRender>
hiddens
&mut WriteStorage<'_, Hidden>
stack
&Stack
blocks
&mut WriteStorage<'_, Block>
sprites
&mut WriteStorage<'_, SpriteRender>
hiddens
&mut WriteStorage<'_, Hidden>