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

New tile based platform engine – part 11 – slopes part b

As said in New tile based platform engine – part 11 – slopes part a, the game needed a fix for the jump from/on slope bug.

In part b the bug becomes a glitch… now you can jump from/on the slope but sometimes there is a “rebounce” glitch.

It’s very easy to determine why it’s happening and fix it… I am just leaving the explication for next time because I just got my computer repaired and need to do a lot of things.

I just wanted to answer a question about senseless slopes and N game mechanics.

There is a lot of difference between my tile based engine and a raycasting one.

Maybe I’ll cover it in next future.

Meanwhile, you are invited to take a look at the source code and fix the glitch at line 338

Enjoy the result

Download the source code and have fun

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (27 votes, average: 4.78 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 28 comments

  1. Pedro

    on October 24, 2008 at 2:28 pm

    I’ve found a small glitch about treadmills. When hero is on a last right treadmill, it’s totally moved to next tile, but, when it’s on a last left treadmill, only a pixel of the clip finishes above the next tile.

    Your platform engine it’s great, thanks!!

  2. Dude

    on October 24, 2008 at 2:38 pm

    Well done…looks like the glitch only apears when landing in the middle of the slope an not on the cornerns…
    Anyways I was wondering if you could enhance the enemies in the next part so they kill you and you can kill them (maybe by jumping on them)?

  3. Joel Parkey

    on October 24, 2008 at 7:03 pm

    Thats pretty darned aweome.

  4. Jeremi

    on October 25, 2008 at 3:37 am

    Nice work, dude you really help making flash games easy, thanks for helping all of us. I like all of your tutorials they are very helpful.

  5. AS3 Gamer

    on October 25, 2008 at 6:10 am

    Are you seriously coding in AS2 in 2008?

  6. miff

    on October 25, 2008 at 1:20 pm

    This is a good slope now
    Next part – scrolling level maybe?

  7. EagleVision

    on October 25, 2008 at 4:28 pm

    @AS3 Gamer
    Yes, and along with thousands of people who still don’t have enough money to buy CS3/CS4, unlike you rich guy.

    Just don’t assume things, and make a firm statement. Think. ^^

    Anyways, enough flaming. :P Nice tutorial, I won’t download it yet, since I like to see how it goes first, and if I work on the first the next version comes out with something I don’t want to work on…And that just gets very messy.

    Good job, keep going.
    Samuel

  8. jacko123

    on October 25, 2008 at 4:52 pm

    Hey…
    nice tutorial!
    By The Way: Your feed is broken!

  9. Josh of Cubicle Ninjas

    on October 25, 2008 at 8:25 pm

    I love guys like AS3 Gamer.

    They still haven’t figured out the difference between tools and content. You just hand built a clean and efficient platforming engine and he is worried that it isn’t “new” enough. Does it work any worse? Nope. And yet he bitches on.

    The good news is that people like him are so busy chasing technology they never make anything useful. Give me Flash 5, Photoshop 3, and some free time and I will blow your mind…

    As always amazing work Emanuele!

    (BTW anyone else find the RSS on this site broken? I rarely get new updates through the feed.)

  10. Anonymous

    on October 26, 2008 at 8:18 pm

    I once jumped on the first red block, and fell through and didn’t see the character again.

  11. Anonymous

    on October 26, 2008 at 8:20 pm

    im trying to make a platformer/rpg game and i want to make a slope without code being in the frame, i want it to be on a mc. Do you know how?

  12. woody harris

    on October 26, 2008 at 8:59 pm

    how did you learn as2/3 so well? i understand most of the code youve done like in that ball revamped clone but when you start to have to use math, tiles, shooting, etc i dont really know what to do and therefore cant make so many genres of games because of these limitations. my expertise is in java and though the language is nearly identical i cant grasp the game programmers mentality. any recommendations.

  13. Quarky Quantum

    on October 26, 2008 at 9:05 pm

    Great work on the tutorials,
    by the way I too have noticed your broken rss feed.

  14. Jon W

    on October 28, 2008 at 11:30 am

    I’m a long fan of yours and have seen this platformer engine. Its brilliant! And I’ve seen a lot of people asking for a level editor, so, I made one! Download it here:
    http://www.uploading.com/files/BGQFI3EC/editor.zip.html
    Hope you like it and happy building!
    Jon

  15. askovitch

    on November 3, 2008 at 11:57 am

    hi whens the next part coming out?? could you make exits and more levels prehaps?

  16. Goodbye AS2… : Emanuele Feronato

    on November 26, 2008 at 1:02 pm

    [...] you noticed, my last post about AS2 coding is New tile based platform engine – part 11 – slopes part b, almost a month [...]

  17. caboose

    on November 28, 2008 at 6:18 am

    what program are you using to make the scripts and tower deffence games?

  18. Chris

    on December 12, 2008 at 3:43 am

    for killing your guy on contact with enemy just paste this code under the enemy stuff (after: “else{ this.speed *= -1; }”:

    if (this.hitTest(level_container.hero._x, level_container.hero._y, true)) {
    place_player();
    }

  19. Chris

    on December 12, 2008 at 9:20 am

    For Scrolling use this code:
    if (Key.isDown(Key.LEFT)) {
    //scrolls screen
    _x += -xspeed*.6;
    xspeed -= speed;
    walking = true;

    }
    if (Key.isDown(Key.RIGHT)) {
    //scrolls screen
    _x -= xspeed*.6;
    xspeed += speed;
    walking = true;
    }

  20. Chris

    on December 12, 2008 at 9:52 pm

    Also you shoud add “_x = 0” under the place player

  21. Agadoijo

    on December 31, 2008 at 5:21 pm

    Great work on the tutorial!
    Do you plan to load levels from files? That would be great!
    Thanks for your help.

  22. Gravyerd

    on March 23, 2009 at 2:56 am

    please, next you need say:
    Lava + Scroll + Enemy Killer
    i find how to create coins :D and a number of coins xp

  23. Gravyerd

    on March 23, 2009 at 3:08 am

    and a question…
    how to use teleport?

    onClipEvent (enterFrame) {
    if (this.hitTest(_root.level_container.hero)) {
    // if this hits the char (_root.char)
    level_container.hero._y += 20;
    // _root.score goes up 1
    unloadMovie(this);
    // this movie clip is unloaded
    }
    }

    this is my try script (but don’t work)
    i put it in a mc already created… why don’t work?
    i make the code to coins and work

    onClipEvent (enterFrame) {
    if (this.hitTest(_root.level_container.hero)) {
    // This is the hit, and it work
    _root.score.text++;
    // to work
    unloadMovie(this);
    // anything work, but the teleport not work…
    }
    }

    but teleport not… please help me

  24. Gravyerd

    on March 25, 2009 at 2:38 am

    Only 1 problem why your game:
    You can’t put a preloader or anything before, is the code in first frame or is the code in first frame, if not in frame 1, do not work
    need a preloader, in the start the game start LOOOOOOW and stoping every 2 seconds… slow download, need download the game + images in the same time that the player are playing… please, need free the frame number, i can make 10 level, but is 1 over other and other, please fix this

  25. FatJoe

    on June 5, 2009 at 4:09 pm

    Gravyerd – put the preloader in a new scene, make sure the preloader scene is moved above the game scene ( shift + F2 ) should work..

  26. michael

    on September 22, 2009 at 4:41 am

    if i want to refer to the tiles or enemies at a different point in the code, say, a hittest, how would i do that?

    something like _root.blah.tile

  27. Luis

    on December 9, 2010 at 2:23 am

    Does anyone knows how to make the enemies fall from where they are? I mean if the moving enemies detect a 0 in the array they fall until they touch ground? any helP?

  28. Eric

    on March 14, 2012 at 5:28 am

    Any one know how to kill the enemy? I need help with this.. but I can figure it out myself with my poor programing skill..