Simulate key press?

0 favourites
  • 7 posts
From the Asset Store
Basketball Practice is HTML5 game written in construct 2 and 3 engine that simulates hooping.
  • Hello everybody! I have a problem the fact that the C2 not conditional "or". That is, I have a global code that checks whether the user pressed ESC and go back to the previous layout. But I need to insert a button that does this for the iPad type devices. If I had as a condicional "or" was simple but as there has ... I was wondering when you touch the button it simulate pressing the ESC and everything resolved, but the C2 has neither the OR nor an object with keyboard actions .... I do not want to repeat all the conditions. How to solve this?

    I hope you understood my question

    Thanks!

  • Vinians,

    For what it's worth, I just posted a conditional OR plugin here: OR Plugin

    There is also an example geared towards your issue, although it uses a mouse click instead of the touch mechanism.

    I hope this helps.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Nice nice! Its a cool plugin but can you make one with more or's ? Or one that we can combine and create more or's expressions. Thanks for reply!

  • Also you can have something like

    Global Variable goPrev = 0
    KeyBoard: On ESC pressed
        -> System: set goPrev to 1
    Touch: On Sprite touched
        -> System: set goPrev to 1
    System: goPrev equal 1
        -> System: go to previous layout
        -> System: set goPrev to 0

    goPrev would work as the "simulation" trigger you were mentionning

  • Nice nice! Its a cool plugin but can you make one with more or's ? Or one that we can combine and create more or's expressions. Thanks for reply!

    How many ORs would you need in one condition? There's no good way in the editor to add a random number of statements. I could expand the number of OR expressions to whatever you might need.

  • How many ORs would you need in one condition? There's no good way in the editor to add a random number of statements. I could expand the number of OR expressions to whatever you might need.

    Thanks dude! I solved the problem with use of Groups. Thanks a lot.

    Obs. Some ppls talk about Triggers, they are talking about Groups? Im using groups a lot to create someting like a function.

  • No problem. I'm not sure how useful this plug-in is anyway. It's kind of difficult to make it more dynamic.

    Regarding triggers versus groups, I always thought triggers were events that get triggered by some user action, i.e. a mouse click.

    A lot can be done with groups, but if it's functions you're after, have you taken a look at rexrainbow's function plug-in? It's pretty cool.

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