GML Dashing in the Air

S

Shaddy

Guest
Heyo,

I am making a Platformer Shooting thingy, and i was implimenting a mid air Dash when, during the test, it always dashed into the opposite direction... heres the Code for it, I have no clue why it is working the way it is...

Code:
//hmove= key_right-key_left;
hsp= hsp*dash_distance

//x=hsp+x
dash_distance=20
vsp=0
dash_timer--
dash_limit=0
if(place_meeting(x+hsp,y,obj_wall))
{
    dash_distance=0;
    key_jump=0;
    hsp=0
}
//else dash_distance=20
// dash on the ground
if(dash_timer<0) && (!place_meeting(x,y+vsp,obj_wall)) state=PLAYERSTATE.FALLING
 

Bentley

Member
Without diving into your code, make sure you base the dash's hspd in direction you're facing (1 or -1, right or left)
Ex:
Code:
// Enter dash state
if (key_something)
{
    hspd = face * dash_speed;
}
 
Top