To troubleshoot this, I added a show_debug_message at the top of the script that runs in the Create event of each object.
That second spawn is where it gets strange, because it seems to run the original turrets "Create" event again, while running the Create event for the new turret in a different location. Then, a second turret spawns in a different location after the player collects ten candies. Specifically, a turret that shoots bullets at the player spawns after collecting five candies. Now, after collecting a certain amount of candy, the room manager spawns enemies. "Candy" objects spawn intermittently in random intervals, and the goal of the game is to collect as much candy as possible by moving the player character over each piece of candy to collect it. This is a simple test game, with a top-down "Zelda" perspective, with a player character whose movement is controlled with the arrow keys.
#INSTANCE_CREATE GAME MAKER STUDIO 2 CODE#
In the room the game takes place in, the first object spawned is an invisible "room manager", which every game step checks conditions of the game, and then runs specific code whenever certain conditions are met.
I thought the create event only runs once, when an instance of an object is created? I don't understand what's going on. It seems like an instance is running its own create event every time I create another instance of the same object, causing duplicates to be created in the same location.