My flash game begins smoothly but after merely seconds my CPU begins to choke as the program is taking up 99% of my CPU. I don’t understand what could be so taxing in a flash game that it would choke a beastly rig’s CPU in a matter of seconds! I mean, it takes a heck of a lot of calculations and such to bring down a system like this. And after a while, it will go back up to speed for a few more seconds but then bog down again and so on.
I am including the .swf for a playtest to see if others experience this and show what I am speaking of. You will also witness that when you lose (when you let 5 enemies infiltrate or you run your ammo down to zero) that not all of the enemies are removed from the screen and a few remain and walk across the screen still. These enemies are created dynamically and stored in an array and I go through the array and remove the clips when the player loses/wins. However not all are being removed, does this mean that enemies are being created but arent added to the array? In my EnemyController .as class, i even flag if the game is over and instruct all enemy clips to stop and then get removed if this is the case and not to fire the move code. This seems most bizarre to me, because they only will move if that class instructs them to do so.
Also, I’ve read that there is no way for Flash to write to simple text files… why? hehe. This frustrates me because I didn’t learn of this untill I had written a lot of code to handle levels and high scores through external files. Well since any new high scores can’t be written to the high score file, that becomes pretty useless.
If anyone has any immediate ideas just from viewing the game or just reading the problems, I thank you in advance for your help. If you wish to see some code because that would obviously aid you in the problem solving process, please let me know and i can supply what you want to see. Theres way too much code to just slap on here right now methinks =P.
Thanks again!
-Dylan
The Game:
<<RIT Site>>
Also, I notice that in places, the PunchLabel font does not work (where it is text and not a button?) but most noticeably the statistics labels in the actual gameplay like score and ammo. I thought that the fonts were automatically put in with the .swf files but apparently not. How do I make these show correctly using that font when most wont have it?