Original Post
Hey!
I have encountered a slight bug in my game code, and I want some suggestions on how to track down the cause...
I am loading in my level data from a text file with this format:
AMOUNT 12
asteroid 600 400
asteroid 1400 200
asteroid 1000 600
asteroid 1600 600
asteroid 1400 600
asteroid 1200 200
asteroid 1600 400
asteroid 400 200
asteroid 200 300
asteroid 400 600
asteroid 1100 300
asteroid 1500 300
...
where AMOUNT denotes that the total amount of entities for the level is beside that marker, and below that is the entity name and the x\y co-ordinates for each instance.
The problem that I am having is that my code does not seem to be rendering all of the entities in the file, after having loaded them into an STL vector. I am keeping track of the number of entities killed by the player, and I decrement that value each time an asteroid gets destroyed. But the number being rendered on screen, the amount\number specified in the text file, and the entity counter do not match up.
For example, I had 12 asteroids in the file to start off with, and after I killed them all, my entity counter was at 4... where did the other entities go???
-CodeMonkey
I have encountered a slight bug in my game code, and I want some suggestions on how to track down the cause...
I am loading in my level data from a text file with this format:
AMOUNT 12
asteroid 600 400
asteroid 1400 200
asteroid 1000 600
asteroid 1600 600
asteroid 1400 600
asteroid 1200 200
asteroid 1600 400
asteroid 400 200
asteroid 200 300
asteroid 400 600
asteroid 1100 300
asteroid 1500 300
...
where AMOUNT denotes that the total amount of entities for the level is beside that marker, and below that is the entity name and the x\y co-ordinates for each instance.
The problem that I am having is that my code does not seem to be rendering all of the entities in the file, after having loaded them into an STL vector. I am keeping track of the number of entities killed by the player, and I decrement that value each time an asteroid gets destroyed. But the number being rendered on screen, the amount\number specified in the text file, and the entity counter do not match up.
For example, I had 12 asteroids in the file to start off with, and after I killed them all, my entity counter was at 4... where did the other entities go???
-CodeMonkey