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

  • Pedro

    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!!

  • Dude

    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)?

  • Thats pretty darned aweome.

  • Jeremi

    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.

  • AS3 Gamer

    Are you seriously coding in AS2 in 2008?

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

  • @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

  • jacko123

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

  • 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.)

  • Anonymous

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

  • Anonymous

    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?

  • woody harris

    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.

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

  • 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

  • askovitch

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

  • Pingback: Goodbye AS2… : Emanuele Feronato()

  • caboose

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

  • Chris

    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();
    }

  • Chris

    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;
    }

  • Chris

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

  • Agadoijo

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

  • Gravyerd

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

  • Gravyerd

    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

  • Gravyerd

    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

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

  • michael

    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

  • Luis

    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?

  • 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..

  • thom

    So… what’s the fix for the bounce glitch? I realize this is years old and I don’t see any more parts after this one. Thank you!