on key released -> touch version?

0 favourites
  • 2 posts
From the Asset Store
A simple Map Editor that where you can edit a map with restriction or totally. You can save and load the map created.
  • Hi guys,

    Remember my game? gameoftrolls.net23.net

    well, now I'm porting the game to tablets and I need to add the "virtual gamepad". So far I've already created the arrows using the "touch" object and 3 sprites. the problem now is with the 2 powers (the FAP gun and the ULTRA Scream)

    Currently I'm using two events:

    On F pressed -> do the things I need..

    On F released -> change again to normal mode

    The problem is that with Touch object I don't have a "on touch with the object finishes" and that's causing me a headache

    I'd like to create an event like

    "On F icon is being touched" -> Simulates key F being pressed

    "On F icon is not longer being touched" -> Simulates key F being released


  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • just invert the first test and use a variable to see if it was touch before !

    If "icon is touch"

    • > set var "IconWasTouched" to true
    • > simulate F press

    If "NOT" (invert the first test) "icon is touch" => YOU CAN USE A "ELSE" INSTEAD

    (and) "IconWasTouched" is true

    • > set var "IconWasTouched" to false (in fact tooglevalue)
    • > simulate F release

    (edit) If you have only 1 instance of the icon object you can create a instance variable in the icon object with the boolean type set to false by default.

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