Houses have energy that interact with ghosts (#18)
Reviewed-on: #18 Co-authored-by: Dominic <git@msrd0.de> Co-committed-by: Dominic <git@msrd0.de>
This commit is contained in:
parent
2354e34142
commit
0c9624d511
5 changed files with 117 additions and 40 deletions
|
@ -1,4 +1,8 @@
|
|||
use crate::{activities::Activity, game::ZLayer, State};
|
||||
use crate::{
|
||||
activities::Activity,
|
||||
game::{ZLayer, GHOST_DISCHARGE_RATE, GHOST_DISCHARGE_RATE_MOVEMENT},
|
||||
State
|
||||
};
|
||||
use comfy::{
|
||||
delta, draw_circle, draw_rect_outline, draw_sprite, error, info, is_key_down,
|
||||
main_camera_mut, EngineContext, IVec2, KeyCode, Vec2, RED, WHITE
|
||||
|
@ -177,9 +181,9 @@ pub fn update(state: &mut State, ctx: &mut EngineContext<'_>) {
|
|||
// energie lost
|
||||
{
|
||||
let ghost = &mut state.ghost;
|
||||
ghost.charge -= 70.0 * ctx.delta;
|
||||
ghost.charge -= GHOST_DISCHARGE_RATE * ctx.delta;
|
||||
if ghost.overworld_movement_pending != Vec2::ZERO {
|
||||
ghost.charge -= 70.0 * ctx.delta;
|
||||
ghost.charge -= GHOST_DISCHARGE_RATE_MOVEMENT * ctx.delta;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue