Enemy AI Jump

P

Peemtin123

Guest
Hi everyone, i'm trying to get my AI jump from platform to platform. I can get it to jump pretty easily but I can't get it to come down. The only way I've found to get it to come down is with a timer but that is an unusual method and I can't guarantee every jump with that I just haven't found any other way to try that even comes close to what I need. I would like the enemy to be able to detect when there is the end of a ledge and jump to the next.



Step Event:
Code:
//Jumps For Obstacles
if !place_free(x+64,y)
{
vsp = -4;
}
//Jumps When There Is No Floor
if !place_meeting (x,y+1,obj_floor)
{
testtime -= 1
}

//Maintains The Jump
if testtime < 10 && testtime > 0
{
//vsp = -4;
}
//Resets The Jump Timer
if place_meeting (x,y+1,obj_floor) testtime = 10
 

M. Idrees

Member
And your enemy will jump continuously if there is no floor.
you have to check for
if !place_meeting (x+16,y+1,obj_floor)
 
Top