Calculation not quick enough?

1 favourites
  • 4 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Hi

    I have an interesting problem that I cannot solve.

    I have a calculation that should trigger when the calculation is met. However, it does not happen every time (because too many things at one time?). The calculation works for sure, it's just that it doesn't always trigger.

    Essentially, when var:jewels hits a particular number, I then run a function.

    However, I collect jewels very fast in some parts of the game, so I think that the calculation does not happen fast enough to be triggered.

    e.g. I have 19 jewels, but I collect 3 at the same time, taking me to 21, which means the trigger at 20 jewels is missed.

    Do you have a suggestion on how to make sure I definitely hit the trigger?

    You can see a gif here showing that i collect jewels very close together sometimes. This amount can be hundreds at once.

    https://i.imgur.com/rK2ASId.gif

  • you can set less than or equal, so when you exceed the value, it will work and activate the event, if you are setting a goal and when this goal is subtracted from the current value of jewels

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If there are no parent conditions in your event, this means it runs on every tick. And in that case you are right, if you collect 3 jewels in one tick, it will not work correctly.

    You need to move it into "Player on collision with Jewel" event. Then it will be calculated for every jewel instance.

  • You need to move it into "Player on collision with Jewel" event. Then it will be calculated for every jewel instance.

    dop2000 I could not love you any more than I do right now. You are once again the saviour of this forum. Thank you so much for your help. Also thank you to Snakegbr for your input.

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