spawn in the direction of object clicked

Get help using Construct 2

Post » Sat Aug 24, 2013 2:40 pm

Hi I made this (http://matt.ucan.tv/lovestuck/) and quite rightly some one suggested it would be better if the boxes would spawn in the direction the box was clicked on, if the box is clicked on the top a new box is spawned in that direction, on the right spawn to the right and so on.

I can add imagepoints but I don't know how to determine where the box is clicked prior to that.

I'd like to get past the more luck than judgment stage of the game

Thanks
B
9
S
3
G
1
Posts: 12
Reputation: 1,194

Post » Sat Aug 24, 2013 2:47 pm

Check which distance(mouse.x,mouse.y,box.imagepointX(),box.imagepointY()) is the smallest?
LittleStain2013-08-24 14:47:45
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Aug 24, 2013 3:50 pm

Brilliant! will that work with touch too?
Thanks
B
9
S
3
G
1
Posts: 12
Reputation: 1,194

Post » Sat Aug 24, 2013 4:13 pm

Just replace mouse with touch and in this case it should work.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests