Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Cave-Crawler/GameH.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
53 lines (41 sloc)
964 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "SDL.h" | |
#include"SDL_image.h" | |
#include <iostream> | |
#include "AudioH.h" | |
#include "ObjectH.h" | |
/////////Class that handles the game loop and is function//////////// | |
class Game { | |
public: | |
Game(); | |
~Game(); | |
///// Initializes everything ///// | |
void init(const char* title, int xpos, int ypos, int width, int height, bool fullscreen); | |
///// Handle the Events ///// | |
void handleEvents(); | |
///// Handle the every frame action ///// | |
void update(); | |
///// Handle the renderization ///// | |
void render(); | |
///// Close the Game ///// | |
void clean(); | |
//// Draw the Object ///// | |
void draw(Object o); | |
///// Checks returns true if the game is running///// | |
bool running() | |
{ | |
return isRunning; | |
} | |
private: | |
bool isRunning; | |
///// Game Window ///// | |
SDL_Window *window; | |
///// Game Renderer ///// | |
SDL_Renderer* renderer; | |
///// mouse position ///// | |
int mousex, mousey; | |
///// Music object ///// | |
Audio effect; | |
///// Game Object ///// | |
Object peppa; | |
}; |