How do I make a random moviment to NPC TANK

Get help using Construct 2

Post » Sun Oct 02, 2016 11:14 pm

Message: dantezinn can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Guys, i searched (A LOT) first and the closest solution to my problem, was this post, but my NPC tank sometimes get stuck on the edges of layout.
scirra.com/forum/how-do-i-give-an-object-random-movement_p829275?#p829275

My intention is, to make the NPC tank move randomly across the layout, while the turret stays aimed on my main tank, but i'm failing to do it!

Here is the capx: www.dropbox.com/s/2r94y0rddgvj0a4/tank_v2.capx?dl=0

I need help cause thi is a University test!
Thanks in advance
B
4
S
1
Posts: 8
Reputation: 320

Post » Mon Oct 03, 2016 12:27 am

It might be better to use pathfinding for this? Choose a random destination every x seconds and go to it.
https://dl.dropboxusercontent.com/u/495 ... urret.capx
B
46
S
16
G
78
Posts: 2,168
Reputation: 46,353

Post » Mon Oct 03, 2016 2:27 am

@plinkie You just saved my life! One thing tho, i set a new tile background, like a wall passing the current edge i had, my main tank (wich i can control) respects the "bound to layount", but the NPC don't.
Do you have any idea?
B
4
S
1
Posts: 8
Reputation: 320

Post » Mon Oct 03, 2016 7:49 am

Do you mean the NPC tank that's moving about the screen? Based on the method I provided, bound to layout behaviour isn't required. You set the co-ordinate limits yourself and make sure it doesn't move outside of the layout.
B
46
S
16
G
78
Posts: 2,168
Reputation: 46,353


Return to How do I....?

Who is online

Users browsing this forum: ignaciosimo, nickar and 37 guests