-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathofApp.h
89 lines (70 loc) · 2.13 KB
/
ofApp.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
#pragma once
#include "ofMain.h"
#include "ofxGui.h"
#include "Sprite.h"
#include "Particle.h"
#include "ParticleEmitter.h"
typedef enum { MoveStop, MoveLeft, MoveRight, MoveUp, MoveDown } MoveDir;
class Emitter;
class ofApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
void checkCollisions();
void keyPressed(int key);
void keyReleased(int key);
void mouseMoved(int x, int y) {}
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased(int x, int y, int button) {}
void mouseEntered(int x, int y) {}
void mouseExited(int x, int y) {}
void windowResized(int w, int h) {}
void dragEvent(ofDragInfo dragInfo) {}
void gotMessage(ofMessage msg) {}
Emitter *invaders, *gun,*invader2;
int score;
int playerLife;
string gameState;
float gameStartTime;
bool gameOver = false;
bool gameStart = false;
bool endGame = false;
bool isUpPressed = false;
bool isDownPressed = false;
bool isLeftPressed = false;
bool isRightPressed = false;
bool mediumDifficulty = false;
bool hardDifficulty = false;
bool impossibleDifficulty = false;
bool reset = false;
bool startDifficulty = false;
//Vector for mouses position
ofVec3f mouseLast;
//Setting up all sounds
ofSoundPlayer shot;
ofSoundPlayer explosion;
ofSoundPlayer shipExplosion;
ofSoundPlayer music;
//Setting up images
ofImage start;
ofImage bullet;
ofImage ship;
ofImage enemies;
ofImage invaderEmitter;
ofImage backGround;
//Setting up GUI
ofxPanel gui;
ofxFloatSlider rate;
ofxFloatSlider Bullrate;
ofxFloatSlider lifeSpan;
//setting up emitter
ParticleEmitter emitter;
ParticleEmitter emitter2;
Particle player;
ParticleSystem sys;
//Forces
TurbulenceForce *turbForce;
GravityForce *gravityForce;
};