Series of tutorials on how to use the Piston game engine.
Top line of every .rs file says the name of the feature. Compile examples using cargo run --release --bin [FEATURE NAME]
.
Must have a basic understanding of Rust, including concepts like functions, variables, references, and dependencies. I'll try to explain as much as I can, though.
By default, examples need OpenGL 3.2 to run, but you can run them on 2.1 by changing one line of code in the window initialization.
Two different sound libraries are included and demonstrated in the getting_started folder: Ears, and piston_music. Ears requires OpenAL and libsnd, while piston_music requires SDL2 and SDL2_mixer. If you don't have these libraries installed and don't plan on using the sound examples, you can just remove them from Cargo.toml's dependencies section.
Two sound examples are included, both numbered in getting_started as example 6. When the tutorials were first written, I had no idea that piston_music even existed, and so I wrote an example based on the Ears library instead. When I found out about piston_music, I wrote an example about it too, but I kept the Ears example because it's much simpler to add and setup than piston_music, and it has different library requirements. Future examples involving sound will likely use piston_music exclusively, as this is a tutorial series about Piston.
The Coder's Crux font used in the pong_ball example was created by Andrew McClusky. You can find its download page here.
The song used in the sound examples is The Entertainer by Scott Joplin, and is licensed under Creative Commons 0. You can find its download page on the Free Music Archive here
Speaker icons used in the sound examples are taken from Wikipedia, and are also licensed under Creative Commons 0.
The beeping sound used in the sound examples are from use code149 on Freesound, and can be downloaded from here. No edits or alterations were made to the original track.
beep.ogg, used in the pong examples, is from rust-pong, and is under the MIT license. You can find its repository here.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.