-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlevi.h
85 lines (65 loc) · 1.36 KB
/
levi.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 HERO_H_INCLUDED
#define HERO_H_INCLUDED
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <allegro5/allegro.h>
#include <allegro5/allegro_primitives.h>
#include <allegro5/allegro_image.h>
#include <vector>
#include <map>
#include "global.h"
enum class LeviState
{
UP,
DOWN,
RUNNING
};
class Levi{
public:
Levi();
~Levi();
void Init();
void Update(double deltaTime);
void Draw();
void moveUp();
void moveDown();
void stun();
bool isStunned() const;
float getX() const;
float getY() const;
int getWidth() const;
int getHeight() const;
void preventPassing();
void resetRestriction();
void Die();
bool Dying() const;
bool Shimmering() const;
int Stop() const;
bool Jump() const;
void Continue();
bool End() const;
void resetEnd();
private:
bool gameEnd;
float x, y;
int framecount;
int switchRate;
int width;
int height;
bool isDying;
float dyingDuration;
float dyingTimeElapsed;
ALLEGRO_BITMAP* die;
bool isShimmering;
float shimmeringDuration;
float shimmeringTimeElapsed ;
int stop;
bool jump;
ALLEGRO_TIMER*levi_timer;
LeviState state;
std::map< LeviState, std::vector<ALLEGRO_BITMAP*> > imgData;
std::map< LeviState, int> imgCount;
bool verticalMove;
};
#endif