| 1 | #include <iostream> |
| 2 | #include <raylib.h> |
| 3 | #include <snake/snake.hh> |
| 4 | |
| 5 | int main(void) { |
| 6 | constexpr int screenWidth = 800; |
| 7 | constexpr int screenHeight = 600; |
| 8 | |
| 9 | #if PRODUCTION_BUILD == 1 |
| 10 | SetTraceLogLevel(LOG_NONE); |
| 11 | #endif |
| 12 | InitWindow(screenWidth, screenHeight, "Snake"); |
| 13 | SetExitKey(KEY_NULL); |
| 14 | SetTargetFPS(120); |
| 15 | |
| 16 | bool running = true; |
| 17 | snake::Init(); |
| 18 | |
| 19 | while (running && !WindowShouldClose()) { |
| 20 | if (IsKeyPressed(KEY_Q)) { |
| 21 | running = false; |
| 22 | } |
| 23 | |
| 24 | BeginDrawing(); |
| 25 | snake::Update(); |
| 26 | EndDrawing(); |
| 27 | } |
| 28 | |
| 29 | snake::Close(); |
| 30 | CloseWindow(); |
| 31 | |
| 32 | return 0; |
| 33 | } |