Operation Green Clean
3. Animate Hero
From the move tab on the right of the object properties window, drag the move towards icon into the actions column of the object properties window. When the move towards settings window appears, change the x value from 0 to mouse_x and the y value from 0 to mouse_y. Then change the speed to 3.
Click ok to save the changes to the move towards action and ok in the object properties window to save the hero object. You should see an object appear in the objects folder.
WHY DID I DO THAT?
When the player clicks the mouse, you want the hero to move to where the mouse was clicked. To do this you tell Game Maker to move the hero to the x and y position of the mouse by using mouse_x and mouse_y.
Now that you have created a sprite and an object you want to create a game space or room. The game space defines the setting for the game as well as the space where the game takes place. You also need to create a game space to test your objects and see how they behave. This mission will show you how to create a game space.
Before creating the game space though, you want to set-up a background so that you can customize the game space.
Click the create a background button. When the background properties window appears, click the load the background button. From the resource files you downloaded earlier, select the background named park and click open.