-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Slowed down how fast our player moves around the road.
- Loading branch information
StarArawn
authored and
StarArawn
committed
Apr 13, 2021
1 parent
0b6ab33
commit f4476e1
Showing
6 changed files
with
50 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod player; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/game/player/player.rs → src/game/gameplay/player/player.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
use bevy::prelude::*; | ||
|
||
#[derive(Default, Clone, Debug)] | ||
pub struct Player { | ||
pub current_position: usize, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use bevy::prelude::*; | ||
|
||
#[derive(Default)] | ||
pub struct Timing { | ||
pub last_time: f64, | ||
pub should_update: bool, | ||
} | ||
|
||
pub fn update( | ||
time: Res<Time>, | ||
mut timing: ResMut<Timing>, | ||
) { | ||
|
||
let current = time.seconds_since_startup(); | ||
if (current - timing.last_time) > 0.500 { | ||
timing.last_time = current; | ||
timing.should_update = true; | ||
} | ||
} |