Game Utils
Simple game utilities
Usage
Cargo
In your Cargo.toml file add
simple-game-utils = { version = "0.5.3", features = ["controller"] }
Code
Timing
This program runs for 1 second then exits.
//track passage of time
let mut timing = new; //UPS
//triggers after specified time has passed
let mut timer = new;
loop
Sound
Requires
sound
feature
let mut engine = new.unwrap;
let mut sound = engine.load_from_bytes.unwrap;
sound.play;
loop
Controller
Requires
controller
orcontroller_xinput
feature
// This will work whether or not there's a controller plugged in
let mut controller = new.expect;
loop
Preferences
Requires
prefs
feature
let prefs: = new.unwrap;
println!;
prefs.data.user = String new;
prefs.save;
Tilemap
Features
Default features:
prefs
,sound
,serde
,ici
prefs
Simple struct storage
controller
Very basic controller support
- no support for choosing controllers
Can not be used with
controllerxinput
controller_xinput
Use XInput for controllers (windows only)
Can not be used with
controller
sound
Basic sound effects or music playback
serde
Adds serialization for some structs and enums
ici
Adds ICI file support for tilemap