![]() The user can choose to try the level again or quit the game. If a dodgeball was touched, then play the failed sound effect and display a levels help menu. ![]() If the score was not greater than the best score, play the score sound effect.ĭisplay the score board, reset the You and Goal sprites and set the dodgeballs free for the next level. Save the level and best score in the TinyDB database. If the new score is greater than the Best Score then replace best score with the new score. If the current level is less than the number of dodgeballs, then the level is increased by 1. If the Goal was touched, then the Goal variable is set to true and 10 points are added to Score. In either case, the You, Goal and all dodgeball sprites are disabled and hidden. The when You.CollidedWith event block is triggered when the You sprite touches either the goal sprite or one of the dodgeball sprites. Goal is true when the Player reaches the goal.ĭodgeBallsRadiusPercent is used to set the size of the dodgeballs. The global Dragging and Goal variables are used to keep track of the game state.ĭragging is true when the player sprite is enabled and free to be dragged, The Goal and You sprites are enabled last to prevent triggering the You.CollidedWith event block. The Goal's position is picked at random first, that location is removed from the list then the player location is picked.īoth sprites are placed at their start positions.ĭisperseDodgeBalls enables the number of balls for the level and sends them out from the center of the game canvas - each in a random direction. StageHeroAndGoal creates a list of corner coordinates for the player and goal sprites to be positioned at the start of the level. The GameCanvas.DrawText block is used to display the Level, Score and Best Score centered on the top of the screen. Since it draws text on the canvas, the canvas must be cleared each time the scoreboard is updated. Once the Play button is tapped, the scoreboard is displayed. If reset is tapped, the Best Score and Level values are reset, a confirmation message is displayed and the Confirmation.Timer is started.Īfter a three second delay, the Welcome dialog is redisplayed for the user to start the game when ready. If Play is tapped, then the scoreboard is displayed, the Round Player and Goal sprites are positioned and the dodge balls are set free to start the level. Then the DisplayWelcomeHelp dialog is executed which tells how to play or reset the game. The global Best and Level variables are set by the values saved in the TinyDB SavedGameState database, if any. GameCanvas.FontSize is set to a percentage of the GameCanvas.Height and it's PaintColor value set to green for the scoreboard text. You.Radius is likewise sized to a percent of the GameCanvas.Width. This insures that the relative size of the Goal will be the same for different devices screen sizes. The Goal Imagesprite's Width and Height are set to a percentage of the GameCanvas Width and Height. The global DodgeBalls list contains components for the 25 ball sprites. The global variables are also initialized at this time. The Screen1.Initialize event block is the first event block executed when the app loads. Iniitializing the game and prompting the user: Many of my projects will contain a procedure block named READ_ME or About which contains the documentation for the project in a comment bubble. Sound effects for level up, best score and failed level are included.Ī ConfirmationDelay Clock Timer is used to display a confirmation message when the user taps the Reset button. Two Notifiers are used - one for the Welcome dialog and one for replaying a failed level. You can reset the level back to 1 and Best Score to 0 at the startup screen as you have seen. Level 25 is the last lavel and can be played many times to improve your Best Score. The game begins with one dodgeball and the number of balls increases for each level up to 25. Your player is a round Ball sprite and the goal is a square blue imagesprite. The screen is set to landscape orientation with responsive sizing.Ī Game canvas is set to 100% in width and height Let's look at the components used in this app in the Designer: I have played the game before so I am going to reset the scores and level then play a couple of levels. The object of the game is to drag the blue circle player to the blue square goal without touching any of the red dodge balls. ![]() ![]() It is set to run in Landscape orientation so I will rotate the emulator using Ctrl+F11 This is a walkthrough of the Dodge Game - a game of dogeball ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |