Paddle "game.mouse.position.X" problem!!!
Hi, I would like to ask you a question.
I would create a pong style game with two players, to move the paddle I used the command: max ((10 + (self.Size.Width / 2)), min ((310 - (self.Size.Width / 2)) , game.Mouse.Position.X))
The problem with using this command is that when I apply it to the second paddle touching the screen with two fingers, the paddle does not move. game.Mouse.Positio probably because it conflicts with the first paddle.
Can someone give me a solution?
I would create a pong style game with two players, to move the paddle I used the command: max ((10 + (self.Size.Width / 2)), min ((310 - (self.Size.Width / 2)) , game.Mouse.Position.X))
The problem with using this command is that when I apply it to the second paddle touching the screen with two fingers, the paddle does not move. game.Mouse.Positio probably because it conflicts with the first paddle.
Can someone give me a solution?
Comments
hopefully someone else will chime in soon, if not when im done with dinner ill mess around with it for you
In paddle One put:
Rule
-- When game.Touches.Touch 1.X < 240
---- Constrain Attribute: self.Position.Y To: game.Touches.Touch 1.Y
--Otherwise:
---- Constrain Attribute: self.Position.Y To: game.Touches.Touch 2.Y
Then in paddle Two put:
Rule
-- When game.Touches.Touch 1.X > 240
---- Constrain Attribute: self.Position.Y To: game.Touches.Touch 1.Y
--Otherwise:
---- Constrain Attribute: self.Position.Y To: game.Touches.Touch 2.Y
Hope this helps!
Please you may send me an example of how to do? I did not understand very well!!!
my email is 1upgamestudio2010@gmail.com
http://speedy.sh/k2atv/twoFingeredPong.zip
Hope this helps.
Is it what you were looking for?
RThurman
it would be just fine for what I do.
I can make another request? My pong is played with the screen vertically, how do I move the ball bounces properly taking into account that when the paddle has a different angle depending on where it touches on paddle?
For example breakout game!!!
Are you asking how to make the game play vertically?
Are you asking how to place both paddles on the 'bottom" (like breakout has a paddle on the bottom)?
Are you asking how to give the ball some forward spin and backward spin, based upon where it hits the paddle?
Are you asking how to give the ball spin based upon the paddle's speed (like the old breakout games).
I think you are really asking about the fourth question. But you are thinking in terms of the third question.
Maybe I'm wrong -- or my memory of the good old days is faulty, but I think the older versions of the breakout game gave backspin based upon paddle speed, not distance from the center of the paddle. (But either way, I hope these two hints help.)
Can you tell me how?
In the Ball actor, under the "Note" there is a Change Attribute behavior. Modify it to:
Change Attribute: Motion.Linear Velocity.Y To:self.Motion.Linear Velocity.Y +2*( self.Position.Y - game.Mouse.Position.Y )