I'm a JavaScript Games Maker: Advanced Coding

I'm a JavaScript Games Maker: Advanced Coding — page 3
UFO POWER UP In this game the player has to move an alien spaceship a UFO as quickly as possible to collect energy sources The player moves the UFO by pressing the arrow keys on the keyboard The symbol for an atom in green below is used to represent an energy source After the player has collected five atoms the game stops and the time taken is shown You can play the game against your friends and see who can complete it in the fastest time The complete code for the game is listed on page 11 STEP PLANNING Documents ufo html The score is shown in an HTML paragraph element Score 5 Time 17 A timer will count how long it takes to collect five atoms Variables count the score how long the game has been running and the coordinates of the atom and the UFO Every time the UFO moves we need to check if it has reached the atom This is done by comparing their coordinates Well done Your time was 17 OK When five atoms have been collected the game ends and the time taken is shown We will only need one atom image Each time it has been collected by the UFO we will move it to a new random place and increase the score by 1 Pressing the arrow keys will change the ufoX horizontal and ufoY vertical coordinates making the UFO move around the screen Click OK to play again STEP 2 FIND SOME IMAGES Find an image of an atom to use or find another symbol to represent energy sources in your game Remember that the game's background is black so your symbol needs to be a color that will show up against it Save your image into the same folder as your HTML file Use a png image Our image is named atom png atom clipart search Search online for atom clipart to use Right click one image Click Save Image As Navigate to your Documents folder then click Save Now repeat this step but search for ufo clipart to