Query using vector to angle on a rotating flipper

MegaemmanMegaemman Member, PRO Posts: 72
edited May 2013 in Working with GS (Mac)
Using this I was wondering if it was possible to have a ball fling off a rotating flipper (teeter-totter) paddle o was wondering if flipper x and flipper y needs to be put inside the flipper

I have three real attributes

Flipper-Angullar velocity
Flipper x and flipper y (maybe it should be self.position.x and selfposition y for the flippers ?

contstrain attribute: game.Flipper_Angular_Velocity to self.angularvelocity

In the Ball

RULE
When ball collides with actor FLIPPER Attribute self.angularvelocity is >100

Accelerate behavoir

Direction: vectortoangle (self.positionX - game.flipperX,self.positionY - game.flipperY)

Speed: game.Flipper_Angular_Velocity


Or would it be easier to just leave the ball alone and get the paddle to rotate fast enough to get the ball to accelerate at the desired position ?

Perhaps it's not acceleration maybe it's change velocity

I'll continue to tinker


Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Vector to angle will give a more accurate trajectory. When I do something like this I tend you prefer using scene linking of actor X and Y positions as this is faster than going through external attributes. But since it's the ball that is moving along the vector then the function belongs in the balls movement behavior. If you are going to use game attributes to track the paddle position then those constrain attributes need to be in the paddle and constrain game.paddle.x to self.position.x
  • LumpAppsLumpApps Member Posts: 2,881
    I am not sure if this correct English but shouldn't the direction the ball goes to after being hit be the opposite of the one on impact. Correct me if I am wrong but I do not see that in this formula.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    @ludwigheijden I was hoping you would comment on this thread as you did a similar thing in your game. Maybe you could post you're formula for how you did it!
  • MegaemmanMegaemman Member, PRO Posts: 72
    I am not sure if this correct English but shouldn't the direction the ball goes to after being hit be the opposite of the one on impact. Correct me if I am wrong but I do not see that in this formula.
    @ludwigheijden yes please explain and post the equation if you don't mind or you can send via email e-mman2008@Hotmail.com
  • MegaemmanMegaemman Member, PRO Posts: 72
    edited May 2013
    Cause the force from the paddle should change the velocity of the ball so the ball should have a velocity and acceleration behavior in order to move based on the speed and angle of the flipper .....right? And speed or acceleration of the ball should be based of the angularvelocity/ momentum of the paddle
Sign In or Register to comment.