Feb 132012

A treat for Techority readers in this special guest post by Graham Ranson of Glitch Games.

Barrel Joyride is a trimmed down version of Jetpack Joyride by Half Brick, it is meant as a template and as such will still need to be fleshed out a bit for a proper release. That being said it is still pretty playable at the moment.

It was designed around the dimensions of the iPad, as that is the device I own, however naturally being made in Corona it will work on plenty of other devices.

A general overview of its features are:

?Infinite scrolling background
?Collectible items
?Obstacles ( moving, rotation and stationary ) ?Jetpack mechanics
?Very basic particles for the jetpack
?Data saving
?Looping music playlist
?OOP structure
?A wizard

This documentation is not meant to be a full step-by-step tutorial but rather an explanation of all the various classes that are included. All the code is documented as well and hopefully is pretty easy to understand or at the very least use.



The player class doesn’t really do all that much, it is essentially just a visual image that has a physical body attached. It has the main collision handler function and a Jetpack object attached to it which will be explained later. Things that could be done to this Class to expand it would be to allow for different visuals and also to separate the jetpack image from the player image and place it in the Jetpack class.


The jetpack class is another simple class that just acts as the thrust part. It simply uses “applyForce” to move the player and also plays a sound and creates the particle objects.

Ways to expand this would be to move the actual jetpack image to it and allow for variations.


The sparkle class is the particle that is chucked out from the jetpack, it has a plain white visual which is then coloured in code randomly to make it look all magical. It just uses a transition to chuck them out and a bit of randomness to make them more fluid.


Yet another simple class here consisting of a visual, a physics body set to “isSensor” so that the player doesn’t get physically affected. The only function that really does any resemblance of work is “playerHit” which is called when the player object collides with a coin. All it does is play a sound, fire off an event and then destroy itself.


I see a pattern here, this function is basically the same as the Coin class so I don’t really need to explain much.


The missile does a little more work than the rest of the classes as it actually has to move, but it is still pretty simple. It still has the regular image and physics stuff but it also has an “alert” image that pops up on the right hand of the screen just before the missile is visible and then removes itself after a short while.


This class does a little more work then most others, but don’t worry it’s still pretty simple. It loads up some json data which describe each of the level sections ( explained later ), creates a roof and floor so the player can’t escape and sorts out the scrolling.

It has an update function that moves the two active level sections and then another one that creates a new section and destroys a previous one to allow for infinite scrolling.


The levelSection class is created through json data and sets the position of all the zappers, missiles and coins.


Just a class with a couple of helper functions for reading in files.

In Closing

I hope you enjoy this template, you are free to do whatever you want with it. You can modify the art, code anything just have fun and if possible give a shout out to Glitch Games if you do use it – @GlitchGames

Download using the button below;

Download Jetpack Joyride Corona Template

Like this post? Subscribe to the monthly newsletter!


  25 Responses to “Barrel Joyride – FREE template from Glitch Games”

  1. Damn ! I can recall this as a “Didn’t I told you to check the API first!” type of situation ^^ Thank you for the info !

  2. The Player:toFront() method is simply a wrapper/helper function to call the toFront() function of the visual display object. No infinite loop here.

  3. Hi Peach,

    I have a problem trying to figuring out why you did this: In the player class, there is a method toFront() which redirect to the player’s visual’s method toFront()…

    …But… are we doing an infinite loop or what?! How can a method can redirect itself ? Plus, there is no indication whatsoever in the toFront() method how to put the player to the front…the method(which is empty) only redirects itself which contains nothing… so strange…

  4. Hi Peach

    Don’t have twitter, any chance of a link?

    All the best


  5. … hold on, let me grab my popcorn. tis gonna be a good one :)

  6. Is this not your Twitter? https://twitter.com/#!/tiwwas

  7. dont have a twitter, can someone email to bartman@tiwwas.com

  8. thank you , I will look at it ,

  9. The problem is:
    local json = require( “json” )

    Change to:
    json = require( “json” )

    And all working OK.

    Thanks Graham and Peach

  10. It worked for me. Thanks Peach and the Glitch Games people for this!

  11. Nyah! I don’t get why it’s working for some and not others. Emailing link right now.

  12. @Peach, hate to break the news to you, I’m another one who its not working for :)

  13. Crap, another one? I don’t know why it sometimes works and sometimes done.

    Shut your jaetpack mouth. Emailing link.

  14. Can’t get the file. Also the tweet says “JAETPACK” – What’s a jaetpack? :D

    Just downloaded a FREE Jaetpack Joyride template from #Techority

  15. I hope you’re all enjoying the template, I know the documentation is slightly lacking but the fun is in the challenge right? Right?? OK, if anyone is having difficulties with any of it please do get in touch and I will gladly help.

  16. Sent the tweet – got to a download screen – pressed the download button but nothing happened. Can you email me the direct download link – thanks- Ken

  17. Thanks Graham and Peach!! This is so perfect for the game I’ve been working on, sparkles and all. :)

  18. what a wonderful treat! thank you both!

  19. bow chicka bow bow wacka wacka bow.

    oh hai!

  20. SO COOL! I’m totally digging my nose into this to see how OO is approached here ^_^

    Thanks Graham and Peach!!!

  21. Can’t seem to be able to get the template. Once in box.com I get a @file has been deleted” message.

    • File is still there but box.net decided to be a pain in the ass, so I’ve just uploaded it to my own server and the download link will now work, issue free. (Tested and confirmed.)

      Sorry for any hassles!

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.