I'm making a simple version of the game asteroids as I'm learning how to develop with Game Maker Studio. Currently, mostly everything works properly except that when the player destroys all of the asteroids, I need the game to exit.
I've tried add the following line of script to the step event for the asteroid, but it resulted in a runtime error:
if (!instance_exists(obj)) game_end();
This is a pretty simple problem but I haven't been able to find the answer on Google. What code should I add to check for any instances of asteroids and then to end the game when there are none?