There is an awful lot of lag for what this scenario does. Are the asteroids the pass the left edge being removed from the world? How about the bullets that pass the right edge? Are you sounds saved staticly or recreated each time they are used? Can you re-upload with source code to acquire help along these lines?
A new version of this scenario was uploaded on Sat Aug 30 20:46:32 UTC 2014
I think the sound is recreated everytime i dont know how to save them staticly and everything that you can't see on screen is deleted i have code for that
I don't have any lag, but @Jepp, if you wanted to make the source code published, you need to check the bottom left box when you export/update the scenario.
danpost would you do me a favor and look this through and tell me what the reason is that the GameOver screen only comes when all lasers is gone? and maybe if you have some time tell me why it sometimes lags when i fire my lasers?
A few of things that could be improved on:
(1) you are calling 'MusicLoop' unnecessarily from the act method of the 'GameOverMusic' class and the 'AlienSpawner' class. It would be better to have them in their respective world classes as 'static final GreenfootSound' fields; and that you use the 'playLoop' method on them (so you do not need to check on the status of the sound every act -- they will loop automatically).
(2) all the code in the 'AlienSpawner' class should go in your 'testWorld' class. Adding an extra actor object into the world is not needed to perform those actions. They can be done in your 'textWorld' class act method and the 'AlienSpawner' class can therefore be eliminated.
(3) a Projectile object is NOT a Rocket object and therefore should not be subclassed as such.
(4) you could probably simplify the code in the Projectile class by just looking for an 'Enemy' object and use the 'instanceof' keyword to determine which type was found (if any).
(5) there is no need for your timer to show that precise a value. By only updating every, say, tenth of a second, you will save oodles on CPU usage.
and
(6) you are updating the image of your counter every act as well. It will only need updated when the score actually changes (only when a projectile hits an enemy object).
@JeppDev, of course. That why I put it up on the site. Just add the BGMusic class to your project as is (no changes need to be made to it). The image in the 'images' folder is meant to go along with the class. Add it to the 'images' folder of your project.
2014/8/30
2014/8/30
2014/8/30
2014/8/30
2014/8/30
2014/8/30
2014/8/30
2014/8/30
2014/8/30
2014/8/31
2014/8/31
2014/8/31
2014/8/31
2014/8/31
2014/8/31
2014/8/31
2014/12/10
2015/6/4