Module state

Module state 

Source
Expand description

§Game State Management

This module defines a GameState struct that manages game-related flags such as life, score, and game status. It provides methods for initializing and resetting the game state.

§Example

use rsnaker::game_logic::state::{GameState, GameStatus};

let mut state = GameState::new(3); // Initialize game_logic with 3 lives
assert_eq!(state.life, 3);
assert_eq!(state.score, 0);
assert_eq!(state.status, GameStatus::Playing);

state.reset(); // Reset game_logic state
assert_eq!(state.life, 3);
assert_eq!(state.score, 0);

Structs§

GameState
Manages the game state, including life count, score, and current status.

Enums§

GameOverMenu
Represents the possible options in the Game Over menu.
GameStatus
Represents the possible states of the game.