-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.hpp
62 lines (58 loc) · 1.49 KB
/
game.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include <SDL.h>
#include <SDL_image.h>
#include <stdio.h>
#include <iostream>
#include <string>
#include <stdlib.h>
#include <time.h>
#include <list>
#include "node.hpp"
#include "myTime.hpp"
#include "hook.hpp"
#include "animate.hpp"
#include "life.hpp"
#include "Boat.hpp"
#include "fishes.hpp"
using namespace std;
#pragma once
class Game
{
protected:
//Screen dimension constants
const int SCREEN_WIDTH = 800;
const int SCREEN_HEIGHT = 600;
//The window we'll be rendering to
SDL_Window *gWindow = NULL;
//The window renderer
SDL_Renderer *gRenderer = NULL;
// linked lists used for various objects
linkedlist fish_on_screen;
linkedlist animation;
linkedlist score;
linkedlist lyf;
linkedlist Spawns;
linkedlist fish_on_boat;
int Points;
//Current displayed texture
SDL_Texture *gTexture = NULL;
//global reference to png image sheets
SDL_Texture *assets = NULL;
SDL_Texture *fishes = NULL;
SDL_Texture *Misce = NULL;
SDL_Texture *Score = NULL;
SDL_Texture *Life = NULL;
SDL_Texture *Booster = NULL;
SDL_Texture *Drogon = NULL;
SDL_Texture *fire = NULL;
int screen;
//win variable
bool win = false;
public:
Game();
bool init();
bool loadMedia(); // loads png images
void close();
SDL_Texture *loadTexture(std::string path);
void run();
void collision(Hook *, Boat *); //checks collision of fish with hook
};