Page 1 of 1
Actor bounce
Posted:
Sun May 22, 2011 6:41 pm
by XclusiveGames
Hi guys,can someone say me how to make an actor bounce up-and-down!_!
Re: Actor bounce
Posted:
Sun May 22, 2011 7:06 pm
by Game A Gogo
for ball-like collision between actors use this script on collision:
- Code: Select all
xvelocity += collide.directional_velocity/2*cos(2*PI*((360-(180+direction(x,y,collide.x,collide.y))/360)));
yvelocity += collide.directional_velocity/2*sin(2*PI*((360-(180+direction(x,y,collide.x,collide.y))/360)));
otherwise you can use Physical respond with these settings:
Re: Actor bounce
Posted:
Sun May 22, 2011 7:36 pm
by SuperSonic
Game A Gogo wrote:- Code: Select all
xvelocity += collide.directional_velocity/2*cos(2*PI*((360-(180+direction(x,y,collide.x,collide.y))/360)));
yvelocity += collide.directional_velocity/2*sin(2*PI*((360-(180+direction(x,y,collide.x,collide.y))/360)));
And I thought
my math was intense XD
Re: Actor bounce
Posted:
Sun May 22, 2011 8:58 pm
by XclusiveGames
I pasted ur code to my actors collision,but nothing happens
Re: Actor bounce
Posted:
Mon May 23, 2011 1:02 am
by Game A Gogo
Collision set to repeat?
Re: Actor bounce
Posted:
Mon May 23, 2011 5:16 am
by XclusiveGames
Ah sorry it works but its too fast,how can i make the actors speed slow
Re: Actor bounce
Posted:
Mon May 23, 2011 12:53 pm
by Game A Gogo
You'll see somewhere in the code there are two "/2", simply increase that number to make it slower!