How do I spawn an object on the area touched?

Get help using Construct 2

Post » Wed Jun 17, 2015 7:25 am

Hi!

I am trying to build a simple city-builder game.

Is there a way to spawn an object on the X, Y coordinate that was just touched?

Thank you!
B
3
Posts: 3
Reputation: 181

Post » Wed Jun 17, 2015 7:32 am

Yes.

Create the condition "On any touch start" (if you want the object to be created as soon as the player touches the screen) or the event "On any touch end" (if you want the object to be created as soon as the player lift his finger).

Then inside this condition you create the event system > Create object.

Create object function takes 3 parameters.
The first one will be the name of the layer you want your object to be created.
The second and third one will be the X and Y of the object, in other words,it'll be the coordinates on the screen where your object will be created.

Set x to "touch.x" and y to "touch.y"

And that's it ^^
hope it helps
B
17
S
7
Posts: 277
Reputation: 2,514


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 7 guests