Well i was trying to learn how to work with arrays and used this concept on tile mapping.
Things i have done
Added array with 11X11 size
on Layout width 352 and height 352
for each xy element system will spawn sprite2 with default frame as green
if and array xy element has value 1 then sprite2 will turn frame to violet
and when "E" is pressed sprite2 which has frames as violet will spawn sprite 3 (orange)
but as i run the layout after each second the fps drops off and on debug mode the object count goes to 40 thousand and more.
for more reference see the image
https://www.dropbox.com/s/rxbf31psvkws4ve/Debugmode.PNG
https://www.dropbox.com/s/uqk64jamrgukh ... eCount.PNG
https://www.dropbox.com/s/bse8az9uyi55b ... 0value.PNG
https://www.dropbox.com/s/iyvsbmae49z61 ... 0Tiles.PNG
What actually i am trying to do!
Some array have value as 1 and i want system to spawn sprite3 on those array XY positions.
It should suppose to spawn one object! I am not sure what did i do wrong as i am not a programmer and this is my first encounter with fps fall and high cpu consumption!