Accuracy Calculation

0 favourites
  • 3 posts
  • Hi guys.

    I have a small little prototype for a client. Its basically virtual bubble wrap that you pop with your mouse, So I need to calculate the percentage of bubble's popped.

    I know there is 300 bubbles, So I have a variable called Total_Bubble's.

    I also have a variable called Total_Popped.

    I have a instance Boolean on the bubble to determine weather it has been popped or not.

    Then when clicked Bubble is clicked, if popped = false, set frame to 1, set popped to true and add 1 to total popped.

    Everything is right so far is it not?

    So then to calculate the percentage im doing this:

    I have a variable called Percentage


         ->Total_Popped * 100/Total_Bubbles

    But I get something like 112% popped when thats not correct.

    Is it something im doing wrong? Do i need to round the number?


  • Never mind was my fault :P

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • figured it out, I can't count there was more than 300

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