Code:
if gravTrue == true
{
if vsp < vsp_max {vsp += grav;}
}
var _col = noone;
_col = collision_circle(x,y,sprite_width,oSolid,true,true);
if _col
{
var _curSpd = sqrt(sqr(hsp)+sqr(vsp));
var _nAng = point_direction(_col.x,_col.y,x,y);
hsp = dcos(_nAng)*_curSpd;
vsp = -dsin(_nAng)*_curSpd;
}
x+=hsp; y+=vsp;
0 comments