Page 1 of 1

Help with some Gravity Code

PostPosted: Wed Apr 12, 2006 2:27 pm
by nateobomb
Here is what i am doing. I have setup 4 actors around the screen to act as invisible walls. I have one actor in the box and have setup physical response collisions with all 4 walls. I want this to react in a way that it is going fast (around 10 to 20) as it is created, but from than on just react to the settings i put in the physical response. so that its like your looking down on a box and you throw a marble in. I am having a problem programming the yvelocity and xvelocity so that it has an initial speed of 10 but than it can slow down or speed up based solely on the reactions to walls and other actors. Also in the future i want the x and y velocity's to at least "appear" random.

PostPosted: Thu Apr 13, 2006 11:06 am
by Game A Gogo
try using directional_velocity and Direction (or Angle, im not sure) insted of yvelocity and xvelocity.

PostPosted: Thu Apr 13, 2006 3:00 pm
by The achievement
do you mean that if your actor hits a specific wall, lets say wall number one



you want your actor to bounce off it at a higher speed, is that what your saying?

PostPosted: Thu Apr 13, 2006 5:26 pm
by nateobomb
The achievement wrote:do you mean that if your actor hits a specific wall, lets say wall number one



you want your actor to bounce off it at a higher speed, is that what your saying?


No, i know how to change the physical response of the walls. What was happening is that i would set an initial xvelocity speed, but it would never change, in fact it would increase. I was trying to make some IF statement that would only set xvelocity the first time it was drawn...but could not figure out the logice. I will try the directional velocity..thanks.

PostPosted: Thu Apr 13, 2006 9:24 pm
by makslane
Set the initial velocity in a ´Create Actor´ event