HI, I finished making a game, it had no problem (decent framerate, objects behaved as expected, etc) but it turned out i was wrong....
On my crappy 1GB Ram tablet, the game crashes after playing for approximately 5 minutes, at first i thought it was just the custom rom I installed because it seems to not handle android apps too well. But when i ran the game on my PC and checked the task manager, the game kept increasing in memory usage again...and again..... especially when i was in the game scene which is arranged like this:
--- (same child as enemyspawner only inverted now)
--- (some child scenes)
-- (more child scenes but don't have effect)
When i removed the spawner nodes, the memory usage issue was gone and when i changed scene to the main menu, some memory even got freed.
But when I had the spawners (especially the enemy ones) the memory usage just kept increasing and even when i changed scene to the main menu, the memory doesn't get freed
The enemy_spawner instanciates the enemy scenes and when the timer for the specific enemy runs out, it gets spawned and moves continueously to the right (inverted is to the left) I took a look at my enemy scenes (all are area2d, some have kinematicbody2d) and had them get
queue_free() when it reaches certain cordinates but that did not make a difference, the memory usage still increases
I read this issue with the scene memory, indicating that i should free the previously used scene but i don't know how to implement that on my stage manager script (from angegastudio flappy bird)
const GAME = "res://src/main/game.tscn"
const MENU = "res://src/main/menu.tscn"
var is_changing = false
if is_changing: return
is_changing = true
# fade to black
# change stage
# fade from black
is_changing = false