-
Notifications
You must be signed in to change notification settings - Fork 1
/
character.h
85 lines (69 loc) · 1.5 KB
/
character.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef CHARACTER_H
#define CHARACTER_H
#include <SDL.h>
#include <SDL_image.h>
#include <stdio.h>
#include <cstdlib>
#include <string>
#include <iostream>
#include <SDL_ttf.h>
#include "trump.h"
//map moving speed
extern int mapspeed ;
extern int asset;
extern int score;
extern int distance;
extern int triggeredtime;
extern bool triggered;
class trump
{
public:
trump(){highscore = 0; billionaire=time=champion=superman=angel=false;}
int highscore;
bool billionaire;
bool time;
bool champion;
bool superman;
bool angel;
};
class Dot
{
friend class money;
friend class obstacle;
friend class people;
friend class mapobject;
public:
//The dimensions of the dot
static const int DOT_WIDTH = 119;
static const int DOT_HEIGHT = 127;
//Maximum axis velocity of the dot
static const int DOT_VEL = 10;
int direction=0;
//Initializes the variables
Dot();
//Takes key presses and adjusts the dot's velocity
void handleEvent( SDL_Event& e );
//Moves the dot
void move();
//Shows the dot on the screen
void render();
//check if the dot is out of border
bool checkborder(int &);
//The direction of Trump
bool isdown;
//alive or dead
bool isdead;
//stack on trump
int stack[20]={0};
//reset stack
void reset();
//checkpoint;
void checkpoint();
void mapevent(int);
private:
//The X and Y offsets of the dot
int mPosX, mPosY;
//The velocity of the dot
int mVelX, mVelY;
};
#endif