Tagged with

coronasdk

View Manager for Corona SDK

Grab it on GitHub

This is an attempt to create a simple view manager class for corona sdk projects. The goal is to keep it simple and light. basically swapping out one view for another and adding some simple transition effects.

About the project

This project was started for my own personal use but please feel free too fork and add. I would like to add some other classes for doing stuff like modal or popup windows.

Questions or thoughts?

Send me a github message or hit me up on twitter http://twitter.com/matthewswallace

Corona SDK build command for Sublime Text 2

After using Sublime Text 2 on a few html and ruby on rails project I think it is an awesome choice. If you are Textmate or BBedit user then Sublime will hook you right away. Naturally I wanted to get away from Textmate in my CoronaSDK / Lua projects. The one convenience that I enjoy with Textmate is “command + R” runs your Corona project for you. 

First thing is to get Textmate Corona bundle working in Sublime. Do some googling and you will find some instructions for that. http://bit.ly/z1OCCF 

Now that you have the bundle working in Sublime the next step is adding a new Build System so that we can run a simple command and launch the simulator from our project in Sublime. To do this you will go to Tools > Build System > New Build System. 

You will see a new Build system document open. If you are on OS X you will add the following code to the file.

After that hit “command + s” and name the file CoronaSDK. This will add the new Build to your Build System menu so that you can select it.

Now open up your Corona project and give it a try. “Command + B” should launch the simulator and you will notice that the terminal window will open inside of Sublime at the Bottom witch I think is awesome. Enjoy!

Corona SDK 05: Advanced Touch Handling – YouTube

I recently had to create a sliding menu for a game I am working on. Coming from a Flash background I usually think in terms of, “how would I do this in flash?”, and it translates really well. Same goes for the functionality that I came up with for the menu component that I created so the user can swip from left to right to get to the next set of buttons.

The difference in Corona and flash that I found was the way you listen for events on the “stage”. The following video has some great little bits of info for advanced touch event features and logic. The first tip solved the issue I was having and it only took adding a couple more lines of code.

Coronasdk development tip – suspend

In hopes to save someone else a few hours of reading and digging I figured I would start posting some quick tips about some of the small things that will make your programming experience on iOS with coronasdk a little easier and let’s face it, make you feel more awesome that your applications does what it’s supposed to do when a user interacts with it. 

If the user hits the home button on iOS the app closes and if they where in the middle of doing something, by default they will not be returned to that state in the app. Not sure why this is the default functionality but none the less I started searching on how to “save state” of the app when it’s interrupted by navigating to another application or clicking the home button to get back to the main screen. 

If you do some googling as I did for “saving state”, or “coronasdk suspend” and so forth you will more than likely come across a few posts that suggest listening for and event that the applications is exiting and then figuring out a way to save the state of all the variables and logic needed to load the screen the user is on when they return to the app. This is totally the case and something you should do if you want to return them to that state if the app quit but suspend is different that quitting or exiting the app all together. 

If you want the app to suspend and return to the screen and state that it’s in when the user navigates away and returns via “iOS multitasking” then the solution is very simple. Go into your app build.settings file and add the following line “UIApplicationExitsOnSuspend = false”. By default a corona app “Exits” the app when suspended by default. You are basically telling the app to suspend rather than exit by adding this to your build settings.

https://gist.github.com/1355130

Bubble Ball – number one free app by 14 year old developer Robert Nay

As of right now Bubble Ball is the number #1 app in the app store. “Big Deal” right? Well what makes this awesome is a couple of things. First and formost the app was developed by a 14 year old developer, Robert Nay. Number 2 the game play is awesome. Number 3 the developer used CoronaSDK to develop the app. Download it now and give it a try.

So, what does Bubble Ball have going for it? One word: Gameplay!

In Bubble Ball, you’re tasked with a simple mission: Get the ball from point A to point B. Each of the game’s 21 levels gives you a different route to navigate with different game pieces to assist in your deceptively simple-worded quest. Place the geometric pieces however which way you please to create ramps, platforms, and even catapults to send your ball to the finish line. At first, it’s easy; but in the later levels, it can be quite the stumper — but, you will not put your phone down until you figure the very last one out!

SWFSheet – create sprite sheets from SWFs | BIT-101

I have been using CoronaSDK for a while now. I am always on the lookout for tools that will make development faster. Keith Peters just developed and put out a tool that I know without a doubt that I will use. Enter SWFSheet, an AIR application that takes swf files and creates sprite sheets for you from the time line animations that you created in Flash. This is totally awesome. Now I can use my animation skills in Flash to create great png based sprites without too much effort at all.

Ghosts vs. Monsters: Angry Bird like game made with Corona in 36hrs

There’s a question that’s been asked many times over in our forums, e-mails, and at gatherings: Can Corona SDK create a game similar to Angry Birds, and how easy is it to do? Without a doubt, our answer has always been a solid “yes!”

Then, the next question has been “Can I see a demo?”

“Flying Space Rocks” progress – fix for addBody after collision event in CoronaSDK

I have been building a simple Astroid clone as some of you know. Well I found a bug that really stopped me in my tracks. My understanding is that it’s a bug with the Box2d logic that Corona uses for it’s physics engine.

During a collision event you basically crash the application if you try to set any properties on any of the bodies that are being updated by the physics engine. I was able to get a crash by trying to call addBody and also by trying to do something simple like setting X and Y properties on a body that the physics engine was trying to update during the collision.

The fix really is pretty simple and I consider more of a “hack” than anything. You basically have to create an enterframe event and call your logic with in the enterframe function. This basically allows the physics update to complete and then you can act on the objects within the physics engine on the next frame. As you will see I create a local function with in the collision event that runs and then also removes the enterframe that we create as soon as we are done running our logic.

If anyone has a better solution please feel free to post in the comments.

The things that where crashing the app that are now fixed where the following. When a missel collides with a rock I wanted to create smaller rocks and then move the missel that was just used off screen so that it does not collied with any more objects till it is shot from the spaceship again.

Particle Candy for Corona SDK by Xpressive Games

Well I figured it was only a matter of time before some developers started building and releasing some pretty awesome tools for the Corona SDK. Enter “Particle Candy”. I personally have not used it yet but I plan too. Something like this should be perfect for the exploding astroids in the game I am building

See more at x-pressive.com

Easy Screen Management in Corona

I have been messing around with the Corona SDK for a while. My goal is to have a game on the app store and the android market before then end of the year.

A small hang up that I was having was screen management. On the surface lua is really easy to learn but nothing is said about any good practices at all. As more of an OOP programmer it is essential that I am able to write my projects in a very modular way. Well luckily jonbeebe wrote a post about this very thing. Not so much a good OOP article as it is more of a way to organize your Corona projects into screens, so for me this is a good start. I am half way through my first game and the main.lua file was getting pretty large.

You can download the template that Jon has created below and I encourage you to take a look at the full article. It’s not to long and very helpful

The Corona Project Template

I created an example that contains three files:

  • main.lua
  • screen1.lua
  • cheat-sheet.txt

You can download the project template here. It contains your main project file, an example screen template that you can duplicate for as many screens (or “scenes”) you need in your app, and a “cheat sheet” text file that’ll walk you through all the steps that need to be accomplished to add a new screen to your app (only 5 steps).

If you are interested in taking this corse then submit your email. I'll make sure you get a discount for signing up early.