Here’s a simple, unfinished, Corona game. It shows how to:
- use a sprite sheet for animation
- use tweening to move things
- play audio
- handle touch events
As a Flex and Flash Architect, you’re probably wondering why I’m even bothering with Lua, specifically Corona. Â A few reasons.
First, you should try to learn at least one new programming language a year. Â Creating even just a few prototypes is enough as it forces you to write code and learn about the platform.
Second, there is a lot of hype around Corona, so I wanted to learn for myself the facts.
Third, if I were to release anything, apparently the marketÂ penetration far exceeds AIR. Â I haven’t compared performance on iPhone yet, just the 2 Droids I have. Â I like the prospect of re-using a large portion of my code vs. a pure native implementation. Â Speaking specifically for games here, not applications.
Fourth, a high level language like Lua is a nice break from ActionScript 3.
Fifth, I like to see how others create games. Â It reminds me A LOT of the Flash Lite community. Â They tend to create a lot of small games. Â Some aren’t very sophisticated, but their quick ability to port to different platforms was the key to their sale.
Just unzip the folder, and open main.lua in Corona. Â Here’s my Lua for ActionScript Developer’s guide to help, and here’s the main Lua documentation.
Balloon Pop – ZIP
9 Replies to “Corona Game Example: Balloon Pop”
Just remember that if you make that awesome game and you want to publish it live you have to pay $199 for iOS only or $349 for iOS and Android, add on top of that the $99 for a developer account with Apple.
Not trying to discourage devs from testing tools, just a friendly reminder of using 3rd party SDKs with a price tag on them.
Flash price tag is 699$, so I don’t get your point about not trying 3rd party SDK
You can develop Adobe AIR apps for free. You don’t need Flash or Burrito. I’m using AXDT a lot nowadays, and Adobe’s amxmlc and adt are free.
I get Helmut’s point about Corona’s price tag. A cheaper Lua (on top of C++) alternative is AirplaySDK. Free for iPhone, or $99 for all other platforms.
How about a video of your game? I’d like to see what it looks like.
flash sdk is free and there are open source solution in order to build a swf.
My favorite is flashdevelop: http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page
With this free ( code only) IDE you cade build iOS project, Android project, classic swf, and desktop exe for mac/pc/linux.
But the adobe flash ide is really good too if you have a graphic skills.
Trying out Actionscript -> LUA in lieu of learning objective-c is very appealing. I can’t quite wrap my head around the object-oriented LUA equivalents are and how they work (classes, etc.). Are there include statements? Or does my main.lua just turn into a billion line program?
This is great and inspiring stuff!
@Mistersuits Yeah, you can definitely do “imports”. For example here is the Stats equivalent for Corona. Notice the line:
And how you can treat that as an object, and access it’s properties. That’s just one way to create reusable objects, they have classes too, and a variety of ways to create them. I show you 3 class examples in the classes section in my previous blog entry and Ted Patrick showed me some more info on how to “cheat at Lua”.
OK, Corona looks just fine, but it’s better for us (I think) to force users instal AIR on their devices. For me (as a developer) it’s unbelievably easy to code something in Flash/AIR and then just export it as SWF for web, APK for Android and IPA for iOS. Why should I start learning Corona and pay for it? I have AIR, I didn’t pay for it and it just works.
@MaRmAR Good point. I too find it extremely easy. Again, it’s good to see what the competition is doing, what alternatives are out there, and what they offer that AIR doesn’t. This includes:
These are helpful for building games, and other interactive apps. This gives you a broader perspective as what is possible, and makes you ask questions. Why does Adobe not have these features? Do we need them? Who are our clients and why are we building what we do the way we do? Answering these questions helps you learn about technology, about the industry, and generally improve your skills overall.
Additionally, it helps me advise clients. I like AIR. I can confidently explain that it’s compiled to C++, whereas on Android it’s an optimized Flash Player for mobile. Whereas Corona compiles Lua to C/C++ for Android and iPhone, no interpreter like Flash Player has. Also, the speed of development for smaller apps with a light weight language such as Lua is faster, and has a lower learning curve.
I couldn’t say any of the above unless I knew both, or even a passing familiarity, know what I mean?
Yes, I’ll probably be sticking to AIR still based on Corona not having the bitmap functionality I need, but it still was a rewarding experience to play and learn.
Comments are closed.