-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmove.hpp
More file actions
84 lines (69 loc) · 1.53 KB
/
Copy pathmove.hpp
File metadata and controls
84 lines (69 loc) · 1.53 KB
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
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_ttf.h>
#include <stdio.h>
#include <string>
#include <sstream>
#include "getinput.hpp"
class Particle
{
public:
int DOT_WIDTH, DOT_HEIGHT;
Particle();
Particle(int , int, int, int);
void render(LTexture* );
void render2(LTexture* );
bool isDead();
void move();
void randommove();
void shiftColliders();
void free(LTexture* );
int getPosX();
int getPosY();
int getVelX();
void nextstage();
SDL_Rect* getclip(int);
static const int T=4;
int lastclip;
SDL_Rect cclips[4];
int getMode();
private:
int mPosX, mPosY;
int mVelX, mVelY;
int mode = c1;
int nextstage_lastmode,nextstage_lefttime;
int getclip_lefttime,getclip_lastmode;
enum cmode{
c1,
c2,
c3,
c4,
};
enum clips{
clip1,
clip2,
clip3,
clip4,
};
};
class Dot
{
public:
static const int DOT_WIDTH = 240;
static const int DOT_HEIGHT = 174;
static const int DOT_VEL = 10;
Dot();
Dot(int, int, int, int);
void handleEvent( SDL_Event& e );
void move();
void render();
int getPosX();
int getPosY();
private:
int mPosX, mPosY;
int mVelX, mVelY;
};
bool checkCollision( Particle& , Particle& );
bool checkharrycollision( Particle& , Dot* );
bool blueballCollision( Particle& , Dot* );
double distanceSquared( int x1, int y1, int x2, int y2 );