toggle menu
Categories
Discussions
Dashboard
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Dashboard
Sign In
·
Register
×
Home
›
GameSalad 101
›
Working with GS (Mac)
Bounce without collide rule
VGX
Member
Posts:
796
July 2011
edited November -1
in
Working with GS (Mac)
How do you make a ball bounce left and right, up and down, etc.. without using collide?
Comments
old_kipper
Member
Posts:
1,420
July 2011
using interpolate to change the position with the ease in and out used to slow and accelerate the ball will give the effect. As the ball bounces up it slows so use the ease in and as is accelerates from the fall use ease out.
hope that helps.
kipper
RThurman
Member, Sous Chef, PRO
Posts:
2,881
July 2011
You could change an objects x velocity attribute by multiplying it by -1. (Same with y velocity.)
When an actor hits a left or right wall:
change attribute: (self.Motion.Linear Velocity.X) to: (-1*self.Motion.Linear Velocity.X)
When actor hits a top or bottom wall:
change attribute: (self.Motion.Linear Velocity.Y) to: (-1*self.Motion.Linear Velocity.Y)
Give an object some initial velocity and this will get it bouncing off of the sides like an old-school pong game.
Sign In
or
Register
to comment.
Comments
hope that helps.
kipper
When an actor hits a left or right wall:
change attribute: (self.Motion.Linear Velocity.X) to: (-1*self.Motion.Linear Velocity.X)
When actor hits a top or bottom wall:
change attribute: (self.Motion.Linear Velocity.Y) to: (-1*self.Motion.Linear Velocity.Y)
Give an object some initial velocity and this will get it bouncing off of the sides like an old-school pong game.