fn execute(i: usize, stack: &Stack, blocks: &mut WriteStorage<'_, Block>) {
		let b = blocks.get_mut(stack.from_i(i)).unwrap();

		// clear at the end of the animation
		let test = b.clear_time as i32 - b.clear_counter as i32;
		if test <= 0 && !b.clearing {
			// particles spawn
			b.clearing = true;
		}
		else {
			b.clear_counter += 1;
			b.clear_anim_counter += 1;
			
			// split animation in 2 parts
			if b.clear_anim_counter < FLASH_TIME {
				// flashy animation
				if b.anim_counter == 0 {
					b.anim_counter = 4;
				}
				else {
					b.anim_offset = FLASH_ANIM[b.anim_counter as usize];
				}
			}
			else {
				// just the face sprite
				b.anim_offset = 5;
			}
		}
	}
// just the animation part of the whole clearing
just the animation part of the whole clearing
just the animation part of the whole clearing
fn execute(i: usize, stack: &Stack, blocks: &mut WriteStorage<'_, Block>) {
		let b = blocks.get_mut(stack.from_i(i)).unwrap();
		// clear at the end of the animation
		let test = b.clear_time as i32 - b.clear_counter as i32;
		if test <= 0 && !b.clearing {
			// particles spawn
			b.clearing = true;
		}
		else {
			b.clear_counter += 1;
			b.clear_anim_counter += 1;
			// split animation in 2 parts
			if b.clear_anim_counter < FLASH_TIME {
				// flashy animation
				if b.anim_counter == 0 {
					b.anim_counter = 4;
				}
				else {
					b.anim_offset = FLASH_ANIM[b.anim_counter as usize];
				}
			}
			else {
				// just the face sprite
				b.anim_offset = 5;
			}
		}
	}
fn execute ( i : usize , stack : & Stack , blocks : & mut WriteStorage < ' _ , Block > ) { let b = blocks . get_mut ( stack . from_i ( i ) ) . unwrap ( ) ; // clear at the end of the animation let test = b . clear_time as i32 - b . clear_counter as i32 ; if test <= 0 && ! b . clearing { // particles spawn b . clearing = true ; } else { b . clear_counter += 1 ; b . clear_anim_counter += 1 ; // split animation in 2 parts if b . clear_anim_counter < FLASH_TIME { // flashy animation if b . anim_counter == 0 { b . anim_counter = 4 ; } else { b . anim_offset = FLASH_ANIM [ b . anim_counter as usize ] ; } } else { // just the face sprite b . anim_offset = 5 ; } } }
just the animation part of the whole clearing
just the animation part of the whole clearing
i
usize
stack
&Stack
blocks
&mut WriteStorage<'_, Block>
i
usize
stack
&Stack
blocks
&mut WriteStorage<'_, Block>