pixels/examples/invaders/README.md
Jay Oster 3968c9748a
Fix delta time in the invaders example (#252)
- Minor rewrite of the winit integration using the `game-loop` crate for
  fixed time-step updates.
- Updates are now handled at 240 fps, regardless of frame rate.
- Frame rate is capped at 240 fps.
- Adds a pause key.
- Closes #11
2022-01-08 10:44:52 -08:00

38 lines
1.1 KiB
Markdown

# Pixel Invaders 👾
![Pixel Invaders](../../img/invaders.png)
The pixels have invaded!
## Running
```bash
cargo run --release --package invaders
```
## Keyboard Controls
<kbd>🡰</kbd> <kbd>🡲</kbd>: Move tank
<kbd>Space</kbd>: Fire cannon
<kbd>Pause</kbd> <kbd>P</kbd>: 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.