This repository was archived by the owner on Sep 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathInvadersEndScoreRestart.html
More file actions
59 lines (42 loc) · 2.19 KB
/
InvadersEndScoreRestart.html
File metadata and controls
59 lines (42 loc) · 2.19 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
<!DOCTYPE html>
<html>
<title>League Invaders - End and Restart</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://league-central.github.io/curriculum/style/style.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway">
<script src="https://league-central.github.io/curriculum/script/headerAndFooter.js"></script>
<body>
<div id ="wrap">
<div id ="main">
<div id = "moduleIndex">
<h1>Game End, Score, and Restart</h1>
<br>
<p class="normal">
The game score will increase each time a projectile deactivates an alien i.e. the projectile reaches an alien. The game ends when the rocket is no longer active, i.e. an alien has crashed into the rocket. </p>
<h2>ObjectManager</h2>
<p class="normal">
1. In the ObjectManager class, create a member integer called score and initialize it to zero.</p><br>
<p class="normal">
2. Create a getter for the score variable.</p><br>
<p class="normal">
3. Increment the score by one, every time an enemy is deactivated by a projectile (checkCollision).</p><br>
<p class="normal">
<h2>GamePanel</h2>
<p class="normal">
4. Use the getScore method in the ObjectManager class to get the player's score and display it on the panel.</p><br>
<p class="normal">
5. In the keyPressed method, when the ENTER key is pressed, check if the current state is equal to END. It it is, replace the existing inactive rocketship with a new Rocketship object.</p><br>
<br>
<p class="normal">
6. Replace the existing ObjectManager with a new ObjectMangaer object, passing the rocketship object to the constructor.<br>
<h3><u>TESTING</u></h3>
<p class="normal">
6. Run the program. Does it reset to the beginning after a Game Over? Have you removed all your printing to the console?
</p>
<br>
</div></div></div>
<div id="footer">
<script>addFooter();</script>
</div>
</body></html>