Build 10 games and learn game development along the way in this fast paced game development course

Get the source code of 12 commercial games, loaded 50+ million times, and learn the secrets of game design

Learn how to make a successful Flash game from a real world example. Fully commented source code

Create realistic Flash physics games from scratch with advanced features, from Angry Birds to Crush the Castle

Full Hungry Hero game source code available

Do you know Hungry Hero game?

The concept is very simple. The hero is pretty much always hungry and you need to feed him with food. You score when your Hero eats food. There are different obstacles that fly in with a “Look out!” caution before they appear. Avoid them at all costs. You only have 5 lives. Try to score as much as possible and also try to travel the longest distance.

What makes this game really awesome? The author, Hemanth Sharma, released the source code and gave me the permission to blog about it.

Let’s see what he says:

I am happy to announce that Hungry Hero is now Open Source on GitHub. It is no more just a basic code you saw during the Starting with Starling tutorial series (a must see!!! Eleven ultra-detailed video tutorials!! – Emanuele), but a complete game source code that you can fork, watch or log. I have primarily kept the main ActionScript file to match with the screen dimensions of iPad 1 & 2 (1024 x 768).

The whole game as you know uses Starling Framework to power itself up through Hardware Accelerated rendering.

Now, do enjoy downloading the full source code for free but please DO NOT use the graphic assets in any of the commercial projects. It’s a humble request. Use it only for learning purposes. As for the source code, you may play with it, modify it as per your needs and use it in any project you want. These are some of the consolidated “game development” features this source showcases: –

* Textures
* Animation using the Juggler
* Texture Atlas or Sprite Sheets
* Parallax Background
* Mouse/Touch Interaction
* Collision/Hit Detection
* Object Pooling
* Bitmap Fonts
* Starling Extension: Particle System

As far as the optimization is concerned, the game is well optimized (though there is always scope for more). It runs on most tablets at 60 frames per second. I still have a couple of video tutorials to create around Starling Framework + Optimization, after which I shall update the GitHub source code of this project as necessary.

The simplest way to use this source code is to download the master branch as a zip file and then simply import the downloaded set of project files as a “Mobile ActionScript Project” in Adobe Flash Builder 4.7.

Hope you guys find this useful, and if you do, please leave a comment below! Also, if you happen to use any part of the source code from this project in your projects, do leave a comment in the official page so I can check your game out and don’t forget to credit me for what I have been helpful for.

Thank you very much, Hemanth

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (16 votes, average: 4.75 out of 5)
Loading ... Loading ...
Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 5 comments

  1. Janitha

    on November 14, 2012 at 6:17 am

    Thanks for sharing. I’m sure this will help thousands of new comers, including me.

  2. Aleksandar

    on January 16, 2013 at 1:40 pm

    Hi all,
    great code and i was watching hungry hero tutorials on hsharma.com and enjoyed them, but was frustrated as i like working in flash not flash builder and all. Yesterday i said, let me try to make a fla and use code from example to get it to work. I added starling swc in lib path, folder for particles in source path and it was enough to get it working!!!
    When resizing screen of swf i got an error for context being changed and you loose display, so you just need to add Starling.handleLostContext = true;
    Now what i still cant figure out:
    i get output text:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at com.hsharma.hungryHero.screens::InGame/onTouch()
    at starling.events::EventDispatcher/invokeEvent()
    at starling.events::TouchEvent/dispatch()
    at TouchProcessor/advanceTime()
    at starling.core::Starling/advanceTime()
    at starling.core::Starling/nextFrame()
    at starling.core::Starling/onEnterFrame()

    This happens when cursor goes of the stage. Friend of mine has old version of starling, so he added in onTouch function: if (!event) return; and it works for him, but i stil get same error, i am guessing ’cause i downloaded new 1.3 starling.

    Anyway game works great, fps is also 59-60, so hope i made someone happy:)

    Thanks Emanuele, you are the best tutor man can have!

  3. Airgame16

    on January 23, 2013 at 5:54 pm

    private var touch:Touch;
    private var touchX:Number;
    private var touchY:Number;
    .
    .
    .
    private function onTouch(event:TouchEvent):void{
    touch = event.getTouch(stage);
    if(touch){
    touchX = touch.globalX;
    touchY = touch.globalY;
    }
    }
    .
    .

  4. engine

    on May 25, 2013 at 2:56 pm

    nice src but the collision method used in this game are not good

  5. Mike

    on March 11, 2014 at 1:00 pm

    Very cute game! I’ll play with it for funzies!

Thank you for the download!!

I hope you will find it useful and make something interesting out of it

To keep up to date with the blog, why don't you like my Facebook page and follow me on Twitter?

Want to learn more? Don't miss this:

Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now

×