From the Forum — Issue #120

From the Forum — Issue #120

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!


Doing the dance around the middle

I often remember back to my youth when I was so well-rested, because I would sleep during my Geometry, Trigonometry, and Statistics classes. Then I snap back to the present and realize I could save myself a lot of wasted hours and undue stress if I had just paid attention!

Cosine and Sine waves, shape area, and probability are intrinsic to the vast majority of game development. Getting our heads around their proper place in the hierarchy of your code should be one of the top priorities when first learning. Fortunately, you don’t need to reinvent the wheel, as stalwart developer RoamingGamer has created the fantastic math2d plugin for Corona developers to use for their math-related challenges.

Recently, he responded to a thread looking for a simple solution for offset projectile management. Using his math2d library as a base, he provided an elegant solution that can stand up to significant scaling. Head down to the main thread to see his suggestion, and to see what the math2d is capable of!

https://forums.coronalabs.com/topic/62581-how-to-offset-a-bullet-from-center-of-a-rotating-object/

Of JSON and strings

We all know the utility of the json.* library. Its roots in the main Corona API are far-reaching, and it makes maintaining user information between sessions much more lightweight.

As useful as it is, it’s not without it’s peccadilloes. One pitfall that developers fall into is the fact that, when using it to encode table info with mixed indexes (numeric and text), any numeric indexes will be converted to strings during the decode process. This can be very annoying at first when you’re not sure how to handle it. Fortunately, RoamingGamer arrives to save the day once again, dropping some knowledge on the issue itself and hooking us up with a tidy function to resolve any issues that we run into because of this situation.

Click through to the original thread for a glimpse at the snippet in question. Have your own hot take on the subject? We’d love to hear about it in the forums!

https://forums.coronalabs.com/topic/62711-loadsave-is-saving-my-tables-numeric-indexes-as-strings

Saving files inside Windows apps

From where I sit, it looks like Corona-supported Windows OS deployment is catching up to mobile very quickly. The amount of functionality available to us is increasing everyday, and I wanted to take the time to highlight something that is a basic necessity in any app being developed today.

I speak, of course, of “save as” functionality. Getting program-generated documents, pictures, screen grabs and other assets onto a specific location on a user’s workstation used to be guesswork. Now however, oft-featured Corona engineer Joshua Quick educates us on the saving subject, complete with some useful code snippets that we can add to our toolbelt.

Roll through to the original thread and see how to get these features working correctly in your next desktop game!

https://forums.coronalabs.com/topic/62564-save-as-possibl/

About Alex

Alex Jackson is an indie developer and the founder of Panc Interactive, 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: @pancinteractive. Check out his new game Segreta on iOS, Android, Windows Phone and Amazon devices.

alex
No Comments

Sorry, the comment form is closed at this time.