Support Warning
WebGPU is currently only supported on Chrome starting with version 113, and only on desktop. If they don't work on your configuration, you can check the WebGL2 examples here.2d_top_down_camera.rs:
//! This example showcases a 2D top-down camera with smooth player tracking.
//!
//! ## Controls
//!
//! | Key Binding | Action |
//! |:---------------------|:--------------|
//! | `Z`(azerty), `W`(US) | Move forward |
//! | `S` | Move backward |
//! | `Q`(azerty), `A`(US) | Move left |
//! | `D` | Move right |
use BloomSettings;
use vec3;
use *;
use ;
/// Player movement speed factor.
const PLAYER_SPEED: f32 = 100.;
/// Camera lerp factor.
const CAM_LERP_FACTOR: f32 = 2.;
;
/// Update the camera position by tracking the player.
/// Update the player position with keyboard inputs.