difference between 2 numbers (not distance)

  • hi im having trouble finding the logic for finding the difference between to value, anyone able to help??

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • System >> compare two values then use logical comparison there (equal to, not equal, less than, etc.).

  • there is no difference option there. ill explain better.

    the user collects xp and is stored in xp "xpplayer" variable

    is then added to "xptotal" total variable

    if the user "xpplayer" variable exceeds the "xptotal" variable then

    the player levels up and the "xptotal" variable is reset to 0 and whatever is left from

    the xpplayer" variable get added to "xptotal" so they can get xp to level up again

    hope this helps

  • Yes, there is a 'not equal to' option in 'system > condition > Compare two values'. But that is not what you need.

    System > Every Tick

    Sub EventS ... Local variable 'Exceed' = 0

    ........................System > Compare two values ... First = Player.xpplayer ... Comparisation = '> is greater then' ... second = xptotal

    ....................................ActionS: Set 'Exceed' to xptotal - Player.xpplayer

    .................................................Set xptotal to zero

    .................................................Set Player.xpplayer to 'Exceed'

    .................................................Level up

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