mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-14 19:55:02 +01:00
more
This commit is contained in:
parent
59c63ab233
commit
e662cc9172
2 changed files with 3 additions and 46 deletions
45
src/debug.rs
45
src/debug.rs
|
|
@ -31,50 +31,7 @@ fn debug_panel_ui(
|
||||||
.show(
|
.show(
|
||||||
ctx,
|
ctx,
|
||||||
|ui| {
|
|ui| {
|
||||||
if debug.freecam {
|
|
||||||
ui.label("Cam x");
|
|
||||||
ui.add(egui::DragValue::new(&mut game.camera_offset.x));
|
|
||||||
ui.label("Cam y");
|
|
||||||
ui.add(egui::DragValue::new(&mut game.camera_offset.y));
|
|
||||||
let co = game.camera_offset;
|
|
||||||
ui.label(
|
|
||||||
format!(
|
|
||||||
"Cam Depth: {}", LengthDisp(co.y as f32 - WorldPos::SURFACE
|
|
||||||
as f32)
|
|
||||||
),
|
|
||||||
);
|
|
||||||
ui.label(
|
|
||||||
format!(
|
|
||||||
"Cam offset from center: {}", LengthDisp(co.x as f32 -
|
|
||||||
WorldPos::CENTER as f32)
|
|
||||||
),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
ui.label(
|
|
||||||
format!(
|
|
||||||
"Player Depth: {}", LengthDisp(game.world.player.feet_y() as
|
|
||||||
f32 - WorldPos::SURFACE as f32)
|
|
||||||
),
|
|
||||||
);
|
|
||||||
ui.label(
|
|
||||||
format!(
|
|
||||||
"Player offset from center: {}", LengthDisp(game.world.player
|
|
||||||
.col_en.en.pos.x as f32 - WorldPos::CENTER as f32)
|
|
||||||
),
|
|
||||||
);
|
|
||||||
ui.label(
|
|
||||||
format!(
|
|
||||||
"Hspeed: {} ({} km/h)", game.world.player.hspeed,
|
|
||||||
px_per_frame_to_km_h(game.world.player.hspeed)
|
|
||||||
),
|
|
||||||
);
|
|
||||||
ui.label(
|
|
||||||
format!(
|
|
||||||
"Vspeed: {} ({} km/h)", game.world.player.vspeed,
|
|
||||||
px_per_frame_to_km_h(game.world.player.vspeed)
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
ui.label("Music volume");
|
ui.label("Music volume");
|
||||||
let mut vol = res.surf_music.volume();
|
let mut vol = res.surf_music.volume();
|
||||||
ui.add(egui::DragValue::new(&mut vol));
|
ui.add(egui::DragValue::new(&mut vol));
|
||||||
|
|
|
||||||
|
|
@ -22,13 +22,13 @@ impl<Layer> Clone for TileId<Layer> {
|
||||||
}
|
}
|
||||||
impl<Layer> Debug for TileId<Layer> {
|
impl<Layer> Debug for TileId<Layer> {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
f.debug_tuple("TileId").field(&self.0).finish()
|
loop {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<Layer> TileId<Layer> {
|
impl<Layer> TileId<Layer> {
|
||||||
pub fn empty(&self) -> bool {
|
pub fn empty(&self) -> bool {
|
||||||
self.0 == 0
|
loop {}
|
||||||
}
|
}
|
||||||
pub const EMPTY: Self = Self(0, PhantomData);
|
pub const EMPTY: Self = Self(0, PhantomData);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue