index : snake-rs
An implementation of the classic Snake game in Rust using SDL2
about summary refs log tree commit diff

Diffstat (limited to 'src/game_context.rs')

-rw-r--r-- src/game_context.rs 7
 1 file changed, 7 insertions(+)

diff --git a/src/game_context.rs b/src/game_context.rs
index 9a6643c..74802a1 100644
--- a/src/game_context.rs
+++ b/src/game_context.rs
@@ -3,9 +3,11 @@

use crate::{renderer::Renderer};

#[derive(Copy, Clone, PartialEq)]
pub enum GameState {
    Playing,
    Paused,
    Over,
}

#[derive(Copy, Clone, PartialEq)] // أضف هذي السطور
@@ -140,6 +142,11 @@
        self.state = match self.state {
            GameState::Playing => GameState::Paused,
            GameState::Paused => GameState::Playing,
            _ => return,
        }
    }

    pub fn restart(&self) {
        todo!()
    }
}