The Hard Part of my game.

InvertedSoftworksInvertedSoftworks Member Posts: 30
edited January 2012 in Working with GS (Mac)
Hi,

Being me i thought i had finished all my artwork but i had forgotten one key part... and that is the controls!
Anyways what i am trying to get at is how do i make an analog stick work? I know there is a template for it but i dot like working off a template because i like creating everything. So is there any tutorial on how to do it besides copying it from a template?

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I would at least take a look at the GS controller template to get an idea. The basic idea is that you have a small invisible non-movable touch actor for each of the device's touch sensors (5 on iphone 11 on iPad I believe). Then you constrain each one to one of the touch coordinates (i.e. have an actor called touch1 and constrain it to game.touch1.X and game.touch1.Y). Then in the joystick actor you check to see which actor it is overlapping with. If it is overlapping with actor1 then you know that you need to have the joystick constrain to touch1x and y (within a circle constrain of course). Then you just use the vectorToangle function to check the angle between the joystick and the starting joystick coordinates to get an angle. Use this angle in the actor you are controlling. As I said before - I would take a good look at the official GS template (and if you ask me I would say just go ahead and use it).
  • InvertedSoftworksInvertedSoftworks Member Posts: 30
    Thanks for the help. I have looked at the template and tried to grasp an idea and i still will be aha!
  • InvertedSoftworksInvertedSoftworks Member Posts: 30
    Actually is there a way to make touch based movement with out any form of control? like to just have the player use his/her finger to control the character, or is it harder than the analog?
Sign In or Register to comment.