ForumsProgramming ForumTrying to make ramps and the such!

5 3975
Koshionos
offline
Koshionos
881 posts
Jester

i am trying to make ramps and my character go down
diagonal platforms but i don't know how i can the += y and x values zero to make them go sideways and make boundaries but have no idea on how to do the above! (phew), can anyone help me?

  • 5 Replies
PBMCube
offline
PBMCube
29 posts
Nomad

Here's a site that I use for this sort of thing. Please give him credit; he's bit over the top if you don't. Here's another site that may be useful. I use both of these site as my mentors.

John
offline
John
344 posts
Nomad

You can use a while loop to stay on top of terrain, using a shapeFlag and an object... for example...

onEnterFrame = function() {
while(terrain.hitTest(player._x,player._y,true)){
player._y -= 0.5;
}
}

Granted, this code is entirely simplified and not very efficient, it can give you an idea of how it may work.

PBMCube
offline
PBMCube
29 posts
Nomad

Using "onEnterFrame"???? Are you trying to intensionally sabotage this game????? Strong recommend all reading this to go to this site and learn from a proven expert. And don't forget to give him credit; he's a bit over the top when people lift code without credit!

Koshionos
offline
Koshionos
881 posts
Jester

hey just asking why does onEnterFrame a bad idea? i've never heard of a problem could you explain?

pengper
offline
pengper
9 posts
Nomad

lols @PBMCube are you saying John doesn't know what he's doing?!?! May just sit and laugh at that for a while, and then point you in the direction of John's extensive list of games he has SUCCESFULLY MADE and are now HUGELY POPULAR. jmtb02.com/games

Showing 1-5 of 5