Pool Billard move. How to?
Hello.
Can anyone drop an idea hot to make a ball movement like in for example pool bilard games?
I have 5 attributes:
- position1X
- position1Y
- position2X
- position2Y
- touch
and rules like that:
When ball recive touch is pressed and touch is inside: constrain attrubute selfX to position1X and same for Y.
When ball recive touch is pressed: change attribute touch to true, otherwise false.
When ball touch is released, touch is outside and attribute touch is true: constrain attribute position2X to touch position x and the same for Y, and move (vector to angle (position1X-position2X, position1Y-position2Y)) and for the end interpolate motion linear velocity for X and Y to 0.
BUT ...
it doesn't work.
Can anyone help me please hot to repair and make it works?
Kind regards and many thanks
Can anyone drop an idea hot to make a ball movement like in for example pool bilard games?
I have 5 attributes:
- position1X
- position1Y
- position2X
- position2Y
- touch
and rules like that:
When ball recive touch is pressed and touch is inside: constrain attrubute selfX to position1X and same for Y.
When ball recive touch is pressed: change attribute touch to true, otherwise false.
When ball touch is released, touch is outside and attribute touch is true: constrain attribute position2X to touch position x and the same for Y, and move (vector to angle (position1X-position2X, position1Y-position2Y)) and for the end interpolate motion linear velocity for X and Y to 0.
BUT ...
it doesn't work.
Can anyone help me please hot to repair and make it works?
Kind regards and many thanks
Comments
I would recommend taking a look at tshirtbooths "hit the balls" template. However, I have a little pool demo I found on the "New" section of the GameSalad Creator.
Download Link: http://www.sendspace.com/file/8rccrv
Best of luck,
Henry Abrams
http://www.twitter.com/redskyent/
redsky@programmer.net
check on his website - www.gshelper.com under GS Templates.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Henry Abrams
http://www.twitter.com/redskyent/
redsky@programmer.net