Throwing with touch issue

wildj0kerwildj0ker Member Posts: 10
edited December 2011 in Working with GS (Mac)
Hello everyone, first let me say thank you to everybody for such a great resource you have here. I have been able to figure out almost all of my issues I have come across by reading forum questions, answers and watching the GS video tutorials. I honestly did not think I would get very far, but I am on my way to designing a solid platform game

I am having an issue with throwing an object with touch/mouse.

The throwing object works great at the start of the scene, but if the object is far away from the start location the object will fly back the second I click on it. The closest forum post I could find that relates to my issue is here http://gamesalad.com/forums/topic.php?id=22836.

-----------------------------------------------------------------
tenrdrmer
Sous Chef
yeah you need to use and offset when doing you touch positions. you basically add scene.camera.origin.x to game.mouseposition.x and they scene.camera.origin to game.mouseposition.y in all of the expressions for your touch rules.

----------------------------------------------------------

I am not understanding where you add "scene.camera.origin.x to game.mouseposition.x and scene.camera.origin to game.mouseposition.y I have followed TSB video to a T and thats pretty much where I am at.

If any one could point me in the right direction, I would be extremely grateful.

http://img.memecenter.com/uploaded/I-Have-No-Idea-What-Im-Doing_8ab0c971b93e5b46ff10f43addb58885.jpg

Comments

  • wildj0kerwildj0ker Member Posts: 10
    Thank you very much sir!
  • wildj0kerwildj0ker Member Posts: 10
    Working great now!
    If anyone has followed both videos here is what your formulas should look like on your throwable actor.

    Constrain Attribute
    self.motion.linear Velocity.x To: 10*(game.mouse.position.x - self.position.x + game.camx)

    Constrain Attribute
    self.motion.linear Velocity.y To: 10*(game.mouse.position.y - self.position.y + game.camy)

    Thanks again TSB!
Sign In or Register to comment.