BeebeGames Class - Download

*Requires Corona Build 243 at the very least.

Download it here: BeebeGamesClass.zip

This is my BeebeGames Class , which provides a lot of useful functions for games. It started out as my way of creating display objects as quickly as possible.

Simple, Pauseable Animation

For those who use movieclips, this should be a breathe of fresh air because animation can be easily started, stopped, paused/resumed, and you can set the interval between frames. If you just need an object with multiple images (or just one), this can also provide that.

Basic Transition Pausing/Resuming

Also, it provides a basic form of linear transitions (modify the x, y, xScale, yScale values) which can be PAUSED and RESUMED easily by simply setting the .isActive variable to true/false.

Useful Game-Related Functions

Each object you create with the BeebeGames class will provide you a few new methods you’re not used to having access to, such as:

[blockcode]
object:move( x, y ) --> move object relative to current location
object:moveTowards( x, y [, increment]) --> move towards specific point; default increment is 1 (pixel)
object:getAngleTo( x, y ) --> Get angle from object to specified location
object:getDistanceTo( x, y ) --> returns distance (in pixels) from object to specified location
object:destroy() --> removes event listener, calls removeSelf, and then garbage collects
[/blockcode]

Retina Display Text

There’s an included retinaDisplayText() function which should completely replace the existing newText function.

And a few others…

commaThousands() will return a large number with commas separating the thousands digits.

saveValue() will easily save a value to a single-line file.

loadValue() will easily load a value from a saved file, or create it if it doesn’t exist.


I made this class for myself to use in my own projects, so it’s not perfect (nor is the included documentation that exists in the comments section at the beginning of the module), so feel free to expand on it and tweak it to fit your needs.

Enjoy!

Jonathan Beebe
http://jonbeebe.tumblr.com/
http://beebegamesonline.appspot.com/
P.S. If anyone cares to make an example demonstrating all of the functions of this class, please share it by posting the download link to the example in the comments thread. I don’t have an example handy at the moment, but I did test everything as I added it to the class. Also, not guaranteed to be bug-free, but it works great per my personal testing thus far.

[import]uid: 7849 topic_id: 4474 reply_id: 304474[/import]

Once again, many thanks!!! You are very gracious! [import]uid: 11904 topic_id: 4474 reply_id: 14024[/import]

I have been converting my game to use your class and I have been running into an issue when it comes to adding physics bodies.

When using physics.setDrawMode( “hybrid” ), objects that have been created using your newObject method dont have a physics body around them. This relates to my issue in this topic: https://developer.anscamobile.com/forum/2010/12/26/collision-detection-issue

Any input on why it might be an issue?

Thanks for an awesome class!

-Kyle [import]uid: 9968 topic_id: 4474 reply_id: 14873[/import]

Hi Kyle, I replied to that thread. Hopefully you get everything working soon :slight_smile:

P.S. Merry Christmas everyone! (still 3 and a half hours left until it’s over where I’m at) [import]uid: 7849 topic_id: 4474 reply_id: 14875[/import]

Hi. the download link doesn’t seem to work anymore.

Is there a different link for this?

Cheers

Chris Long [import]uid: 9457 topic_id: 4474 reply_id: 14991[/import]

Here’s the page with updated download link, latest version info, tutorials, etc:

http://developer.anscamobile.com/code/beebegames-class [import]uid: 7849 topic_id: 4474 reply_id: 15049[/import]

How would I go about creating an object with the newObject function that has just a color, not an image? [import]uid: 8782 topic_id: 4474 reply_id: 15856[/import]

NayGames: Currently no support for vector shapes, newObject() is a semi-replacement for display.newImageRect() and movieclip.newAnim() [import]uid: 7849 topic_id: 4474 reply_id: 15898[/import]