app inventor game ‐ meteor doomschools.yrdsb.ca/.../gallery/appinventor/meteordoombyhorace.pdf ·...

12
App Inventor Game ‐ "Meteor Doom" Introduction Meteor Doom is a game that is perfect for kids and adults of all ages. It is inspired by games like dodge ball but Meteor Doom adds a new twist by making the setting in space. Players can drag the star character, the Luma, to dodge the balling meteoroids and collect powerups in shapes of moons and stars. The game ends when the player hits too many meteoroids and runs out of lives. When this happens their score is recorded on a high score reader. This allows players to compete with their friends to get a higher score. This game will test the players reflexes, timing, and luck. Any player will have hours of fun that's "out of this worl d"! Story Board Players will see this the title screen when opening the app. The player will then be in the main game screen and they can choose to start, reset or read the instructions If they click the instructions button, the instructions will pop up, the play can go back by pressing anywhere on the screen When the player clicks start, the balls will start moving and as the score increases more balls will spawn. Timers will also be enabled for other balls and power ups to appear

Upload: phamkhuong

Post on 25-Mar-2018

221 views

Category:

Documents


1 download

TRANSCRIPT

App Inventor Game ‐ "Meteor Doom" Introduction 

Meteor Doom is a game that is perfect for kids and adults of all ages. It is inspired by games like dodge ball but Meteor Doom adds a new twist by making the setting in space. Players can drag the star character, the Luma, to dodge the balling meteoroids and collect power‐ups in shapes of moons and stars. The game ends when the player hits too many meteoroids and runs out of lives. When this happens their score is recorded on a high score reader. This allows players to compete with their friends to get a higher score. This game will test the players reflexes, timing, and luck. Any player will have hours of fun that's "out ofthis worl

 d"! 

 

 

Story Board 

• Players will see this the title screen when opening the app. 

• The player will then be in the main game screen and they can choose to start, reset or read the instructions 

• If they click the instructions button, the instructions will pop up, the play can go back by pressing anywhere on the screen 

• When the player clicks start, the balls will start moving and as the score increases more balls will spawn. Timers will also be enabled for other balls and power ups to appear 

• The Player will then have to drag the Luma and dodge the incoming balls and collect power ups to get a high score.  

• When the player gets hit by a ball, the player will lose a life and all the balls will reset and timers will be reset. However already unlocked balls will not reset. 

• When the player runs out of lives, the game over screen will appear and the player will click anywhere to exit the screen 

• The player will then press the reset button to reset the lives and the score 

• The high score is recorded and the player can start again! 

• If the player presses the reset button in the middle of a game, it will reset the lives, score, balls and timer and will still record a highscore 

 Main Components 

Ball:  The ball components allow a moving object on the canvas. This allows the game to have objects to dodge, in this case the balls are meteoroids that the player must dodge. In this game the balls mostly 

move straight downwards. 

Image Sprites:  This component allows an image to be interactive with other components on the canvas. In my game, this allows the Luma to be hit by the meteoroids and image sprites are also used by the power‐ups so they can be collected by the Luma. The movement of the Luma is player determined but the movement of the power‐ups are determined by the programmed  functions.  

TinyDB: This component allows the phone to store data onto the phone so it won't be gone the next time it starts up. This component is used in my game to store the data of the highest score of the player. The high score will motivate the player to challenge themselves or their friends and family. 

Timer: This component counts down time before something will occur. This is used to make certain balls appear or images appear at a certain time. This way, not everything appears all crowded and messy. 

Main Blocks and Logic 

Variables:  

lives: The variable lives was used to count the amount oflives the player has. It is a default of 3 lives to start off.

  

 

  

score: The variable score, is used to count the score of the player. The default score is set to 0. 

powerUpType: The variable powerUpType isused to randomize the types of power‐ups youcan collect. The default setting is 1.  

highscore: The variable highscore is used to count the highest score the player has achieved saved in the TinyDB. The default score is 0. 

Event Handlers: 

Luma.Dragged This block allows the Luma to be dragged and moved up, down, left and right inside the canvas. This makes it so that the game actually functions. 

 

 

 

 

 

 

 

 

 

(insert colour of ball) Ball.EdgeReached: This block is used to bring the ball back to the top of the canvas and randomize the location of the ball after it has reached the bottom of the canvas. There is an event like this one for every ball other than gray, light gray and black. 

 

(insert ball colour here) BallTimer.TImer or PowerUpTimer.Timer: This block is used to make the ball or power‐up appear when the time is up. When the time is up, the ball appears and moves downwards or the power up appears in a random area. This adds a different pattern in which the balls act so the player won't be bored easily. 

 

 

 

 

Luma.CollidedWith: This block is one of the most important as it determines what happens when the Luma touches another ball or an image sprite. If it touches any colour of ball, it will lose a life and call the resetBall procedure. If the Luma touches a power‐up image sprite than it will get a bonus depending on what the power‐up type was defined as. Then it will disable the power‐up until it is called by the timers again. 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Screen1.Initialize: This block sets up the game when the screen opens. It disables all the uneeded balls and sprites, starts the music and sets up the high score label. 

ButtonReset.Click: This block resets the game screen back to its default settings. It resets the score, the lives, the balls, stops the music and disables the timers. 

 

 

 

 

 

 

 

 

 

ButtonStart.Click:  This is another of the most important blocks because it starts everything in the game. It starts the music and it starts making the balls move. If previous balls were enabled then an if statement will keep the ball enabled and make it move straight downwards at a random speed. 

 

 

 

 

 

 

 

 

 

 

 

 

InstructionsButton.Click: This block makes the instructions on an image sprite load up. When youpress the button, the image sprite will appear foryou to read. 

  

 

 

 

 

TitleSprite/TitleSpriteBackground/GameOverSprite/InstructionsSprite.Touched: These blocks are responsible for making the image sprite disappear when the sprite is touched. So the Game Over screen will disappear when you touch the sprite, same with the title and the instructions. 

 

 

 

 

 

 

 

 

Procedures: 

Enable/Disable (Insert Colour of ball or  Timers or PowerUp): These procedures either enable a ball, image or timer by making it enabled and visible. Or it disables a ball, image or timer by making enabled and visible false. This way it is easier to organize which balls to disable and make some of the blocks smaller. 

updateLives: This procedure is essential in figuring out when the game ends. First it uses an if statement to see if the player have no more lives. If so, it will reset the game for the player (similar to the reset button). If not, the player will lose lives depending on the amount that is called in the argument "liveschange" (the amount is 1 every time in my game). Lastly, the lives label is updated with new information of the remaining lives. 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

updateScore: This procedure is used for updating the score shown in the score label. It is also used to see if the score beats the high score. When the procedure is called it will increase the score by the amount of the argument (in the game the score increases by 1, 2, or 3 when a ball touches the edge). Then it will check if the score is high enough for a new ball to appear using if statements. (This happens with 5 balls). Lastly an if statement is used to see if the high score is achieved. (The high score will update while the player is in the middle of a game. 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ResetAll: This is the go‐to procedure that is used to reset the screen by stopping all balls and move them to their original locations. It starts by moving the balls back to the original co‐ordinates and setting the speed to 0 so it won't move. This procedure will also disable some special balls (black, gray, light gray) and it disables all the timers. 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A picture of the game in the blocks editor