Pinball game
by Tom Feni · in Torque Game Builder · 07/25/2005 (2:56 pm) · 3 replies
Ok I moved it but I was wondering why this one works..
www.garagegames.com/mg/forums/result.thread.php?qt=28578
his works perfect and the ball even moves with the collision.. :)
I tried using some of the code in mine but the paddle just flies around.. :)
www.garagegames.com/mg/forums/result.thread.php?qt=28578
his works perfect and the ball even moves with the collision.. :)
I tried using some of the code in mine but the paddle just flies around.. :)
About the author
#2
07/25/2005 (3:37 pm)
He's using a schedual that is called every 100ms to check the position of the paddles to make sure they don't go beyond certain angles, and only using 'setRotation' if the paddle goes beyond its limit. His input routines also just set special bits that the adjustPaddles checks to determine what direction they should be rotating in.
#3
I thought I delete this thread.. oh well..
the question got answered and now to post a demo :)
07/28/2005 (7:25 pm)
OopsI thought I delete this thread.. oh well..
the question got answered and now to post a demo :)
Torque Owner Joshua Spencer
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
BTW, this should probably be moved to 'T2D Scripting'