Lesson 5: Adding Enemy Sprites

This video will likely be best viewed in fullscreen mode.  It's about 8 and a half minutes long.  You can download the resulting file below.

In this lesson, we introduce some randomness and create a JavaScript function to compute random numbers for our game.  We also dynamically create HTML in our JavaScript, manipulate its style in CSS, and add it to the HTML document.  From there we move the enemies around the screen by manipulating their X and Y coordinates.

Timothy James,
Jul 20, 2015, 6:52 PM