Object Avoid Fuction?

For questions about using Classic.

Post » Sat Feb 05, 2011 10:06 pm

Hello!

I have used Construct for a couple of months now and I think its one of the best free game maker programs I've seen!

But now I'm trying to make a tank game but I can't figure out how to make an 'avoid' function.

What I mean is, I have enemy tanks that move towards you when you get close to them, but if there is a wall between the player and an enemy tank, the enemy tank will just drive into the wall. What I need is a avoid function for the enemy tanks so they can avoid the wall object and not always drive into them!

I hope you understood that, and hope to find out how to do it!

Thanks for reading and hope to hear some replies soon!
B
2
G
1
Posts: 27
Reputation: 504

Post » Sat Feb 05, 2011 10:43 pm

I take it your not using the rts plug?
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Sat Feb 05, 2011 11:04 pm

I haven't really used the RTS plugin :O

I just tried using the RTS plugin and put the path finding option to 'Solid' so it moves around 'solid' objects. So I make a wall object, changed it to a solid and place the wall in-between the enemy and the player, started the layout and it didn't avoid the wall! it just went straight through it :<

Do ye' know how to fix that?
B
2
G
1
Posts: 27
Reputation: 504

Post » Sat Feb 05, 2011 11:34 pm

Start of layout
Tanks add obstacle wall.
Make sure your collisions are set to either per pixel, or bounding box for both.

I'd get rid of the solid attribute, pathfinding for it can really slow things down.
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Sun Feb 06, 2011 8:42 am

ok thanks!! I'll try it now!

I just fixed it!! Thanks!
I also had to change how the enemy moved, instead of rotating towards the player, I got it to move using the RTS fuctions. :mrgreen:
B
2
G
1
Posts: 27
Reputation: 504


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 9 guests