How to make character move by tapping

How could i make it so my character will move left when i touch the left side of the screen and right when i touch the right side of the screen?

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    When mouse button is down
    -- When mouse position X < [half the width of your scene]
    ----Move Left
    --Otherwise
    ----Move Right

  • jtohahn@gmail.comjtohahn@gmail.com Member, PRO Posts: 11
    edited December 2015

    when the mouse button is down AND the mouse position X<half? @Socks

  • SocksSocks London, UK.Member Posts: 12,822

    @jtohahn@gmail.com said:
    when the mouse button is down AND the mouse position X<half? @Socks

    Is this a question ? If it is it's not clear (to me at least) what the question is.

  • jtohahn@gmail.comjtohahn@gmail.com Member, PRO Posts: 11

    @Socks said:
    When mouse button is down
    -- When mouse position X < [half the width of your scene]
    ----Move Left
    --Otherwise
    ----Move Right

    can you send me a screenshot of what this looks like? And i only have if mouse is over actor for mouse position.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited December 2015

    Mouse position is an attribute. In a rule you'll see a drop down menu select attribute open the ... Button and select device.mouse.positionX. You should really watch some of the starting in gamesalad videos on the gamesalad academy.

  • jtohahn@gmail.comjtohahn@gmail.com Member, PRO Posts: 11

    @Lost_Oasis_Games still doesnt help. i dont see a drop down menu

  • SocksSocks London, UK.Member Posts: 12,822

    @jtohahn@gmail.com said:
    can you send me a screenshot of what this looks like?

    Not got GS at the moment unfortunately.

    @jtohahn@gmail.com said:
    And i only have if mouse is over actor for mouse position.

    Can you post a screen shot of this.

  • jtohahn@gmail.comjtohahn@gmail.com Member, PRO Posts: 11

  • jtohahn@gmail.comjtohahn@gmail.com Member, PRO Posts: 11
    edited December 2015

    can someone post a screenshot of how to do this?
    EDIT: nvm

  • jtohahn@gmail.comjtohahn@gmail.com Member, PRO Posts: 11

    how can i tell what half the width of the scene is

  • SocksSocks London, UK.Member Posts: 12,822
    edited December 2015

    @jtohahn@gmail.com said:

    You are only showing a tiny zoomed-in section of your rule, could we see the whole rule.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    You could also use large invisible buttons over each half of the screen if that is easier to understand. I have a button control tutorial below if you want to check it out. In this tutorial I use arrows as buttons, in your case you'd use just an actor with its alpha set to 0 so it is invisible.

  • jtohahn@gmail.comjtohahn@gmail.com Member, PRO Posts: 11

    @jamie_c that is exactly what i need. using mouse positions messed up some other features in my game

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    @jtohahn@gmail.com, awesome! Glad it works for you!

Sign In or Register to comment.