Uploaded November 2026 | Updated November 2026, 15 hours ago
On my most recent side quest, I had the thought of adding vertical movement to the asteroids. I got it to work with a simple boundary check. Get too close to either top or bottom asteroid and the shift gears. But then I discovered if you destroy an asteroid it screws it all up and it would require much more checks... or so I thought.
I tried to integrate the suggested code by Mike from ARG to some levels of success but then it always seemed like when one problem was fixed another popped up.
I then decided to rework the destruction code. Instead of sending the asteroids off screen when they get destroyed I created a new sprite - one that was 1 blank pixel in size. That way it can stay in place and I wouldn't have to send it off screen but that still did not resolve the asteroids moving to the next highest or lowest sprite.
I originally set the asteroid to the next highest one but this was imperfect. It resulted in flicker and still required bottom checks.
I set a variable that is determined by which set of sprites is used so if the asteroid is destroyed that variable is used to determine the sprite height for the collision. Now it all seems to work pretty good.
I think having up and down movement adds an additional dynamic to the game.
On my most recent side quest, I had the thought of adding vertical movement to the asteroids. I got it to work with a simple boundary check. Get too close to either top or bottom asteroid and the shift gears. But then I discovered if you destroy an asteroid it screws it all up and it would require much more checks... or so I thought.
I tried to integrate the suggested code by Mike from ARG to some levels of success but then it always seemed like when one problem was fixed another popped up.
I then decided to rework the destruction code. Instead of sending the asteroids off screen when they get destroyed I created a new sprite - one that was 1 blank pixel in size. That way it can stay in place and I wouldn't have to send it off screen but that still did not resolve the asteroids moving to the next highest or lowest sprite.
I originally set the asteroid to the next highest one but this was imperfect. It resulted in flicker and still required bottom checks.
I set a variable that is determined by which set of sprites is used so if the asteroid is destroyed that variable is used to determine the sprite height for the collision. Now it all seems to work pretty good.
I think having up and down movement adds an additional dynamic to the game.










