Add Event, Action To Change Color For Object obj_circle Gamemaker

Add Event, Action To Change Color For Object obj_circle - Drag Drop Object  in Game Using Game Maker Studio Part 3

Step 9: We have done drag and drop obj_cricle object with gamemaker. Now we will make the effect change color for this obj_circle object when it dropped into the color boxes. Yeah, we need 6 Collision Events.

Step 10: Inside the obj_red_box collision Event, we add the If Var Action which is got from Control tab. We will set the variable name drag is 0 and operation is equal to. We need two more action Start of Block, End of Block. Inside this block, we add Set sprite color blending Action could be found on Main 1 Tab/Sprite. And we will select red for color and 1 for alpha.

Drag and Drop Change Color GameMaker Tutorial


Step 11: We will do it again, do the same step 10 for other 5 object collision event left obj_sky_box, obj_green_box, obj_gray_box, obj_violet_box, obj_yellow_box. We only need to change the correct colors corresponding. So, we almost finish to building the game.

Step 12: For obj_red_box Object, we only need to add 1 Event Create and Action Change Sprite into. Action Change Sprite, we will choose spr_colors sprite, sub_image = 0, and speed = 0.

Remember to change sub_image based on the color of the object we want. For example, if the sub_image 2 has the color is violet, so we will change the sub_image 2 for obj_violet_box.

The speed is equal 0 in order to not allow speed changing over time. This spr_colors sprite we have 6 images, if we set the speed is 0, the sprite will change overtime.

Drag Drop Object i Gamemaker

Step 13: Do the same step 12 for these objects obj_sky_box, obj_green_box, obj_gray_box, obj_violet_box, obj_yellow_box. Just change the sub_image of the spr_colors spirte to correct colors for the objects.

Step 14: Create a new room, place 6 objects colors boxes and obj_circle object into the room.

Drag Drop Object In Room Gamemaker

Step 15: click Run and test your simple drag and drop object game with gamemaker studio tutorials.