Help with some Gravity Code

Talk about making games.

Help with some Gravity Code

Postby nateobomb » Wed Apr 12, 2006 2:27 pm

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.
nateobomb
 
Posts: 2
Joined: Wed Apr 12, 2006 2:19 pm
Score: 0 Give a positive score

Postby Game A Gogo » Thu Apr 13, 2006 11:06 am

try using directional_velocity and Direction (or Angle, im not sure) insted of yvelocity and xvelocity.
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

Postby The achievement » Thu Apr 13, 2006 3:00 pm

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?
User avatar
The achievement
 
Posts: 220
Joined: Sun Feb 12, 2006 11:01 pm
Location: United States,Massachusetts
Score: 0 Give a positive score

Postby nateobomb » Thu Apr 13, 2006 5:26 pm

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.
nateobomb
 
Posts: 2
Joined: Wed Apr 12, 2006 2:19 pm
Score: 0 Give a positive score

Postby makslane » Thu Apr 13, 2006 9:24 pm

Set the initial velocity in a ´Create Actor´ event
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest