I'm creating a space-invaders-type game for a school project, and my code seems to lag whenever the aliens move. I tried using clones to create 20+ aliens easily, but Snap! seems to lag really badly whenever there are more than three clones on screen. Similarly, when I create multiple alien sprites, the game also lags very badly. Attached is my movement code for the alien sprites:
Here is set speed:
Here is alienfunction:
And here is set health:
The way the code is formatted is pretty weird, but my functions have to stay the way they are because of project requirements.