Add basic player physics

This commit is contained in:
crumblingstatue 2023-04-03 17:39:49 +02:00
parent 5a6fe33e1e
commit beabf269e5
3 changed files with 37 additions and 13 deletions

View file

@ -7,12 +7,14 @@ use crate::{
pub struct Player {
pub col_en: MobileEntity,
pub vspeed: f32,
}
impl Player {
pub fn new_at(pos: WorldPos) -> Self {
Self {
col_en: MobileEntity::from_pos_and_bb(vec2(pos.x as i32, pos.y as i32), vec2(15, 24)),
vspeed: 0.0,
}
}
pub fn center_tp(&self) -> TilePos {