diff --git a/src/7.in_practice/3.2d_game/0.full_source/progress/2.game.cpp b/src/7.in_practice/3.2d_game/0.full_source/progress/2.game.cpp new file mode 100644 index 0000000..82542d1 --- /dev/null +++ b/src/7.in_practice/3.2d_game/0.full_source/progress/2.game.cpp @@ -0,0 +1,40 @@ +/******************************************************************* +** This code is part of Breakout. +** +** Breakout is free software: you can redistribute it and/or modify +** it under the terms of the CC BY 4.0 license as published by +** Creative Commons, either version 4 of the License, or (at your +** option) any later version. +******************************************************************/ +#include "game.h" + +Game::Game(unsigned int width, unsigned int height) + : State(GAME_MENU), Keys(), Width(width), Height(height) +{ + +} + +Game::~Game() +{ + +} + +void Game::Init() +{ + +} + +void Game::Update(float dt) +{ + +} + +void Game::ProcessInput(float dt) +{ + +} + +void Game::Render() +{ + +} \ No newline at end of file diff --git a/src/7.in_practice/3.2d_game/0.full_source/progress/2.game.h b/src/7.in_practice/3.2d_game/0.full_source/progress/2.game.h new file mode 100644 index 0000000..369027d --- /dev/null +++ b/src/7.in_practice/3.2d_game/0.full_source/progress/2.game.h @@ -0,0 +1,43 @@ +/******************************************************************* +** This code is part of Breakout. +** +** Breakout is free software: you can redistribute it and/or modify +** it under the terms of the CC BY 4.0 license as published by +** Creative Commons, either version 4 of the License, or (at your +** option) any later version. +******************************************************************/ +#ifndef GAME_H +#define GAME_H + +#include +#include + +// Represents the current state of the game +enum GameState { + GAME_ACTIVE, + GAME_MENU, + GAME_WIN +}; + +// Game holds all game-related state and functionality. +// Combines all game-related data into a single class for +// easy access to each of the components and manageability. +class Game +{ +public: + // game state + GameState State; + bool Keys[1024]; + unsigned int Width, Height; + // constructor/destructor + Game(unsigned int width, unsigned int height); + ~Game(); + // initialize game state (load all shaders/textures/levels) + void Init(); + // game loop + void ProcessInput(float dt); + void Update(float dt); + void Render(); +}; + +#endif \ No newline at end of file