Turrets on enemies

Get help using Construct 2

Post » Tue Jan 12, 2016 3:04 pm

I have this enemy tank that shoots at the player, like normal. But I dont know how to make a moving turret on it that follows the player. it currently does but the entire body has to move, which i find unsettling. So, can i make a seperate turret that spawns together with the tank, and targets and follows the player?
B
6
Posts: 46
Reputation: 336

Post » Tue Jan 12, 2016 7:57 pm

There's a cool template comming with C2: Real Time Strategie (RTS)
Image Image Image
B
43
S
22
G
15
Posts: 383
Reputation: 12,262

Post » Wed Jan 13, 2016 3:37 am

pretty much you need 2 sprites on the tank, one the base, and one the turret. You will need to add the pin and the turret behavior to the turret, and when created, or at the start of layout, call in for the turret to pin to object, in this case the base(position and angle) and add the proper events and actions to the turret to track the target and shoot
B
38
S
14
G
4
Posts: 172
Reputation: 4,160

Post » Tue Jan 19, 2016 11:39 am

is it possible to make the turret spawn on the origin area of the tank, using imagepoints?
B
6
Posts: 46
Reputation: 336

Post » Thu Jan 21, 2016 2:00 pm

I can pin it but how do i make it spawn together with the tank at the same posistion?!
B
6
Posts: 46
Reputation: 336

Post » Fri Jan 22, 2016 2:57 pm

If both tank and turret have the origin coordinates in the point where you want them pinned, just Spawn the tank and the turret separately, and once both are spawned pick the turret and set Turret.X to Tank.X and Turret.Y to Tank.Y
B
28
S
10
G
10
Posts: 97
Reputation: 6,584


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, totoe and 5 guests