energie lost overworld
Some checks failed
Rust / rustfmt (push) Failing after 24s
Rust / clippy (push) Failing after 1m26s
Rust / build (push) Successful in 3m3s

This commit is contained in:
luckyturtledev 2024-07-07 16:39:54 +02:00
parent b9e065058f
commit 2354e34142
3 changed files with 37 additions and 11 deletions

View file

@ -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<'_>) {