Skip to main content

DemoPhysicsScene

Struct DemoPhysicsScene 

Source
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.

Source

pub fn create_lazy_arena() -> Self

Creates an empty zero-allocation 2D arena placeholder that hydrates lazily on first active tick or render.

§Returns
  • Self - Uninitialized lazy arena placeholder.
Source

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.
Source

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

Source

pub fn get_world(&self) -> &GameWorld

Source

pub fn get_mut_world(&mut self) -> &mut GameWorld

Source

pub fn set_world(&mut self, val: GameWorld) -> &mut Self

Source

pub fn get_physics(&self) -> &PhysicsWorld2D

Source

pub fn get_mut_physics(&mut self) -> &mut PhysicsWorld2D

Source

pub fn set_physics(&mut self, val: PhysicsWorld2D) -> &mut Self

Source

pub fn get_camera(&self) -> Camera2D

Source

pub fn get_mut_camera(&mut self) -> &mut Camera2D

Source

pub fn set_camera(&mut self, val: Camera2D) -> &mut Self

Source

pub fn get_particles(&self) -> &ParticleSystem

Source

pub fn get_mut_particles(&mut self) -> &mut ParticleSystem

Source

pub fn set_particles(&mut self, val: ParticleSystem) -> &mut Self

Source

pub fn get_tilemap(&self) -> &TileMap

Source

pub fn get_mut_tilemap(&mut self) -> &mut TileMap

Source

pub fn set_tilemap(&mut self, val: TileMap) -> &mut Self

Source

pub fn get_actions(&self) -> &ActionMap

Source

pub fn get_mut_actions(&mut self) -> &mut ActionMap

Source

pub fn set_actions(&mut self, val: ActionMap) -> &mut Self

Source

pub fn get_audio(&self) -> &AudioBus

Source

pub fn get_mut_audio(&mut self) -> &mut AudioBus

Source

pub fn set_audio(&mut self, val: AudioBus) -> &mut Self

Source

pub fn get_player_id(&self) -> EntityId

Source

pub fn get_mut_player_id(&mut self) -> &mut EntityId

Source

pub fn set_player_id(&mut self, val: EntityId) -> &mut Self

Source

pub fn get_fire_cooldown(&self) -> f32

Source

pub fn get_mut_fire_cooldown(&mut self) -> &mut f32

Source

pub fn set_fire_cooldown(&mut self, val: f32) -> &mut Self

Source

pub fn get_dash_cooldown(&self) -> f32

Source

pub fn get_mut_dash_cooldown(&mut self) -> &mut f32

Source

pub fn set_dash_cooldown(&mut self, val: f32) -> &mut Self

Source

pub fn get_score(&self) -> u32

Source

pub fn get_mut_score(&mut self) -> &mut u32

Source

pub fn set_score(&mut self, val: u32) -> &mut Self

Source

pub fn get_wave(&self) -> u32

Source

pub fn get_mut_wave(&mut self) -> &mut u32

Source

pub fn set_wave(&mut self, val: u32) -> &mut Self

Source

pub fn get_show_colliders(&self) -> bool

Source

pub fn get_mut_show_colliders(&mut self) -> &mut bool

Source

pub fn set_show_colliders(&mut self, val: bool) -> &mut Self

Source

pub fn get_smoothed_fps(&self) -> f32

Source

pub fn get_mut_smoothed_fps(&mut self) -> &mut f32

Source

pub fn set_smoothed_fps(&mut self, val: f32) -> &mut Self

Source

pub fn get_ticks(&self) -> u64

Source

pub fn get_mut_ticks(&mut self) -> &mut u64

Source

pub fn set_ticks(&mut self, val: u64) -> &mut Self

Source

pub fn get_viewport_size(&self) -> Size

Source

pub fn get_mut_viewport_size(&mut self) -> &mut Size

Source

pub fn set_viewport_size(&mut self, val: Size) -> &mut Self

Source

pub fn get_initialized(&self) -> bool

Source

pub fn get_mut_initialized(&mut self) -> &mut bool

Source

pub fn set_initialized(&mut self, val: bool) -> &mut Self

Trait Implementations§

Source§

impl Clone for DemoPhysicsScene

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DemoPhysicsScene

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

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)

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)

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

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
where RawVecInner: Send, RawTable<(GameAction, Vec<KeyCode>)>: Send, RawTable<(GameAction, Vec<PointerButton>)>: Send,

§

impl Sync for DemoPhysicsScene
where RawVecInner: Sync, RawTable<(GameAction, Vec<KeyCode>)>: Sync, RawTable<(GameAction, Vec<PointerButton>)>: Sync,

§

impl Unpin for DemoPhysicsScene
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for DemoPhysicsScene

§

impl UnwindSafe for DemoPhysicsScene

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.