Welcome 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. PhoneGap sample project for CoronaCards
How do you get started with CoronaCards? Android and iOS documentation exists, but what about the other supported platforms? Recently, Corona Labs provided a PhoneGap tutorial for CoronaCards. You’ll need some knowledge about PhoneGap before you begin, but it’s a good starting point.
2. Rolling out pseudo-randomness
Both are useful and both have their places, but what happens when you want to run through a specific series of numbers and locate a random one amongst the group? What if each interval of choice needs to represent a different non-consecutive number? The above APIs won’t handle that, so a custom permutation might be the best bet. Corona developer ingemar posed this exact question and the Corona community delivered their own suggestions, including some from the Code Exchange.
Jump over to the original thread to get informed on pseudo-randomness.
3. Pathfinding with A*
One challenge with a game concept that incorporates “tap to move” functionality and a grid-based level format is getting the character to move to the place you tapped in a logical fashion. One solution is to use A* pathfinding which calculates the amount of “squares” (as defined by an existing grid) needed to move from square A to square B. It incorporates some relatively complicated algorithms and functional logic, but Corona developer chris20 has put together a handy tutorial on using A* with Lua code.
If you’re curious to learn more, follow the path over to the original thread and grab the free code.
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!