In this post I show you how you can add a splash screen to your Corona SDK project. A splash screen is a screen which is displayed when the user starts the game, often you mention or display your brand or the name of your development studio. As I’m creating a game during my travels in Asia I decided to make a splash screen which displays my website logo of Code and Travel.
In the last post I provided the explanation of Level 1 -5 of Rolly Bear World, in this consecutive post I will do the same for Level 6 -8. I will only explain the key changes to the code. In case you missed some of the core functionalities build in Rolly Bear World, make sure you visit this page with all available tutorials.
Level six is not much different from level 3 with the exception that this time the spring is fixed in the gameplay and not an available platform for the user to change. Just look at the code of level 6 and you will see we use the exact same concepts for creating the animated spring object only now as a fixed object.
Before we start building level 1 to 5 I would like thank you for all the comments and emails I got with travel wishes or questions about Lua development. Unfortunately I have not been able to blog a lot in the last two months as the Internet in Laos and Philippines was just not great (softly speaking). Anyway I did had time to make some progress on Rolly Bear World. I’m currently in Manila on route to Hong Kong, so probably my connectivity will improve over the next days. I complete already 9 levels of my Rolly Bear World Project. This post will discuss the first 5 of them.
In this post and tutorial we will add audio to the Rolly Bear World Project. Personally, I think this changes a lot of how the game feels. So i’m glad I reached this point.
In this post we will add
- Sound effects
- Background Music
- Via Pause Menu the user can change the settings for both
In this tutorial I added a few new lines of code to my Rolly Bear World project. The events which needed happen when a user completes a level is still missing at this point. When Rolly Bear gets successfully launched and bounced to the treasure chest, the chest should open and a trophy should be rewarded to the user. Next, an overlay should be displayed to navigate the user either back to the level selection screen or to the next level of the game.
Some of the progress I made in the last days is the creation of an overlay menu which is triggered by the storyboard.overlay function of Corona SDK. When the user clicks on the pause button an overlay appears with 3 options: Pause the game, go to the level selection screen, and reload the level. In this post we will create this kind of overlay. See the video below for the implementation in my Rolly Bear World Project.
It has been a while since my last post. In this post we use Corona SDK to rescale display objects based on the location on the screen. Depending on the level in the Rolly Bear game a user has more or less platforms available to use. In case of many platforms we don’t want to much cluther on the screen, so we want them to be smaller when the user doesn’t need them. We can achieve this by adding a runtime listener to the platforms to check for its location. Accordingly we can re-scale the platforms.
See the small video how it works:
We already have the platforms in Rolly Bear World and we can move them around. In this post we extend our code base so that the user can rotate them. In case you missed the post about making display objects in Corona SDK drag and moveable on the screen, click here.
Watch the movie of the implementation.
I have been working on Rolly Bear World now for almost two months and some of my lua files are getting very crowded with code blocks and repetition of similar code patterns. In this post, we will not add any additional functionality to Rolly Bear World; but we will be restructuring some of the code and creating some Object-Oriented patterns.
Start with creating a new lua file in your project and call it fixedScene.lua. In this lua file we will add all the static scene objects of the levels: the invisible walls, the 2 bushes, the background bush, the floor, the two wooden signs, the chest, and the rock. In fixedScene.lua create a function called createStaticBackgroundElements and copy/ paste all the static elements in this function. Next create a global group variable called: myStaticgroup = display.newGroup. We need to insert each background element in this group. So we can handle the removal of these objects between scenes later via our Storyboard implementation.
In the last post we created the display objects (platforms) for Rolly Bear World using a for-loop. In the final game the user should be able to drag or move these platforms to a strategic position to get Rolly Bear to the treasure chest. In the code below we create this functionality for the user to drag the platforms around the screen.