How do I use the touch?

0 favourites
  • 7 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • I am creating a game where there is a character standing while some obstacles appear and run across the screen from left to right, until they disappear. The character must jump over these obstacles, but he must also be able to duck when necessary. Oh, I'm having difficulties, because I can't make a system where when I just press the character quickly jump and when I press for a few seconds he just lowers (change the frame).

  • There are different Touch events you can try. For example "On Tap gesture" - jump, "Oh hold gesture" - duck.

  • I am grateful for the speed in helping !!! I tried this method, however when using the standard construct command to keep it pressed it ends up that my player jumps only after a long time, I believe that 1 second or more and as the game is in the running style I would like to do something like: If I play and release for less than 1 second it jumps, if I touch and hold for more than a second it goes down. In that case I am currently unsolved.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Project file

    Handle with events.

    When the player is touching the screen (while playing), have a time counter.

    On "release", check the time counter value. If it is less than a specific time (short), have the character jump, otherwise, change the animation so it crouches.

    Use a timer behavior (or the On Animation Finished condition) to set back the position of the character to normal run.

  • Kyatric, thank you so much for taking the time to help me! The project you gave me as an example was of immense help and helped me a lot, but after testing I ended up seeing that it is not what I need, as I need the action to be taken while I am touching the screen and not just after releasing it. I managed to follow to a certain point, in this case it jumps normally if I play for less than 0.2 seconds, and lowers if I play for more than 0.2 seconds, but when I stop touching the screen the character ends up jumping, for a few hours that I try to solve, but to no avail.

  • This ?

  • Kyatric, that was exactly what I needed, coming home I will implement it! Very grateful for the great help, I was immensely grateful.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)