self.SnapTo

IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
edited November -1 in Working with GS (Mac)
Hello, I was learning joystick control from support page, and I don't have self.SnapTo attribute. Could you please tell me where it is, or where to get it?

Thank you.

Comments

  • IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
    It helped :-) Thank you very much.
    I have one more question. I made everything from this tutorial http://gamesalad.com/wiki/how_tos:gsc_controls#positionx except of this:
    What to do now

    Now that you have your controls working, to be able to use this you just need to use the data of this actor for use in other actors. i.e. the angle and the distance from the center.

    You can get the ANGLE from the center of the thumbstick base using: vectorToAngle(self.Position.X - game.BaseX , self.Position.Y - game.BaseY)

    You can get the DISTANCE from the center of the thumbstick base using: magnitude(self.Position.X - game.BaseX ,self.Position.Y - game.BaseY))

    With the distance you can even control speed of something by dividing the distance by the baseRadius, which will give you a real number between 0 and 1.

    I'm afraid, I don't understand what to do, to make my actor move, when I will move my joystick.

    Thank you for your time and help.
  • IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
    I'm a noob, and I don't have any idea, where to put it :-) I have GameSalad since yesterday.
Sign In or Register to comment.