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 pathInvadersRunner.html
More file actions
75 lines (57 loc) · 2.83 KB
/
InvadersRunner.html
File metadata and controls
75 lines (57 loc) · 2.83 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
<!DOCTYPE html>
<html>
<title>League Invaders Pt.1</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">
<style>
.center {
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
}
</style>
<script src="https://league-central.github.io/curriculum/script/headerAndFooter.js"></script>
<body>
<div id ="wrap">
<div id ="main">
<div id = "moduleIndex">
<!--
<h1>League Invaders - Runner Class</h1>
<br>
<div style="align-content: center">
<img alt="" src="" style="width: 194px; height: 300px;">
</div>
<br><br>
-->
<h1>League Invaders - Runner Class</h1>
<hr>
<p class="normal">
1. Create a new class called LeagueInvaders. This will be the "runner" or "driver" class that controls the entire program using the other classes that you will create later.<br>
<br>
2. Add a main method to this class. This will be the <b>ONLY</b> main method in the League Invaders program.<br>
<br>
3. The game will be displayed in a JFrame. Create a member variable in your class that will hold the JFrame.<br>
<br>
4. The size of the game window will remain constant and must be accessible to other objects in the game. Create two <code>public static final int</code> variables for the WIDTH and the HEIGHT of the <code>JFrame</code>. Note: By Java convention, these variable names are capitalized to indicate they will not change. Set the WIDTH to 500 and the HEIGHT to 800.<br>
<br>
5. Create a constructor for the LeagueInvaders class that initializes the JFrame variable.<br>
<br>
6. Create a void method called <code>setup()</code> that will initialize the properties of the game window, including its size (set height and width using the variables created in step 4). This method also needs to make sure the JFrame shows up and also specifies: </p> <pre>setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);</pre>
<br>
<p class="normal">
7. Create a <code>LeagueInvaders</code> object in your main method (i.e. call the constructor), and use this object to call the <code>setup()</code> method.
</p>
<br>
<img src="images/InvaderFrame.png" style="width: 150px; height=241px; margin: 0px 20px" align="left"> <h3><u>TESTING</u></h3><p class="normal"> 8. Run the program. Is the game window displayed and is it the right size? If not, get this part working before you move on to the next step.
</p>
</div>
</div>
</div>
<div id="footer">
<script>addFooter();</script>
</div>
</body>
</html>