This site requires JavaScript, please enable it in your browser!
Greenfoot back
Wiwhyweirdo
Wiwhyweirdo wrote ...

2023/2/1

Laggy Greenfoot

Wiwhyweirdo Wiwhyweirdo

2023/2/1

#
Hi people of the internet, I made a custom space invaders game. It works fine but the game becomes laggier the more I play it. Is it bc of my crappy Laptop or is it bc of the code. Also sorry for my incredible inconsistency at spelling words.
Wiwhyweirdo Wiwhyweirdo

2023/2/1

#
After some more testing I have noticed that whenever I receive damage the game speeds up at gets less laggy. Do what you want with this Information .
danpost danpost

2023/2/2

#
Wiwhyweirdo wrote...
After some more testing I have noticed that whenever I receive damage the game speeds up at gets less laggy. Do what you want with this Information .
You might be doing something with images that is causing the lag issue. Make sure you pre-load your images. Make sure you always reference those pre-loaded images when setting an image. Keep your world at a reasonable size. I stick to not much more than (900, 600) world size (depending on the scenario). If using an unbounded world, make sure all actors are removed from the world after they leave the viewport (at least, those that should be removed). As with images, sound files should be pre-loaded. -- best during world construction. (at least, the current background music file).
You need to login to post a reply.