troop movement

Get help using Construct 2

Post » Thu Jun 07, 2012 10:40 am

hello
im trying to create a rts game and need help with troop selection.
all i need is to be able to select a unit by left clicking on it, then i need to be able to move the unit selected by left clicking on the map!

ive included a capx on how far ive gotten but im finding this really challenging for instance i find a way to select just one unit and not all of the same type do i need to use the instances?

and why cant i set mouse> left click> map> set bullet angle mouse.x , mouse.y ....if i put in this last expression it gives me a syntax error.

im confused...can anyone point me in the right direction?

example
B
10
S
1
G
1
Posts: 74
Reputation: 1,637

Post » Thu Jun 07, 2012 2:17 pm

Give the man sprite a local variable called selected and set it true when you click on the man. Then if click on map and man.selected = true... move the man.

For the angle, set bullet angle to
[code]angle(man.x, man.y, mouse.x, mouse.y)[/code]
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Thu Jun 07, 2012 9:14 pm

thankyou
B
10
S
1
G
1
Posts: 74
Reputation: 1,637


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest