I'm trying to develop a game (Spaceship and Rocks) using only HTML5 and pure JavaScript. But the game is freezing unexpectedly. Everything works fine before Spawning the rocks in CANVAS. I'm not able to rectify the problem. here's my game in codepen: http://cdpn.io/vJaoi I'm lostt... Help me!!!!.