Touch issue

EbreezeEbreeze Member, PRO Posts: 481
edited November -1 in Working with GS (Mac)
Hey Guys,

I've looked around and can't find any demos on this, any help is welcome!!

I have a basic space ship asteriods type game and am using touch to control the space ship.
( Touch is pressed accelerate)
It works fine but the only problem I have is that I have a fire laser button to destroy actors, and when pressing fire laser button the space ship accelerates toward the fire laser button because it is being touch also.

Is there any way to make the fire laser buttons touches not influence the space ships movement?

I have already tried the joystick and like this method better..less screen real estate, more user friendly.

thank you!!

Comments

  • osucowboy18osucowboy18 Member Posts: 1,307
    Hey Ebreeze

    I ran into a similar problem when working on my first ever iPhone app. What I ended up doing is setting up a rule stating that wherever touch is pressed on the screen, move the ship's Y position to that of the touch's Y position, and if your touching the ship, execute the "fire" function. This eliminates the need for the fire button. So basically, the user can move the ship by tapping on the location they want it to go, but if they are also tapping on the ship itself, it will continue moving to the touch's Y coordinate while firing lasers. Hope that makes since :)

    - Alex
  • EbreezeEbreeze Member, PRO Posts: 481
    thanks Alex! I may use that method.

    But Im just wondering how it would work with a multiple weapon system, like a button for laser1 and a button for laser 2. There is a helicopter game called Apache Overkill by miniclip.com which has multiple weapon buttons that i want to emulate and with no joystick either.

    any takes on this?

    thank you!
  • RumiRumi Member, PRO Posts: 343
    You could try having it so that when you shake the iPhone, the weapon changes. You could use the Accelerometer for it.
  • EbreezeEbreeze Member, PRO Posts: 481
    Thanks yeah Im using the Accelerometer and its working pretty good.
Sign In or Register to comment.