0.1.0-0-pre.11-fix.1

This commit is contained in:
2026-09-16 11:40:22 +02:00
parent ab9403384f
commit b43eb66a5d
4 changed files with 82 additions and 5 deletions

View File

@@ -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;

View File

@@ -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;