How to program player to jump in Isometric

Pkirkby

Member
Hey everyone, I've been following a tutorial on an ARPG, I'd really like to implement a jump mechanic. Since it's a top-down style, jumping is a bit of a trick, and I'm pretty new to the program.

Has anyone been able to something like this? What kind of coding do you figure it would require?
 

Joe Ellis

Member
it really just needs the z axis, cus the x and y are the flat coords along the ground, so just add a z variable, and make the objects be drawn more upwards or downwards depending on the z, they will have the normal coordinates along the flat xy ground, and then the z coord is added on to this
 

ajan-ko

Member
Use your draw event while using yy=y-round(zaxis/10);

This just an example:
on draw event
Code:
var xx=x;
var yy=y-round(zaxis/10);
sprite_draw(sprite_index,image_index,xx,yy);
on step event
Code:
if jump_power=<0 and press_jump {
   //this is where you jump   
   jump_power=10;
}
zaxis -=2;//the zaxis always decrease because of gravity, yes it's flat gravity, if you want to make it smooth you must understand newton law, distance, speed and velocity.
if jump_power>0 {
    zaxis+=6;
    jump_power--; //jumping power
}
if zaxis<0 zaxis=0;
on create event
Code:
//declare variable
zaxis=0;
jump_power=0;
press_jump=0;
 
Top