0+1=8?

Blitz3D Forums/Blitz3D Beginners Area/0+1=8?

grindalf(Posted 2010) [#1]
For some reason when I pickup my coin it adds 8 coins on.
Ive tried doing various modifications to this including deleting the type but it ALWAYS adds 8 coins on instead of 1

when I do the CCoins=CCoins+1 I change the item/hp to 0 and it shouldent be able to enter that section of code again then :(

Also I have checked my code and there is no other points where item/hp is used apart from where the level loads and the only other point ccoins is used is when i draw the amount of coins the player has to the screen.




grindalf(Posted 2010) [#2]
Fixed, it was 8 coins over the top of each other.
I guess my level editor needs some work lol


stanrol(Posted 2010) [#3]
avoid indentation.


grindalf(Posted 2010) [#4]
You want me to keep the code flat? why on earth would I want to do that?
wouldn't that make it harder to see my loops and stuff?


Nate the Great(Posted 2010) [#5]
that is the sr guy... he has been spamming the forums with random junk like that, just check out his worklogs...


D4NM4N(Posted 2010) [#6]
Do you have 8 items by any chance?

Stick:

debuglog CCoins : stop

after the coin increment and then trace through on the debugger. You can do this by looking at the debuglog tab and clicking start each time it hits stop.

Check to make sure your logic around coin increment is only firing once in that master loop.