Arduino Uno Quick Start Manual page 133

Hide thumbs Also See for Arduino Uno:
Table of Contents

Advertisement

</head>
<body>
<div id="game">
<div id="playfield">
<div id="paddle"></div>
<div id="ball"></div>
<div
id="winner"
<p>You
win!</p>
</div>
<div
id="game_over"
<p>Game
Over</p>
</div>
</div>
<div id="stats">
<div>Lives:
<span id="lives"/></div>
<div>Score:
<span id="score"/></div>
</div>
</div>
<audio
src="sound/awake10_megaWall.mp3"
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/serial_device.js"></script>
<script src="js/game_controller.js"></script>
<script src="js/arduinoid.js"></script>
</body>
</html>
There s nothing special about this HTML document. At the top we associate
the document with a style sheet named
related to layout in this file.
Next, we define a couple of
attribute set to
game
, and it contains all the other elements. Most elements
are fairly self-explanatory. The
It hosts a
and a
paddle
objects—that is, the player s paddle and the ball.
The
winner
and
game_over
player has won or lost the game. They ll be invisible when the game starts.
In the
stats
element, you can find the game s most important statistical infor-
mation: the number of lives left and the current score.
After that, we add a cool chiptune
the
audio
element. The
loop
attribute makes it loop forever. It s a great song, so that doesn t hurt.
3.
http://opengameart.org/content/awake-megawall-10
4.
http://cynicmusic.com/
class="message">
class="message">
autoplay
arduinoid.css
<div>
elements. The main element has its
playfield
element is where the action happens.
. These elements represent the game s main
ball
elements contain messages we ll display in case the
3
created by Alex Smith
autoplay
attribute starts the song immediately, and the
www.it-ebooks.info
Creating the Game
loop/>
. We ll specify all things
4
to the game using
115
id
report erratum
discuss

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Arduino Uno and is the answer not in the manual?

Table of Contents