Enemy AI - Crawler

Get help using Construct 2

Post » Thu Feb 12, 2015 11:22 pm

Anyone know how to make the AI for Crawler type enemies?

They crawl along the floor, when they hit a wall they crawl up it, then the ceiling, in a loop.
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Fri Feb 13, 2015 1:22 am

"On collision with wall" set the movement behavior you use a new direction other than the one its currently using.
B
44
S
11
G
2
Posts: 1,181
Reputation: 6,816

Post » Fri Feb 13, 2015 1:47 pm

nimos100 wrote:"On collision with wall" set the movement behavior you use a new direction other than the one its currently using.


Thanks, but what if they're on an ledge and need to move down or up it? There's no wall in that situation.
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Fri Feb 13, 2015 1:53 pm

Well you could just add one and make it invisible if you dont want it to show? :D
B
44
S
11
G
2
Posts: 1,181
Reputation: 6,816

Post » Fri Feb 13, 2015 2:20 pm

Anyway to do it without markets? Like using Overlapping at Offset to detect if they're on a wall or not?
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Fri Feb 13, 2015 5:44 pm

I'm not exactly sure about these monsters, but are they supposed to move on all surfaces? If so, make an invisible sprite that sets the Crawler's variable on contact. Like so:

if Crawler collides with WallCollider
set Crawler variable Direction to Up

if Crawler Direction = Up
Move upwards

I'm not a coder but I hope you understood what I tried there. You just need a sprite for all surfaces the crawler can touch and then set its direction according to it. Maybe add the sprite to the corners only so the Crawler won't touch two of them at the same time and get confused.
B
18
S
6
G
4
Posts: 221
Reputation: 3,275


Return to How do I....?

Who is online

Users browsing this forum: Fib, imhotep22, raulcg1981, shukra, sickboysid and 2 guests