Controlling And Creating Multiple Sprites Array Java Libgdx
I am trying to create a game which has sprites and every second another is spawned, i tried using this as a base: https://github.com/libgdx/libgdx/wiki/A-simple-game However when
Solution 1:
Put
Rectangle chicken = new Rectangle();
at the start of spawnChicken()
method.
Reasons
- If you keep
chicken
a member, it will be replaced every timespawnChicken()
method is called. - Also, the same object is added to the array every time you try to spawn a chicken.
Post a Comment for "Controlling And Creating Multiple Sprites Array Java Libgdx"