less of a how, more of a why...

0 favourites
  • 7 posts
From the Asset Store
The game will give you a dog that appeared and you must say if he appeared more, less or equal.
  • When I click any of the upgrade buttons for the first time, nothing happens. But then it works just fine after that, can anyone tell my why the first click doesn't work? The events handling it are in the "upgrade menu" group.

  • What version of C2 are you using?

    Edit: seems to work ok in 175b. Also do you need the 'touch start/touch end' mechanism? I think you can just use 'Touch: On tap gesture on upgradeButton'

  • The code is being called, but I think only you can understand what's going on. You can use the Browser object to Log state, or use the debugger to inspect the data changes.

  • What version of C2 are you using?

    Edit: seems to work ok in 175b. Also do you need the 'touch start/touch end' mechanism? I think you can just use 'Touch: On tap gesture on upgradeButton'

    kinda new to using touch but I'll try that, the upgrades work on the first click for you? I'm on 173

  • The code is being called, but I think only you can understand what's going on. You can use the Browser object to Log state, or use the debugger to inspect the data changes.

    I know the code is being called that's why I had the test text there, but no variables get changed for me on the first click

  • > What version of C2 are you using?

    >

    > Edit: seems to work ok in 175b. Also do you need the 'touch start/touch end' mechanism? I think you can just use 'Touch: On tap gesture on upgradeButton'

    >

    kinda new to using touch but I'll try that, the upgrades work on the first click for you? I'm on 173

    Yes you could simplify it by using tap gestures. However, your event is updating Variable1 twice in quick succession, and the second time it is always 0. I added some logging that shows that.

    e.g.

    <first tap of first button>

    Variable1: 5

    Variable1: 0

    <first tap of second button>

    Variable1: 1

    Variable1: 0

    <first tap of third button>

    Variable1: 150

    Variable1: 0

    Check your logic

    Edit: when I said it seems to 'work fine' I meant the first click is registering, but you knew that.

    Edit 2: highly recommend using Browser plugin logging

  • Try Construct 3

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

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

    ah i didnt think about looking at the variable1, its really wierd sometimes it shows 100x the value, and i guess the problem was something that i had already run into, it doesnt like doing math with arrays

    that fixed it, and now that i know that was the problem could probly go back to using only 1 var

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