Skip to content

Commit 999a509

Browse files
committed
update the example code
1 parent aa39228 commit 999a509

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Write your game!
6868
use rusty_engine::prelude::*;
6969

7070
// Define a struct to hold custom data for your game (it can be a lot more complicated than this one!)
71+
#[derive(Resource)]
7172
struct GameState {
7273
health: i32,
7374
}
@@ -78,7 +79,7 @@ Write your game!
7879
// Set up your game. `Game` exposes all of the methods and fields of `Engine`.
7980
let sprite = game.add_sprite("player", SpritePreset::RacingCarBlue);
8081
sprite.scale = 2.0;
81-
game.audio_manager.play_music(MusicPreset::Classy8Bit, 1.0);
82+
game.audio_manager.play_music(MusicPreset::Classy8Bit, 0.1);
8283
// Add one or more functions with logic for your game. When the game is run, the logic
8384
// functions will run in the order they were added.
8485
game.add_logic(game_logic);

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
//! use rusty_engine::prelude::*;
1515
//!
1616
//! // Define a struct to hold custom data for your game (it can be a lot more complicated than this one!)
17+
//! #[derive(Resource)]
1718
//! struct GameState {
1819
//! health: i32,
1920
//! }
@@ -24,7 +25,7 @@
2425
//! // Set up your game. `Game` exposes all of the methods and fields of `Engine`.
2526
//! let sprite = game.add_sprite("player", SpritePreset::RacingCarBlue);
2627
//! sprite.scale = 2.0;
27-
//! game.audio_manager.play_music(MusicPreset::Classy8Bit, 1.0);
28+
//! game.audio_manager.play_music(MusicPreset::Classy8Bit, 0.1);
2829
//! // Add one or more functions with logic for your game. When the game is run, the logic
2930
//! // functions will run in the order they were added.
3031
//! game.add_logic(game_logic);

0 commit comments

Comments
 (0)