If there's one thing mobile games and apps tell you to do, it's to tap something. Tap to start. Tap to continue. Tap to win! Okay, this one may be less common, but the point remains the same. Tap controls are the most common control styles in mobile games and the best part is they're not hard to code. Let's take a look at an example right now.
For this recipe, you'll need two objects. Give one object a simple sprite (such as a blue circle) and name it obj_balloon
and name the other obj_control
but don't assign a sprite to it. Make sure obj_control
is placed inside the room you're using for this recipe.
In the control object, add a Create event to a code block that sets the following alarm:
alarm[0] = 60;
Next, add an event to Alarm0 using the following code:
instance_create((random_range(0,room_width)),(random_range(0,room_height)),obj_balloon);
In
obj_balloon
, simply add a mouse left pressed event and enter this code into a code block:instance_destroy...