My friend yesterday posted a similar post, and I am suffering from a similar problem. I read somewhere that you should reduce your game lag by not playing animations too often. Now the way I have my enemy spawning is as follows....
I created a family and placed 5 different types of enemies within that family group. I have that every random 1,2 seconds a random enemy is selected and spawned. Could the game be running slow because of this. I tried previously having a single sprite and making 5 different animations within the sprite and coded that it should randomly select an animation to spawn but my game was still freezing.
I feel like the game is lagging a lot due to the constant enemy spawn every 1,2 seconds. But it is important in my game and I need it.
Any ideas? thank you!