rocket.mp4
Rocket is a simpler version of the hit game asteroids. Its purpose is to help people learn how to structure a Rust program in a fun way. Please feel free to reuse and/or modify Rocket however you like. This is not how you would structure an actual video game for best performance, but rather a simpler, object-oriented approach that is beginner friendly. For one way to structure a more advanced program, potentially with multi-threading, see Entity Component System on Wikipedia. For more information about the math involved, you can see my website under the blog section.
You will need to install SDL3 from source. Please see this for the latest instructions for your environment. After following those instructions and installing SDL3 with
make install
I needed to:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/libAfter that, you can run Rocket with:
cargo run --releaseA window should immediately pop up after compilation.
- w - accelerate forward
- a - turn counterclockwise
- d - turn clockwise
- spacebar - fire a missile