#include "game.h" #include "bird.h" Bird bird; Game::Game(int width, int height, std::string title) { SetTargetFPS(60); // Set our game to run at 60 frames-per-second InitWindow(width, height, title.c_str()); bird.Init(); } Game::~Game() { CloseWindow(); // Close window and OpenGL context } bool Game::GameShouldClose() const { return WindowShouldClose(); } void Game::Tick() { BeginDrawing(); Update(); Draw(); EndDrawing(); } void Game::Update() { // Update //---------------------------------------------------------------------------------- // TODO: Update your variables here //---------------------------------------------------------------------------------- bird.Update(); if (IsKeyPressed(KEY_UP)) bird.Jump(); } void Game::Draw() { // Draw //---------------------------------------------------------------------------------- ClearBackground(BLACK); bird.Draw(); //---------------------------------------------------------------------------------- }