From e6d6e50e1d44887bf979d3519fe1052e3fc864c5 Mon Sep 17 00:00:00 2001 From: Saverio Miroddi Date: Thu, 28 Jul 2022 22:57:44 +0200 Subject: [PATCH] Implement first version of camera stopping Define points in the levels, where all the enemies (spawned) until then must be defeated before continuing. The camera logic needs refinements (extra complexity) because for example, as of now, when there is a stop point, the players can't cross it, leaving a small part of the screen unusable by them. --- src/attack.rs | 14 +++++++++--- src/movement.rs | 60 ++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 66 insertions(+), 8 deletions(-) diff --git a/src/attack.rs b/src/attack.rs index 125e8356..1e678d1e 100644 --- a/src/attack.rs +++ b/src/attack.rs @@ -23,9 +23,10 @@ use crate::{ self, ATTACK_HEIGHT, ATTACK_LAYER, ATTACK_WIDTH, ITEM_BOTTLE_NAME, ITEM_HEIGHT, ITEM_LAYER, ITEM_WIDTH, THROW_ITEM_ROTATION_SPEED, }, + enemy::SpawnLocationX, input::PlayerAction, item::item_carried_by_player, - metadata::{FighterMeta, GameMeta, ItemMeta}, + metadata::{FighterMeta, GameMeta, ItemMeta, LevelMeta}, movement::{ clamp_player_movements, LeftMovementBoundary, MoveInArc, MoveInDirection, Rotate, Target, }, @@ -296,6 +297,8 @@ fn player_flop( ), With, >, + enemy_spawn_locations_query: Query<&SpawnLocationX>, + level_meta: Res, fighter_assets: Res>, time: Res