I have a little problem with my game. Movement in my game is basiclly scrolling the background location.X -5 px. Floor is reseting it's X, so it i won't run to the end. Boxes (barriers) are spawning randomly on floor. Everything is working fine, but I want to stop this mechanism as soon as player dies. How can i do it? I tried it in different methods, I was able to stop the spawning and floor, but boxes that were already spawn, are going to the end of the screen... I will be glad for every oponion!