-
Notifications
You must be signed in to change notification settings - Fork 0
/
gameover.pde
39 lines (35 loc) · 895 Bytes
/
gameover.pde
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
void gameover () {
background(orange);
if (shiplives == 0) {
textSize(100);
text("GAMEOVER", width/2, height/3);
textSize(20);
fill(black);
text("(you died)", width/2, height/2);
}
if (count == 21) {
background(orange);
fill(black);
textSize(100);
text("YOU WON", width/2, height/3);
}
}
void gameoverClicks () {
//reset
mode = INTRO;
count = 0;
shiplives = 3;
teleport = 0;
myShip.lives = 0;
myObjects = new ArrayList<GameObject>();
myShip = new Ship();
myObjects.add(myShip);
myObjects.add(new Asteroid());
myObjects.add(new Asteroid());
myObjects.add(new Asteroid());
//myObjects.add(new Bullet());
myObjects.add(new Fire());
myShip.location = new PVector(width/2, height/2);
myShip.direction = new PVector(0, -0.1);
myShip.velocity = new PVector(0,0);
}