|
Hi, I am making a 4 player pong game, and I want the ball to increase speed every 10 seconds. heres the code i have so far, im just not sure what to add to it to achieve this.
(comments are locked)
|
|
If you're having issue with the time, set up a time variable and add ten seconds to it. Whenever Time.time is greater than your time variable, increase the velocity by whatever and reset your time variable by 10 seconds. That or do an ienumerator function. If you're having issue with adding force I'd create a speed variable and use that to drive the movement. Someone else can probably give you more exact instructions for that.
(comments are locked)
|
|
Instead of doing that super-convoluted thing there, why not just use something like this? This will add force based on the current velocity of the object. Otherwise, just rely on the physics engine for collisions and reflections. by "super-convoluted" do u mean the code under function Update?
Mar 08 '12 at 10:04 AM
Orggrim
No, I mean all of it. The code you are using to increase the speed of the ball is overcomplicated and error-prone.
Mar 28 '12 at 12:10 AM
syclamoth
(comments are locked)
|

well instead of just using numbers i would create speed variables and have those add up over time.