Game Development Reference
In-Depth Information
Figure 4-5.
Screenshot of the application so far
The bricks
Now we get to a very interesting part: the first brick. First, we will have to create a new class in a new file.
Since we are going to have a few different brick types, we might want to add a new folder, called
bricks
, in
the
javascripts
folder (see Figure 4-6).
The first file we create is going to be the
square.js
. Let's not forget to add it to the JavaScript includes in
the HTML. Add a
<script>
tag for the
square.js
file below the
application.js
<script>
tag.