Corona SDK: Develop a Frenzic-like Game - Final Steps

Welcome to the final tutorial in our Frenzic like game series! In this tutorial, we’ll handle the logic of the blocks and the steps to build the final app.


Where We Left Off. . .

Please be sure to check part 1 and part2 of the series to fully understand this tutorial.

Step 1: Place Blocks Function

This function runs when the player taps any of the container squares. It basically checks if the correct position is available to place the square and places it if true. The function in the next step is called when the block is placed.


Step 2: Add Block to Array

When the block is placed in the container, we add the block to the array that keeps record of the stored blocks in that container. This will help us determine when the container is full. We also play a sound and increase the score by one every time a block is placed.


Step 3: Complete Container (Single Color)

The next code checks if the container was filled by a single color block using the container array. It increments the score by 150 and plays the corresponding sound. A function to remove the blocks is called -we'll create that function in the next steps.


Step 4: Complete Container

This code runs when the container is full, but the blocks inside aren't the same color.


Step 5: Reset Timer

After clearing the full containers, the score is set to the Textfield in the stage, the timer is reset and another block is called.


Step 6: Remove Blocks

This functions clear the blocks in the containers and reset the correct variables to prepare the container for new blocks.


Step 7: Alert

The alert function runs when the player is out of lives, it displays the final score reached and adds a listener to go back to the title screen.


Step 8: Restart

The next function will reload the game and return to the Title View.


Step 9: Call Main Function

In order to initially start the game, the Main function needs to be called. With the above code in place, we’ll do that here:


Step 10: Loading Screen

Frenzic_App

The Default.png file is an image that will be displayed right when you start the application while the iOS loads the basic data to show the Main Screen. Add this image to your project source folder, it will be automatically added by the Corona compliler.


Step 11: Icon

Frenzic_App

Using the graphics you created before you can now create a nice and good looking icon. The icon size for the non-retina iPhone icon is 57x57px, but the retina version is 114x114px and the iTunes store requires a 512x512px version. I suggest creating the 512×512 version first and then scaling down for the other sizes.

It doesn’t need to have the rounded corners or the transparent glare, iTunes and the iPhone will do that for you.


Step 12: Testing in Simulator

Frenzic_App

It's time to do the final test. Open the Corona Simulator, browse to your project folder, and then click open. If everything works as expected, you are ready for the final step!


Step 13: Build

Frenzic_App

In the Corona Simulator go to File > Build and select your target device. Fill the required data and click build. Wait a few seconds and your app will be ready for device testing and/or submission for distribution!


Conclusion

Experiment with the final result and try to make your custom version of the game!
I hope you liked this tutorial series and find it helpful. Thank you for reading!

Tags:

Comments

Related Articles