Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
430 B
0
Indexable
Never
#event create

Speed = 20;
Gravity = 0.75;
Resistance = 0.01;
Direction = 45;//point_direction( x, y, mouse_x, mouse_y); //this variable has to change when I shoot for the other side
HSpeed = dcos( -Direction) * Speed;
VSpeed = dsin( -Direction) * Speed;

#event step

if( abs( HSpeed) < Resistance){
    HSpeed = 0;
}else{
    HSpeed -= sign( HSpeed) * Resistance;
}
x += HSpeed;
VSpeed += Gravity;
y += VSpeed;