pixels/examples/invaders
Jay Oster 5a96eea6ba
Handle all wgpu::SurfaceError variants (#348)
This fixes error handling for all `wgpu::SurfaceError` variants. It also adds more context to error messages printed by the examples.

Closes #346
2023-03-21 07:16:51 -07:00
..
simple-invaders Make Rust standard library optional (WIP) (#342) 2023-03-16 15:13:36 -07:00
src Handle all wgpu::SurfaceError variants (#348) 2023-03-21 07:16:51 -07:00
Cargo.toml Handle all wgpu::SurfaceError variants (#348) 2023-03-21 07:16:51 -07:00
README.md Fix delta time in the invaders example (#252) 2022-01-08 10:44:52 -08:00

Pixel Invaders 👾

Pixel Invaders

The pixels have invaded!

Running

cargo run --release --package invaders

Keyboard Controls

🡰 🡲: Move tank

Space: Fire cannon

Pause P: Pause

GamePad Controls

D-Pad 🡰 D-Pad 🡲: Move tank

XBox 🅐 PS 🅧 Switch 🅑: Fire cannon

XBox/PS ≡ Switch ⊕︀: Pause

Goal

Shoot all of the invaders before they reach Earth and begin a hostile takeover. Be careful, because the entire fleet is coordinated and acts as a hive mind. Their aggression increases as their numbers dwindle.

Architecture

Pixel Invaders uses the simple-invaders crate for all game logic and drawing. Be sure to check out that crate if you are interested in any of the inner workings of the game.

This example is simply glue code that uses winit for windowing/event handling and keyboard input. The winit event loop is used to drive the simple-invaders state and rasterize each frame. Finally, pixels takes the rasterized frame buffer and sends it to the screen, optionally through a series of render passes.