-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgame.hpp
79 lines (74 loc) · 2.51 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#pragma once
#include <cmath>
#include <stdlib.h>
#include <time.h>
#include <list>
////My Classes
#include "playmusic.hpp"
#include "mainmenu.hpp"
#include "mapselect.hpp"
#include "playerselect.hpp"
#include "instructionsandmoves.hpp"
#include "playerversus.hpp"
#include "backgroundupdate.hpp"
#include "frontgroundupdate.hpp"
#include "playerupdate.hpp"
////
#include "cammy.hpp"
#include "chunli.hpp"
#include "claw.hpp"
#include "dictador.hpp"
#include "feilong.hpp"
#include "guile.hpp"
#include "ken.hpp"
#include "ryu.hpp"
#include "sagat.hpp"
#include "zangief.hpp"
////
class Game
{
//Screen dimension constants
const int SCREEN_WIDTH = 800;
const int SCREEN_HEIGHT = 600;
int game_screen_flag = 0;
int threshold = 0;
int right_move = 0;
// playmusic my_music;
// menu my_menu;
// map my_map;
// playerchoose my_player;
// insandmoves my_insandmoves;
// playerversus my_playerversus;
// background my_background;
// frontground my_frontground;
// Player *p1;
// Player *p2;
//game_screen_flag=0 is mainmenu screen
//game_screen_flag=1 is mapselect screen
//game_screen_flag=2 is playerselect screen
//game_screen_flag=3 is insandmoves screen
//game_screen_flag=4 is playerversus screen
//game_screen_flag=5 is ingame screen
public:
SDL_Window *gWindow = NULL;
SDL_Renderer *gRenderer = NULL;
bool initialize_p2 = true;
//built in SDL functions
bool init();
bool loadMedia();
void run();
void close();
SDL_Texture *loadTexture(std::string path);
//My_functions to update relevant screen, menu, game logic
void updatemenu(SDL_Event, menu &, map &, playmusic &);
void updatemap(SDL_Event, map &, background &, playerchoose &, playmusic &);
void updateplayer(SDL_Event, playerchoose &, frontground &, insandmoves &, playmusic &);
void updateinsandmoves(SDL_Event, insandmoves &, playmusic &, playerversus &, playerchoose &);
void updateplayerversusdraw(playerversus &, playerchoose &, playmusic &);
void updatebackground(background &, frontground &, playmusic &);
void updatefrontground(SDL_Event, frontground &, playmusic &);
void updatefrontgrounddraw(frontground &, playmusic &, Player *, Player *);
void updatefightlogic(const Uint8 *, SDL_Event, Player *, Player *, frontground &, menu &);
void updatefight(const Uint8 *, SDL_Event, Player *, Player *, frontground &, menu &);
void updatefightdraw(Player *, Player *, bool);
};