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
Rectanglechicken=newRectangle();
at the start of spawnChicken() method.
Reasons
If you keep chicken a member, it will be replaced every time spawnChicken() method is called.
Also, the same object is added to the array every time you try to spawn a chicken.
Share
Post a Comment
for "Controlling And Creating Multiple Sprites Array Java Libgdx"
Post a Comment for "Controlling And Creating Multiple Sprites Array Java Libgdx"