-
Notifications
You must be signed in to change notification settings - Fork 0
/
MadDotz.hpp
101 lines (76 loc) · 1.48 KB
/
MadDotz.hpp
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
# ifndef _MadDotz_hpp
# define _MadDotz_hpp
# ifdef __EMSCRIPTEN__
# include <emscripten.h>
# include <html5.h>
# endif
# include <SDL2/SDL.h>
# include <SDL2/SDL_image.h>
# include <stdlib.h>
# include <stdio.h>
# define FIGS (24)
# define FIGW (15)
# define FIGH (15)
# if 1
# define DOTZ (32)
# define RELS (4)
# define W (800)
# define H (480)
# else
# define DOTZ (4)
# define RELS (2)
# define W 800
# define H 600
//# define STEPMODE
//# define DUMPMODE
# endif
class Dot;
class MadDotz {
protected:
static SDL_Event event;
public:
static SDL_Window* mainWindow;
static SDL_Renderer* renderer;
static SDL_Texture* dotTexture;
static SDL_Rect srcRect;
static SDL_Rect dstRect;
static Dot dots[DOTZ];
static int windowWidth;
static int windowHeight;
static int dotWidth;
static int dotHeight;
static int windowWidthForDot;
static int windowHeightForDot;
public:
# ifndef __EMSCRIPTEN__
static void about();
# endif
static void init();
static void loop();
static void eventHandler();
static void renderFrame();
}; // class MadDotz
class Dot {
public:
int numero;
int fig;
int life;
int x;
int y;
int nextX;
int nextY;
signed char relation[RELS];
int speed;
public:
void init(int no);
void respawn();
void initFigure();
void initPosition();
void initRelation(int n);
void initRelations();
void smoothRelation(int n);
void initSpeed();
void proc();
void paint();
}; // class Dot
# endif