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 my previous post I introduced TexturePacker to handle a lot of images in a simple way to improve i.e. game performance, the developer of TexturePacker created another program called PhysicsEditor. With PhysicsEditor you can easily trace your display objects so when the object bounce with other objects in your game it looks like the object has the real shape and not some bounding box around it. Often images have a transparent background which determines the real “image”, but when two display objects collide we want to images to collide as there shapes and not a collision of the larger transparent backgrounds. Well, this can be solved with the tracing tool of PhysicsEditor. Besides the tracing, another great thing about PhysicsEditor is that you can set your properties of each individual display object.
In case you’re new to PhysicsEditor, you can download the program here: http://www.codeandweb.com/physicseditor
I used TexturePacker to organize some of my art work for Rolly Bear World. In the Rolly Bear World game the player needs to move around different platforms to guide Rolly Bear to the treasure chest. All the objects which can be dragged and moved by the player I included in one single image sheet using TexturePacker. Why? TexturePacker is a great tool to keep your project organized so you don’t get to many image files in your project; as TexturePacker creates one image sheet with a large part of my art work it saves memory and thus increase the performance of the game. Lets not forget it is super easy to create the required @2x files for re-scaling across devices. If you missed the discussion around re-scaling for different devices read this post.
In case you you dont use TexturePacker yet for your Corona SDK developments, check it out here: http://www.codeandweb.com/texturepacker/.
I the last few days we were traveling a lot so I did not had much time to make any large changes to my Rolly Bear World Project. Internet and Wifi was shitty which made it even harder to look up any Corona SDK resources. Nevertheless, I made a few changes which were a bit easier to do without having access to the Internet.
I added a bit more art work to the project so Rolly Bear World will look a bit more appealing to the larger public. I mentioned before that I was planning to add these kind of changes later, but I guess due to the traveling and not having access priorities changed just to keep on having progress with the game and try to have it finished by the end of my trip. What did I change? A few background images like bushes to both the level screens as well as the menu screen. I added some clouds which move through the sky. I also added a few lines of code that when a user clicks on the back-button or on the level icons the user gets the feeling of a button press. I did this by using the Corona SDK xScale and yScale APIs.
As always you can find the code in my GitHub Repository
Finally, I reached the first big milestone of my Rolly Bear World project. In the last couple of days I added the first gameplay interaction to the game. In this post we will start integrating the physics engine provided by Corona SDK, add the functionality to launch Rolly Bear into the physics world, and add some basic new art work to the game.
But first, below you can find some pictures of Indonesia. We rented a motorbike and explore the island Lombok. We zip through jungle roads, past palm trees and little villages. After a hour we suddenly found a very secluded beach called Tanjun Aan. Personally, this was the most beautiful beach I ever saw in my life. Besides a guy selling 2 Dollar coconut drinks we were the only two people on the beach. The water was turquoise and warm, it felt like heaven :).
I was thinking it would be useful to dedicate a post on the tools and resources I’m using during my trip to create Rolly Bear World. From all the tools I use I can group them into developer tools, graphical programs, books and other learning resources and finally apps.
We are currently still in Pokhara, Nepal. We are planning to leave monday for Bhaktapur which is near Kathmandu. We decided to stay longer in Pokhara, mainly because it is so peaceful and beautiful. Yesterday morning we hiked at 4:00 AM to a small village in the mountains called Sarangkot to see the sunrise.
This already my third post. At this stage the game already starts to get some shape by some early sketches. I decided to make some high level sketches to get a better feeling of all the elements which should be developed and how the game and different screens should look like. With user stories I tried to specify the most important user requirements, they are not complete in terms of specifying the complete functionality but provide a fairly good overview over the different features of the game.
We are currently in Pokhara, Nepal, which is compared to Kathmandu a very chilled out location close to the Himalayan mountains. Many people come to this place to enjoy the lake called Phewa Lake or hike the Annapurna Circuit. I you read my previous post, we had to escape from Kathmandu due to the elections. It became quite dangerous in Kathmandu with the Army being deployed all over the city and some gas bombs being thrown on busses and cars. In Pokhara, it seems that the country has no elections at all, making this place an excellent alternative for Kathmandu. Besides some hiking and mountain biking I hope to make some progress on Rolly Bear World.
In the last couple of days I have giving it more thought what game I will be developing during my travels. In this post I will introduce high level the idea of the game, the game character, and my first thoughts about the game play.
We are currently in Kathmandu in Nepal. It took is over 30 hours to get here but it is absolutely a beautiful country and the people are very friendly. We visited Patan, which is an Unesco World Heritage site full of temples. We will spent 5 days in Kathmandu before we head out to Pokhara which is east of Kathmandu. Kathmandu was quite chaotic as the elections are planned for the 19th of November. Some of the members of certain parties were throwing gas bombs on cars and streets. Our hotel recommended not to take any bus to Pokhara, as they will be escorted by the army or police. We changed our plans and decided, given the unsafe environment, to book a flight from Kathmandu to Pokhara.