private void move() { current_space.decay(); current_space = space_to_move_to; space_to_move_to = null; anim.set_clip(1); if (!current_space.space_connected_to_goal()) { // reload scene hit_player(); } am.play(sounds[sound_index]); sound_index = (sound_index + 1) % sounds.Length; // Unlock obstackle space if you found the key if (current_space.is_key) { am.play("hover"); current_space.obstacle_space.remove_obstacle(); } if (current_space.is_goal) { am.play("win"); } }
private void move() { current_space.decay(); current_space = next_space; next_space = null; }