Accuracy Calculation

Get help using Construct 2

Post » Mon Feb 27, 2012 3:44 pm

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
System.EveryTick
     ->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?

Thanks.
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Mon Feb 27, 2012 3:54 pm

Never mind was my fault :P
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Mon Feb 27, 2012 3:54 pm

figured it out, I can't count there was more than 300
B
29
S
12
G
7
Posts: 740
Reputation: 7,839


Return to How do I....?

Who is online

Users browsing this forum: Muini, plinkie, Yahoo [Bot] and 17 guests