#include "game.h" #include "raylib.h" Game::Game(int width, int height, std::string title) { InitWindow(width, height, title.c_str()); SetTargetFPS(60); // Set our game to run at 60 frames-per-second } Game::~Game() { CloseWindow(); // Close window and OpenGL context } bool Game::GameShouldClose() const { return WindowShouldClose(); } void Game::Tick() { BeginDrawing(); Update(); Draw(); EndDrawing(); } void Game::Draw() { // Draw //---------------------------------------------------------------------------------- ClearBackground(RAYWHITE); DrawText("Hello There", 190, 200, 20, MAROON); DrawCircle(x, y, r, PURPLE); //---------------------------------------------------------------------------------- } void Game::Update() { // Update //---------------------------------------------------------------------------------- // TODO: Update your variables here //---------------------------------------------------------------------------------- if (IsKeyDown(KEY_RIGHT)) x += 2; if (IsKeyDown(KEY_LEFT)) x -= 2; if (IsKeyDown(KEY_UP)) y -= 2; if (IsKeyDown(KEY_DOWN)) y += 2; }