-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnotch.h
121 lines (100 loc) · 3.66 KB
/
snotch.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#ifndef __SNOTCH_H__
#define __SNOTCH_H__
#include "input.h"
#include "timer.h"
#include "animationmgr.h"
#include "resourcemgr.h"
#include "physics.h"
#include "object.h"
#include "aimindicator.h"
#include "thoughtbubble.h"
#include <SDL/SDL_opengl.h>
#include <string>
#include "levelobjects.h"
#include "abilities.h"
class Snotch
: public Physics
{
private:
static Snotch* instance;
static int referenceCount;
string currentState;
string previousState;
string animationType;
//Key bind vars
string keyRunRight;
string keyRunLeft;
string keyJump;
string keyAimUp;
string keyAimDown;
string keyUsePush;
string keyUseFireBall;
string keyGoThroughPlatform;
unsigned int lives;
double health;
double previousHealth;
double lastIdleAnimation;
double timeSinceIdleAnim;
double timeDead;
double previousYVel;
double aimAngle;
double timeInvulnerable;
double pushCoolDown;
double fireBallCoolDown;
double timeSinceLastKeyStroke;
double timeSinceGoThroughPlatform;
bool dead;
bool facingRight;
bool invulnerable;
bool canJumpInAir;
bool goThroughKeyWasPressed;
AimIndicator aimIndicator;
AnimationMgr* animationMgr;
CurrentStateNode* animationId;
Input* userInput;
Abilities* abilities;
ThoughtBubble thoughtBubble;
//Singleton functions
void destroy();
void adjustSize();
//Update handles
void handleAiming();
void handleInAir();
void handleLanding();
void handleHurt();
void handleDead();
void handleIdle();
void handleInvulnerability();
void handleJump();
void handleRun();
void handlePush();
void handleFireball();
void handleCoolDowns();
void handleGoThroughPlatforms();
public:
Snotch();
//Singleton functions
static Snotch* getInstance();
void release();
void init();
void update();
void setPos( float x, float y );
void draw();
void setHealth( double health );
//Set key binds
void setKeyRunRight( string key );
void setKeyRunLeft( string key );
void setKeyJump( string key );
void setKeyAimUp( string key );
void setKeyAimDown( string key );
void setDefaultKeys();
void setKeyUsePush( string key );
void setKeyUseFireBall( string key );
void setKeyGoThroughPlatform( string key );
Point getPos();
double getHealth();
bool isFacingRight();
int getIndicatorAngle();
int getLives();
};
#endif