shoot towards touch

MERMMERM Member Posts: 194
edited November -1 in Working with GS (Mac)
ok so i have been doing other games and they just ain't workin so i decided to do something a little more basic than what i was doing bfore. so now, i have a ninja actor that rotates to where u r touching. there is a shooting button in the corner that shoots guitar picks from the ninja (the theme is a pixelated punk rock star ninja defending his karma from the fruits and evil samauris that r trying to steal it). for some reason it just shoots one and only towards the button that u press. any help?

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    This is actually going to be harder than you think. What's happening is that as soon as you touch the fire button you also are changing touch.1.x and touch1.y to the coordinates of the fire button. You say in your post that you are trying to do something little easier. Well this isn't it! Here's how to get it working the way you want it. Use codemonkey's joystick demo to get multitouch working. Then you need to check if the fire button is overlapping with touch1 or touch2. If it is overlapping with touch1 you'll need to set up rules to get it to fire to touch2. If it is overlapping with touch2 then have it fire at touch1. If your new to GS this may be hard for you.

    Here's some other ways of doing it that will be easier.

    1) Have your ninja always spawning guitar picks and just constrain the ninja's rotation as you have already done. Then in the spawn have the picks spawned 0 relative to actor. In the pick have a change velocity relative to actor.

    2) Have a rule that causes the pick to be spawned when touch is released. If you are only playing with one finger then when the touch is released the touch1x and y coordinates will be set to the last place you touched until you touch again.
  • MERMMERM Member Posts: 194
    k i will try. :)

    peace and beans, peace and beans.
  • MERMMERM Member Posts: 194
    hmm... seems like the links for the tutorial are all broken.... any other help?
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    MERM said:
    hmm... seems like the links for the tutorial are all broken.... any other help?

    You need to get demos through the GS creator start screen. Open GS Creator, click new, type joystick in the search box.
  • mattyr64mattyr64 Member Posts: 82
    this is quite simple, if your button is like at the bottom of the screen out of the way of the 'play area'. just make a rule that says, if Touch Y is greater than a number that is above where your button/control graphics end.
Sign In or Register to comment.