pixels/examples/invaders
Jay Oster c4df23f65d
Update to wgpu 0.9 (#179)
* Update to wgpu 0.9

* Fix validation error in WGSL shader

- This moves the hardcoded vertex positions and texture coordinates to
  the vertex buffer.
- Replaces the two-triangle quad to 1 full-screen triangle (fixes #180)
- Rewrites the custom shader example to fix a bug with large surface
  textures;
  - The input texture size was used for the output texture, causing the
    purple rectangle to appear very jumpy on large displays in full screen.
- The `ScalingRenderer` now exposes its clipping rectangle. The custom
  shader example uses this for its own clipping rectangle, but it can
  also be used for interacting with the border in general.

* Switch to `wgpu::include_wgsl!()`

- This is a nice little simplification.
- Thanks to @JMS55 for the suggestion!
2021-06-27 11:09:29 -07:00
..
simple-invaders Update to wgpu 0.9 (#179) 2021-06-27 11:09:29 -07:00
src Update to wgpu 0.9 (#179) 2021-06-27 11:09:29 -07:00
Cargo.toml Update winit to 0.25 (#168) 2021-05-29 02:18:48 -07:00
README.md Fix dependency bloat (#67) 2020-04-13 10:12:18 -07:00

Pixel Invaders 👾

Pixel Invaders

The pixels have invaded!

Running

cargo run --release --package invaders

Controls

Left Right Move tank

space Fire cannon

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.