HELP !! CodeMonkeys Joystick and Image based on its direction

twpbknighttwpbknight Member Posts: 8
edited November -1 in Working with GS (Mac)
Tried for weeks now and can't get it. I have Codemonkeys joystick working fine but cant figure out how to change the characters image based on what direction he is moving. Anyone run into this that can help out :(

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Add rules where the conditions check for a range on the Rotation of the actor. Then put animate or change image behaviors based on those conditions being true.

    e.g. Rule: If self.Rotation > 0 AND self.Rotation <= 45, change image to ...
  • twpbknighttwpbknight Member Posts: 8
    Awesome I will do this tonight :) thanks a bunch
  • twpbknighttwpbknight Member Posts: 8
    Greetings again Mr.CodeMonkey. So as they say with success comes failure :) well i was able to get the image to change based on angle but ran into a issue i didn't expect. Here is a link to youtube on what its doing so u can see it first hand. So clearly i dont want it to rotate like that XD you have any idea why its doing this. Thanks again
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Ah. Instead of the self.Rotation use the game Rotation value that the stick is constrained to. self.Rotation should remain 0 and not constrained to anything.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    I believe the game attribute you will actually be looking for is game.angle unless you have changed the demo's original attributes.
  • twpbknighttwpbknight Member Posts: 8
    Well with the exception of the down attribute which is setup as
    attribute game.angle > 242 AND attribute game.angle < 292
    which currently doesnt want to change pics
    i have all the other angles working correctly now. Thanks to both of you for the help. CODEMONKEY U R PRO :D
    now to figure out the down one
  • twpbknighttwpbknight Member Posts: 8
    Got it working on all angles. Looks like when i setup the attribute for Angle i set it up as REAL instead of ANGLE. Thanks again for all the help
Sign In or Register to comment.