File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff 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 );
Original file line number Diff line number Diff line change 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//! }
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);
You can’t perform that action at this time.
0 commit comments