Drag And Drop Basic Movement Help

Discussion in 'Programming' started by jmorris, Apr 16, 2019.

  1. jmorris

    jmorris Member

    Joined:
    Apr 16, 2019
    Posts:
    2
    Hi there, I'm fairly new to GMS, and I'm having some trouble with getting my player object to reverse.
    The game is top down and the controls i had in mind are W forward, S reverse, A turn left, and D turn right.

    For reference:
    W is Key Pressed - Set Direction Variable - Direction : image_angle
    Set Speed - Direction : 5
    A is Key Pressed - Set Instance Rotation - Angle : 5
    D is Key Pressed - Set Instance Rotation - Angle : -5

    I set S to Set Direction Variable - Direction : -image_angle and the object flies off in a seemingly random direction, and the same thing happens if i use Reverse Direction. There's bound to be a simple answer to this simple issue, any help would be greatly appreciated. Thank you
     
  2. CloseRange

    CloseRange Member

    Joined:
    Jul 2, 2016
    Posts:
    682
    @jmorris
    did you try setting direction to image_angle + 180?
     
    jmorris likes this.
  3. jmorris

    jmorris Member

    Joined:
    Apr 16, 2019
    Posts:
    2
    You're a hero! I'd been waiting all day at work to try this out haha thank you very much for your help
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice