energie lost overworld
This commit is contained in:
parent
b9e065058f
commit
2354e34142
3 changed files with 37 additions and 11 deletions
19
src/game.rs
19
src/game.rs
|
@ -4,7 +4,10 @@ use crate::{
|
|||
State
|
||||
};
|
||||
use comfy::{EngineContext, Vec2};
|
||||
use std::{ops::Sub, time::Instant};
|
||||
use std::{
|
||||
ops::{Add, Sub},
|
||||
time::Instant
|
||||
};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Ghost {
|
||||
|
@ -71,7 +74,8 @@ pub enum ZLayer {
|
|||
ElectricLayer = -2,
|
||||
MapMax = -1,
|
||||
Human = 0,
|
||||
Ghost = 1
|
||||
Ghost = 1,
|
||||
UI = 100
|
||||
}
|
||||
|
||||
impl From<ZLayer> for i32 {
|
||||
|
@ -89,7 +93,15 @@ impl Sub<i32> for ZLayer {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn setup(state: &mut State, ctx: &mut EngineContext<'_>) {
|
||||
impl Add<i32> for ZLayer {
|
||||
type Output = i32;
|
||||
|
||||
fn add(self, other: i32) -> Self::Output {
|
||||
i32::from(self) + other
|
||||
}
|
||||
}
|
||||
|
||||
pub fn setup(_state: &mut State, ctx: &mut EngineContext<'_>) {
|
||||
Assets::load(ctx);
|
||||
|
||||
//house::setup(state, ctx);
|
||||
|
@ -101,6 +113,7 @@ pub fn update(state: &mut State, engine: &mut EngineContext<'_>) {
|
|||
Activity::House(_) => house::update(state, engine),
|
||||
Activity::Overworld => overworld::update(state, engine)
|
||||
}
|
||||
state.ghost.charge = state.ghost.charge.max(0.0);
|
||||
}
|
||||
|
||||
pub fn draw(state: &State, engine: &EngineContext<'_>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue