top of page

Mobile Game - PowerUp + Goals + Score

pratikparmar2

This is the third post in a series of blogs catered to discussing the progress of a game being developed by 4 individuals for mobile using Unity. In this project, the role of coding the base mechanics of the game has been given to Pratik.

















When there is a match of 4 or 7, a dynamite ore is created which can be seen in the GIF above. First, the script checks if the player moved an ore and then checks if that piece is now matched. If it is, it will then unmatch and a random number will be generated between 0 and 100. If the number is less than 50, a row dynamite will be spawned in. If it is greater than or equal to 50, then a column dynamite will be spawned in. The function follows the same principles when checking if the other piece is matched. This can be seen occuring in the GIF above. Once that powerup is matched, it then destroys an entire row or column depending on the type it is.


A match and unmatches
Matching GIF

Goals are what the player needs to do in order to beat the level and move onto the next or, fail the level and have to try again. This was coded with its own script called the 'GoalManager' which contains all the setting up, updating and comparing goals methods. The goals are easily created by us as I have made the variables serializable in the code allowing them to be changed in the inspector for easy goals making for each level. The 'SetupGoals' script then creates a goal at the transform of the 'goalGameParent'. The sprites of the goal panel are then changed to represent what has been chosen in the inspector and is displayed at the top right of the GIF on the left for the player. When the player picks a level, these goals are created. Once a match is made which reflects one of the goal items, the goal is updated through the 'UpdateGoals' method and once this hits 0, a counter for completed goals is increased by 1 to reflect a completed goal. Once all goals have been completed, checked by comparing the 'goalsCompleted' value against the 'levelGoals.Length', the game winning scene is loaded and a sound is played to show the player they have beaten the level.

Score is updated in the 'GameManager'. The function 'IncreaseScore' takes in a paramater in the form of an int which is called from the 'BoardScript' when an ore is destroyed. The value put into this function is then added to the score value and the score progress bar is also updated.


References:

Dynamite Creation: Mister Taft Creates (2018) Part 18: Generating Bombs - Make a Game like Candy Crush in Unity using C#. Available at: https://www.youtube.com/watch?v=Yzs6F0fqvN8&list=PL4vbr3u7UKWrxEz75MqmTDd899cYAvQ_B&index=20 (Accessed: 21 October 2022).


Level Goals: Mister Taft Creates (2018) Part 39 - Level Goals: Make a Game like Candy Crush using Unity and C#. Available at: https://www.youtube.com/watch?v=zHye6-JF2ww&list=PL4vbr3u7UKWrxEz75MqmTDd899cYAvQ_B&index=43 (Accessed: 24 October 2022)









4 views0 comments

Recent Posts

See All

Comments


  • 5d14492ca106b9d2b02204cce774fadd
  • LinkedIn
  • YouTube
  • Instagram

©2023 by Development.

bottom of page