Touch Help

0 favourites
  • 13 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hey Guys,

    So lets say I have a plane and I want it to show it in the up position on the first tap, and the next tap it would be on the lower position.

    When I try to set a variable to enable one or the other I can't get it to play nice.

    If you have any suggestions or examples it would be greatly appreciated!

    Thanks,

    ~ Chase

  • Make a numeric variable and set it to 0.

    Make an event that says on touch (or whatever you want) set variable to 1-variable.

    Make another event that says if variable = 0 set plane position to top

    else set plane position to bottom

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I tried that prior but I think I must be coding it improperly. Thanks for the reply it verifies my theory

  • I have

    Global Variable PlaneHeight = 1

    Touch | On tap gesture | Arrow | Set animation frame to 1

    System | PlaneHeight = 0 | System | Set PlaneHeight to 1

    Touch | On tap gesture | Arrow | Set animation frame to 0

    System | PlaneHeight = 1 | System | Set PlaneHeight to 0

    This isn't working, where am I going wrong :/

  • If the image point is the same in both frames the image will change but the sprite will stay at that same X and Y coordinate.

    Are you trying to do a flappy bird type game?

    If so there is a good flappy bird demo in the C2 demos included with C2.

  • no, not another flappy bird game. Basically the image will get bigger then tap again making it smaller. It seems to only work once and then fails.

  • try using sub event to check variable

  • I will give that a try, thanks Lord, lol. God Bless, lol.

  • chimchase may Lord Shiva bless you & your loved ones

  • I still can't seem to get it, is there somebody that could possibly send / create an example?

  • Set Global Variable TAPPED=0

    On Tap On Object Planesprite............................... Set Planesprite animation "UP"

    TAPPED =0.......................................................................Set TAPPED =1

    On Tap On Object Planesprite............................... Set Planesprite animation "DOWN"

    TAPPED=1........................................................................Set TAPPED=0

    If you are tapping very quickly as in a tap game or flappy game this may not work without a slight pause to give screen tap time to read next tap so add in a WAIT 0.3 Seconds at end of each event.

  • chimchase OK I WILL SEND YOU LINK SOON WITH CAPX

  • chimchase here is CAPX link below file name touch

    https://www.scirra.com/tutorials/9428/construct-2-capx

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