pub struct DemoPhysicsScene { /* private fields */ }Expand description
Full-featured 2D arcade arena scene powered by GameWorld, PhysicsWorld2D, Camera2D, ParticleSystem, TileMap, ActionMap, and AudioBus.
Implementations§
Source§impl DemoPhysicsScene
Arena setup and gameplay helper methods for DemoPhysicsScene.
impl DemoPhysicsScene
Arena setup and gameplay helper methods for DemoPhysicsScene.
Sourcepub fn create_arena() -> Self
pub fn create_arena() -> Self
Builds a playable 1280x720 tiled neon arena with player ship, obstacles, and initial enemy wave.
§Returns
Self- Initialized playable arena scene.
Sourcepub fn spawn_enemy_wave(&mut self, count: usize)
pub fn spawn_enemy_wave(&mut self, count: usize)
Spawns count patrolling enemy drones around the arena perimeter.
§Arguments
&Self- Mutable arena scene.usize- Number of enemy drones to spawn.
Source§impl DemoPhysicsScene
impl DemoPhysicsScene
pub fn get_world(&self) -> &GameWorld
pub fn get_mut_world(&mut self) -> &mut GameWorld
pub fn set_world(&mut self, val: GameWorld) -> &mut Self
pub fn get_physics(&self) -> &PhysicsWorld2D
pub fn get_mut_physics(&mut self) -> &mut PhysicsWorld2D
pub fn set_physics(&mut self, val: PhysicsWorld2D) -> &mut Self
pub fn get_camera(&self) -> Camera2D
pub fn get_mut_camera(&mut self) -> &mut Camera2D
pub fn set_camera(&mut self, val: Camera2D) -> &mut Self
pub fn get_particles(&self) -> &ParticleSystem
pub fn get_mut_particles(&mut self) -> &mut ParticleSystem
pub fn set_particles(&mut self, val: ParticleSystem) -> &mut Self
pub fn get_tilemap(&self) -> &TileMap
pub fn get_mut_tilemap(&mut self) -> &mut TileMap
pub fn set_tilemap(&mut self, val: TileMap) -> &mut Self
pub fn get_actions(&self) -> &ActionMap
pub fn get_mut_actions(&mut self) -> &mut ActionMap
pub fn set_actions(&mut self, val: ActionMap) -> &mut Self
pub fn get_audio(&self) -> &AudioBus
pub fn get_mut_audio(&mut self) -> &mut AudioBus
pub fn set_audio(&mut self, val: AudioBus) -> &mut Self
pub fn get_player_id(&self) -> EntityId
pub fn get_mut_player_id(&mut self) -> &mut EntityId
pub fn set_player_id(&mut self, val: EntityId) -> &mut Self
pub fn get_fire_cooldown(&self) -> f32
pub fn get_mut_fire_cooldown(&mut self) -> &mut f32
pub fn set_fire_cooldown(&mut self, val: f32) -> &mut Self
pub fn get_dash_cooldown(&self) -> f32
pub fn get_mut_dash_cooldown(&mut self) -> &mut f32
pub fn set_dash_cooldown(&mut self, val: f32) -> &mut Self
pub fn get_score(&self) -> u32
pub fn get_mut_score(&mut self) -> &mut u32
pub fn set_score(&mut self, val: u32) -> &mut Self
pub fn get_wave(&self) -> u32
pub fn get_mut_wave(&mut self) -> &mut u32
pub fn set_wave(&mut self, val: u32) -> &mut Self
pub fn get_show_colliders(&self) -> bool
pub fn get_mut_show_colliders(&mut self) -> &mut bool
pub fn set_show_colliders(&mut self, val: bool) -> &mut Self
pub fn get_smoothed_fps(&self) -> f32
pub fn get_mut_smoothed_fps(&mut self) -> &mut f32
pub fn set_smoothed_fps(&mut self, val: f32) -> &mut Self
pub fn get_ticks(&self) -> u64
pub fn get_mut_ticks(&mut self) -> &mut u64
pub fn set_ticks(&mut self, val: u64) -> &mut Self
Trait Implementations§
Source§impl Clone for DemoPhysicsScene
impl Clone for DemoPhysicsScene
Source§impl Debug for DemoPhysicsScene
impl Debug for DemoPhysicsScene
Source§impl GameScene for DemoPhysicsScene
Deterministic fixed-timestep 2D game engine simulation and camera-driven HUD rendering for DemoPhysicsScene.
impl GameScene for DemoPhysicsScene
Deterministic fixed-timestep 2D game engine simulation and camera-driven HUD rendering for DemoPhysicsScene.
Source§fn fixed_update(&mut self, dt: f32, input: &InputState)
fn fixed_update(&mut self, dt: f32, input: &InputState)
Steps player controls, ECS physics, collision combat, particles, and camera follow at 60Hz fixed cadence.
§Arguments
&Self- Mutable arena scene.f32- Fixed simulation delta time in seconds.&InputState- Real-time polled keyboard and pointer state.
Source§fn update(&mut self, dt: f32, _input: &InputState)
fn update(&mut self, dt: f32, _input: &InputState)
Updates smoothed frame-rate telemetry once per visual frame.
§Arguments
&Self- Mutable arena scene.f32- Real frame delta time in seconds.&InputState- Current polled input snapshot.
Source§fn render(&mut self, _alpha: f32, ctx: &mut GameRenderContext<'_>)
fn render(&mut self, _alpha: f32, ctx: &mut GameRenderContext<'_>)
Renders the camera-projected tilemap, ECS entities, raycast targeting laser, particles, and engine HUD.
§Arguments
&Self- Mutable arena scene.f32- Interpolation alpha in[0.0, 1.0].&mut GameRenderContext<'_>- Immediate-mode game draw surface.
Auto Trait Implementations§
impl Forget for DemoPhysicsScene
impl Freeze for DemoPhysicsScene
impl Move for DemoPhysicsScene
impl RefUnwindSafe for DemoPhysicsScene
impl Send for DemoPhysicsScene
impl Sync for DemoPhysicsScene
impl Unpin for DemoPhysicsScene
impl UnsafeUnpin for DemoPhysicsScene
impl UnwindSafe for DemoPhysicsScene
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more