diff --git a/DarkSnake.png b/DarkSnake.png new file mode 100644 index 0000000..3444fe7 Binary files /dev/null and b/DarkSnake.png differ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..289cd60 --- /dev/null +++ b/LICENSE @@ -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. diff --git a/include/Config.h b/include/Config.h new file mode 100644 index 0000000..e919e21 --- /dev/null +++ b/include/Config.h @@ -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 diff --git a/include/GameState.h b/include/GameState.h new file mode 100644 index 0000000..2b68e38 --- /dev/null +++ b/include/GameState.h @@ -0,0 +1,11 @@ +#ifndef GAMESTATE_H +#define GAMESTATE_H + +enum class GameState { + MENU, + PLAYING, + PAUSED, + GAME_OVER +}; + +#endif // GAMESTATE_H