trigger when out of bounds.

Non-platform specific questions.

trigger when out of bounds.

Postby shinobeofsand » Sat Jun 02, 2007 5:28 am

Since I'm making a simple version of pong I change the xvelocity and the yvelocity of the ball to have it move around. How can I set it up so that when the ball's edge (not the center) hits one of the edges of view it will reverse velocity?
shinobeofsand
 
Posts: 2
Joined: Sat Jun 02, 2007 12:58 am
Score: 0 Give a positive score

Postby Jay S. » Sat Jun 02, 2007 1:20 pm

You could set up Filled Regions where you want the ball not to go, then use a Collision > Physical Response event for the ball that when the ball collides with the Filled Regions, it would bounce off. (You could use the "Final velocity multiplier" to change how the ball collides with the walls. Just experiment with the settings until they are satisfactory.)

I'm not exactly sure what you want, so I'm hoping this has helped you. :(
User avatar
Jay S.
 
Posts: 118
Joined: Thu Apr 26, 2007 6:51 pm
Location: My computer desk. :P
Score: 9 Give a positive score

Postby d-soldier » Sat Jun 02, 2007 3:11 pm

You can not have it collide with the edges of view... Like Jay suggested, set up some filled regions around view. If you are using a sprite with any kind of transparency for the ball, GE will run all collisions based on contact with it's edges (sides).
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest