BeebeGames Class for Corona SDK

No, I’m not talking about an actual “class” where you sit down and learn something, rather, the BeebeGames Class is a module you can import into your projects to take advantage of additional functionality.

You can download it from the Corona Code Exchange.

A Closer Look

So what does it do? Well, it does many things, but the main highlights include:

  • newObject() function that replaces display.newImage, display.newImageRect, AND movieclip.newAnim for those who want to get an image object on the screen, positioned, and into a group with just one line of code.

  • A replacement for movieclip.lua that allows you to control the interval between frames in an animation. Also useful for non-animating object with multiple images you need to switch to-and-from periodically—uses the same newObject() function!

  • A cool—but optional—flipping animation that can be applied when switching between image frames. Comes in handy for card games, etc.

  • New doTransition() function that supports pausing/resuming! Right now, it only supports linear transitions on the x, y, xScale, or yScale properties.

  • Other useful object-related functions such as a relative move() function, a moveTowards() function, as well as functions to get the angle and pixel distance between two different objects!

  • newRetinaText() function that completely replaces the old newText() function, and—you guessed it—shows up clear on retina displays. Also has a few cool features like an updateText() method and an alignment setting.

  • Pause/resume your game by simply switching a .isActive variable to true or false.

  • Allows for an easier way to transfer information between modules (such as a gameScore variable, or anything you need), saving/loading of files in just one line of code, and even a function to place commas in the thousands digit of a number (very helpful when it comes to large score numbers).

All in all, the BeebeGames Class will shave off a lot of time when it comes to doing some of the tedious little tasks, or get an image animating at just the right interval without having to deal with the complexities of spritesheets.

It also cuts out the need for you to figure out complex calculations for getting angles, distances, and provides a lot of other functions that can be applied to many apps, and especially games in particular.

Once again, you can get it at the Code Exchange—feel free to leave me comments/questions there.


To read more entries, visit the archives or subscribe to the RSS feed.