Build 10 classic Flash games and learn game development along the way with this ultra-fast paced game development course.

If you love this blog, this is the book for you.

Buy the book

Get the source code of 12 commercial Flash games, which have been loaded more than 50 million times!

Learn from real world successful examples.

Get it now

Box2D for Flash Games teaches you how to make Flash physics games from scratch with the most advanced features.

Create the new Flash game smashing hit.

Buy the book

Gravity: a flash game by Jon Dutko using my tutorials

I am very glad to introduce you Gravity: a flash game by Jon Dutko developed starting from my tutorials.

Gravity

The game is still in beta so Jon needs feedback.

It’s interesting how Jon designed some levels: growing balls, chasing pentagons, lightnings, mazes… can you beat all 30 levels? (I did it…)

Here it is the explication about how Jon made this game

Jon:

There are four main movie clip instances in -gravity-. hero, which is the movable character; wall, which is where all obstacles, both movable and unmovable; startpoint, the green spawnpoint for the character; and endpoint, the red trigger to move to the next level.

All coding is done under the “hero” movie clip. Bear in mind, I borrow heavily from your original code, tweaking small bits to fit the game. Without further adieu, here is the code:

onClipEvent (load) {
    yspeed = 0;
    xspeed = 0;
    power = 0.65;
    gravity = 0.1;
    upconstant = 0.75;
    friction = 0.99;
}
onClipEvent (enterFrame) {
    if (Key.isDown(Key.LEFT)) {
        xspeed = xspeed-power;
    }
    if (Key.isDown(Key.RIGHT)) {
        xspeed = xspeed+power;
    }
    if (Key.isDown(Key.UP)) {
        yspeed = yspeed-power*upconstant;
    }
    if (Key.isDown(Key.DOWN)) {
        yspeed = yspeed+power*upconstant;
    }
    yspeed = yspeed+gravity;
    _y = _y+yspeed;
    _x = _x+xspeed;
    _rotation = _rotation+xspeed;
    if (_root.wall.hitTest(_x, _y, true)) {
        xspeed = 0;
        yspeed = 0;
        _x = _root.startpoint._x;
        _y = _root.startpoint._y;
    }
    if (_root.endpoint.hitTest(_x, _y, true)) {
        xspeed = 0;
        yspeed = 0;
_x = _root.startpoint._x;
        _y = _root.startpoint._y;
_root.play();
    }
}

…and there you have it. Levels are divided into episodes by 10′s. Episodes are divided by scenes; so far, there are 3 “episode” scenes and one “intro” scene.

Gravity is not done yet; I hope to finish 20 more levels before sending it to the major syndicates (ie newgrounds, addictinggames).

What are you waiting for? Give him feedback and send me your works to have them published on my blog!

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading ... Loading ...
Flash Templates provided by Template Monster are pre-made web design products developed using Flash technology.
They can be easily customized to meet the unique requirements of your project.
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 13 comments

  1. Article Feed » Gravity: a flash game by Jon Dutko using my tutorials

    on February 26, 2007 at 6:00 pm

    [...] Read More Emanuele Feronato [...]

  2. programmedchild

    on February 27, 2007 at 3:20 am

    Cool game it is verry fun I am also working on a game that is original and fun.

  3. abhilash

    on February 27, 2007 at 12:06 pm

    from which link(or button) on the website you submitted your game.I have also made a 2player racing game but I cant find from where to submit??

  4. Emanuele Feronato

    on February 27, 2007 at 12:29 pm

    abhilash: at the moment there aren’t buttons to submit a game.

    Send it to me at info(AT)emanueleferonato.com along with some explications like Jon did

  5. abhilash

    on February 28, 2007 at 8:07 am

    emanuele:I didn’t understand what u wrote ‘info(AT)emanueleferonato.com.
    An error came ‘invalid page’ or something else.

  6. Emanuele Feronato

    on February 28, 2007 at 10:25 am

    I mean you should send me your work by email, at info@emanueleferonato.com
    I put the (AT) to prevent spam, never mind…

  7. abhilash

    on March 1, 2007 at 11:13 am

    @emaneuele:thanx and sorry for that noob question

  8. mousey

    on March 3, 2007 at 12:08 pm

    i really like the game ! hope it all goes well

  9. hasna

    on March 9, 2007 at 7:00 pm

    nice game but why dont inprove the hittest with the one from linerider tutoriol part 3

    cleard all levels =)

  10. Lauren

    on March 16, 2007 at 9:27 pm

    this game is tight
    J-Duck is a beast

  11. Kieron

    on March 17, 2007 at 5:13 pm

    This is a very good game. There are some very original level ideas here, and some clever tweaks in the code to fit your game. I managed to complete it all, so maybe you should make some more, and much harder, levels. This could make the game appeal to more people, as it is a bit easy at the moment. Nevertheless, well done!

  12. flash noob

    on April 4, 2007 at 8:26 am

    i dont get it. What are you supposed to do first? I know you have to draw something first before you can put the code in.

  13. sangokushi-taisen

    on June 16, 2008 at 11:07 am

    hey that’s some cool game