Updated arch
This commit is contained in:
parent
3d79b8c199
commit
c9514edb9e
BIN
DarkSnake.png
Normal file
BIN
DarkSnake.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2025 Snake Game Project
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
30
include/Config.h
Normal file
30
include/Config.h
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#ifndef CONFIG_H
|
||||||
|
#define CONFIG_H
|
||||||
|
|
||||||
|
namespace Config {
|
||||||
|
// Game board dimensions
|
||||||
|
constexpr int BOARD_WIDTH = 20;
|
||||||
|
constexpr int BOARD_HEIGHT = 20;
|
||||||
|
constexpr int CELL_SIZE = 24;
|
||||||
|
|
||||||
|
// Window settings
|
||||||
|
constexpr int WINDOW_WIDTH = BOARD_WIDTH * CELL_SIZE;
|
||||||
|
constexpr int WINDOW_HEIGHT = BOARD_HEIGHT * CELL_SIZE + 100; // Extra space for UI
|
||||||
|
|
||||||
|
// Game timing
|
||||||
|
constexpr float INITIAL_SPEED = 0.2f; // Seconds between moves
|
||||||
|
constexpr float SPEED_INCREMENT = 0.01f;
|
||||||
|
constexpr float MIN_SPEED = 0.05f;
|
||||||
|
|
||||||
|
// Colors (RGBA)
|
||||||
|
constexpr unsigned int BACKGROUND_COLOR = 0x000000FF; // Black
|
||||||
|
constexpr unsigned int SNAKE_COLOR = 0x00FF00FF; // Green
|
||||||
|
constexpr unsigned int FOOD_COLOR = 0xFF0000FF; // Red
|
||||||
|
constexpr unsigned int BORDER_COLOR = 0xFFFFFFFF; // White
|
||||||
|
|
||||||
|
// File paths
|
||||||
|
constexpr const char* BEST_SCORE_FILE = "best_score.txt";
|
||||||
|
constexpr const char* WINDOW_TITLE = "Snake Game";
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // CONFIG_H
|
||||||
11
include/GameState.h
Normal file
11
include/GameState.h
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#ifndef GAMESTATE_H
|
||||||
|
#define GAMESTATE_H
|
||||||
|
|
||||||
|
enum class GameState {
|
||||||
|
MENU,
|
||||||
|
PLAYING,
|
||||||
|
PAUSED,
|
||||||
|
GAME_OVER
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // GAMESTATE_H
|
||||||
Loading…
Reference in New Issue
Block a user