Throwing multiple objects

MichaelEllerbeckMichaelEllerbeck USMember
edited March 2017 in Xamarin.iOS

So created a sprite extending SKSpriteNode, call it TestSprite

Override the touchesbegan to simply change the velocity

Add it to the GameScene and enable UserInteractionEnabled

So if I touch the sprite I can see it start moving. Great

Now I want to implement some 'throwing' I found this example.

http://stackoverflow.com/questions/28245653/how-to-throw-skspritenode

This works pretty well for one object, but I want to be able to throw lots of the same object.

I couldn't figure out how to get access to the touch point location from within TestSprite (or if I should even do it this way)

Maybe I should set a status flag on the TestSprite and then inside of the touchesBegan iterate to set the touching boolean?

And then inside the update function iterate through the TestSprite and only change the velocity of the flagged TestSprite?

I'm at a loss on how to approach this. Thanks for any thoughts!

Tagged:
Sign In or Register to comment.