0.1.0-0-pre.11-fix.1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/games/game-snake-poc/src/lib.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
#![warn(missing_docs)]
|
||||
#![deny(unreachable_pub)]
|
||||
@@ -9,5 +9,7 @@
|
||||
|
||||
mod state;
|
||||
|
||||
/// Re-export of one Snake grid cell.
|
||||
pub use self::state::SnakeCell;
|
||||
/// Re-export of the Snake POC state.
|
||||
pub use self::state::SnakeState;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/games/game-snake-poc/src/state.rs
|
||||
// version: 4
|
||||
// version: 5
|
||||
|
||||
const GRID_HEIGHT: i16 = 20;
|
||||
const GRID_WIDTH: i16 = 12;
|
||||
@@ -169,7 +169,7 @@ impl SnakeState {
|
||||
impl engine_v1_common::EngineGame for SnakeState {
|
||||
fn update(&mut self, frame: engine_v1_common::EngineFrame, input: engine_v1_common::InputState) {
|
||||
self.apply_direction_input(input);
|
||||
if frame.index() % MOVE_EVERY_FRAMES == 0 {
|
||||
if frame.index().is_multiple_of(MOVE_EVERY_FRAMES) {
|
||||
self.move_once();
|
||||
}
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user