From the Forum — Issue #56

From the Forum — Issue #56

From the ForumWelcome to the latest installment of From the Forum. In this series, guest blogger Alex Jackson highlights outstanding threads from the Corona Forum. The goal is to bring attention to the most captivating, interesting, and thought-provoking discussions taking place in our very own backyard.

Please visit the forum to join these conversations or start your own!

1. Display objects, finalize() and you

Managing our display objects within our apps should always be paramount. It’s easy enough to spawn umpteen lemmings and have them all running about with various timers and transitions, but when you need to get rid of those guys and get to the next screen? That simple spawn logic just became your downfall!

Following some simple spawn logic (Corona has a nice blogpost on the subject) is a good first step. But what of the transitions and timers? Getting rid of those neatly isn’t always as intuitive. Recently, the question of object management came up in the forum, and distinguished developer horacebury had some great suggestions. Among them was the use of the finalize() API, which was designed specifically to give Corona developers a better handle over cleanup functionality regarding our display objects.

Head to the original thread to see what else as suggested. And if you have your own ideas in mind, please share them with the group!

2. Heavy load? Better check the supports!

Delivering the smallest download possible from an app store is ideal in mobile development. In many cases, this increases the likelihood of your app being downloaded, because it would be a lighter load on the users’ bandwidth, and potentially a smaller footprint on the users device.

It can also be a good idea to develop your app with a light up-front download size, then either access of outright download the heavier assets over the internet after it gets onto a users device. Of course, the intent here is creating a better user experience from beginning to end, so downloading all of your app’s resources over a mobile network would be as bad as having a big download from the outset!

The forum post below discusses some possible methods to check the mobile/wifi type of connection of a given device, so your users can make an informed decision about when to download. Give it a look over, and if you have your own method, let us know about it!

3. In which math is your best friend

Smooth movement. It’s seemingly the grail in mobile gaming. What’s the best way to get your objects to move in seamless paths without all the overhead? As usual, some simple trigonometry comes to the rescue here, as our old high school (or grade school, for you overachievers!) pals sin/cos/tan can be used to make a nice movement wave that looks a lot like the normal gait of a human.

The below thread was started to discuss some simple options to accomplish figure eight movement, and it became a showcase for one Corona developer’s interesting movement logic. Check out the thread for some tips on how to use trig APIs to your advantage. Have your own spin on the idea? Don’t hesitate to share!

About Alex

Alex Jackson is an indie developer and the founder of Panc Software, specializing in retro-style gaming. He has created several mobile applications, enjoys long walks on the beach, pixel art, and reading the Corona forums. Contact him by email or follow him on Twitter: @pancsoftware. Check out his new game Crosstown Smash on iOS, Android, and Amazon devices!

Rob Miracle

Rob is the Developer Relations Manager for Corona Labs. Besides being passionate about helping other developers make great games using Corona, he is also enjoys making games in his spare time. Rob has been coding games since 1979 from personal computers to mainframes. He has over 16 years professional experience in the gaming industry.

  • Thomas Vanden Abeele
    Posted at 00:58h, 26 January

    Alright! Cool to see some of my forum posts popping up here in point 3, especially since I’m a heavy heavy advocate of using sine waves for just about all my movements – including walk cycles and more. Math is your friend!

  • Antheor
    Posted at 03:27h, 27 January

    I’m also a big fan of math magic snippets !