Actor bounce

Non-platform specific questions.

Actor bounce

Postby XclusiveGames » Sun May 22, 2011 6:41 pm

Hi guys,can someone say me how to make an actor bounce up-and-down!_!
Masscreations.
XGames

Under Development
User avatar
XclusiveGames
 
Posts: 35
Joined: Fri Jan 21, 2011 3:30 pm
Score: 4 Give a positive score

Re: Actor bounce

Postby Game A Gogo » Sun May 22, 2011 7:06 pm

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:
untitled.PNG
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Actor bounce

Postby SuperSonic » Sun May 22, 2011 7:36 pm

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
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: Actor bounce

Postby XclusiveGames » Sun May 22, 2011 8:58 pm

I pasted ur code to my actors collision,but nothing happens
Masscreations.
XGames

Under Development
User avatar
XclusiveGames
 
Posts: 35
Joined: Fri Jan 21, 2011 3:30 pm
Score: 4 Give a positive score

Re: Actor bounce

Postby Game A Gogo » Mon May 23, 2011 1:02 am

Collision set to repeat?
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Actor bounce

Postby XclusiveGames » Mon May 23, 2011 5:16 am

Ah sorry it works but its too fast,how can i make the actors speed slow :)
Masscreations.
XGames

Under Development
User avatar
XclusiveGames
 
Posts: 35
Joined: Fri Jan 21, 2011 3:30 pm
Score: 4 Give a positive score

Re: Actor bounce

Postby Game A Gogo » Mon May 23, 2011 12:53 pm

You'll see somewhere in the code there are two "/2", simply increase that number to make it slower!
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest