Game Development Community

Pinball game problems

by Tom Feni · in Torque Game Builder · 07/25/2005 (3:20 pm) · 4 replies

Ok moved to here...
I am looking for help.. :)

my game is going ok but I am having trouble with the paddle collision.. so I was wondering if someone could take a look and see why the ball is going thru the paddle.. its basically popping under the paddle when it collides..

really odd..

link to the game..
Pinball Game

#1
07/25/2005 (3:22 pm)
The problem is your basicaly 'teleporting' your paddles to the new angle, not having them 'move'

function paddleLeft()
   {
   // Set the player moving up.
   $paddleLeft.setRotation(-35);
   $paddleLeft.setAngularVelocity(360);
   $paddleLeft.setAngularVelocity(0);


   }

setRotation instantly changes the angle of the object so that it's suddenly 'above' the current ball position, which then forces the ball to go down.

What you need to do is just use 'setAngularVelocity' or 'setAngularForce'. Unfortunatly T2D doesn't currently have rotation limits, so you'll need to create some objects that ONLY collide with the paddles to stop them at the maximum and minimum angles
#2
07/25/2005 (5:39 pm)
Well using his code I got it working.. but the paddles dont reset.. not a biggy but I am sure with a reset schedule I can fix it :)

otherwise it now works exactly how it should.. :)
#3
07/26/2005 (7:07 am)
Couldn't you use the key up event to trigger the paddle going back to its original loction?
#4
01/16/2011 (5:49 am)
### Link broken ###