-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameView.h
60 lines (48 loc) · 1.08 KB
/
GameView.h
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
//
// GameView.h
// TankGame
//
// Created by Jacob Gonzalez on 11/04/2015.
// Copyright (c) 2015 Jacob Gonzalez. All rights reserved.
//
#ifndef GAME_VIEW_H
#define GAME_VIEW_H
#include "View.h"
#include "Sprite.h"
#include "Terrain.h"
#include "Tank.h"
#include "Bullet.h"
#include "DebugView.h"
// :: Main game view ::
// :: All main game logic and drawing happens here
class GameView : public View
{
public:
// : constructor with names of players :
GameView(std::string name1, std::string name2) : View()
{
_init(name1, name2);
}
~GameView()
{}
void update(int t);
void draw();
// : getter for winner of game :
// : used by EndView
std::string get_winner() const;
private:
void _init(std::string name1, std::string name2);
void _get_input();
Terrain *_terrain;
//DebugView *_debug_view;
Tank *_tank1;
Tank *_tank2;
Bullet *_bullet;
Sprite *_input_box;
// : turn of player :
// : let false be player1
// : let true be player2
bool turn;
std::string _winner;
};
#endif // GAME_VIEW_H