Question - Code Is there a way to emulate gesture?

Discussion in 'GameMaker Studio 2 Community Tech Support' started by Dawn, Sep 20, 2019.

  1. Dawn

    Dawn Member

    Sep 5, 2016
    I'm coding controls using gesture events but I also want to use keyboard keys or gamepad buttons for easier cross-platform controls. Is there a way to do this or should I do something like event_perform to force a gesture event in a step event?
  2. Kawai_Oppai

    Kawai_Oppai Member

    Sep 26, 2019
    I usually try to keep actions universal.

    meaning for code, lets say a player can move left right and jump.

    Each control has a state, true or false. I might have
    var jump;

    in my actual movement code I would be check if var jump is true.

    and I could then create a script that detects the gesture, keypress, or other input that I want to represent jump. if any desired input is utilized, jump is true. Movement code looks at JUMP rather than input, so remains functional and universal.

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