Walking AI

Get help using Construct 2

Post » Thu Jan 23, 2014 8:47 pm

Im trying to make a game based on the topdown shooter template and was just wondering is there any way to make the ai just walk around pointlessly?
B
3
Posts: 11
Reputation: 197

Post » Thu Jan 23, 2014 9:51 pm

If I had to figure this out with my knowledge and no help I would probably place hidden/invisible spots all over the layout and set the player to change directions on overlap.

Now the smarter guys probably will tell you a bunch of better ways to this and in which case I will learn it too...

But that's what I would do if I had to figure something out.

I hope this helps.
Check out my latest game RAPID-TAPIT. Get your Fingercise on with this one. A steady Tap is all you need to score points. Lift a finger and see what you can do...

Image

ALLMarkMade Designs
B
32
S
15
G
3
Posts: 356
Reputation: 5,269

Post » Thu Jan 23, 2014 9:58 pm

Thannks! actually got it working (kinda)
B
3
Posts: 11
Reputation: 197

Post » Thu Jan 23, 2014 10:16 pm

@Lpgfinmarkus, what method did you use?

I would like to suggest adding the bullet behavior to your AI sprite. Then, in the event sheet, create a condition that says System."Every X seconds". Then create an action that changes the sprite's bullet angle of motion.
That will allow your sprite to wander around aimlessly.

There are many methods of handling the sprite going off the screen:
1. Destroy the sprite. Either in the event sheet or using the specific behavior for that.
2. Use the "Wrap" behavior for the object.
3. Create a border around the layout so that the bullet sprites would bounce off them. This can be done by using sprites and adding the "Solid" behavior to them.

I hope this helps.
B
20
S
4
G
1
Posts: 185
Reputation: 2,563

Post » Thu Jan 23, 2014 11:09 pm

Alternatively, give the pathfinding behaviour to your enemy sprites (you can set it off by default) and when they need to walk aimlessly, set it on have them walk to a random valid point on the layout. When they reach their destination, repeat.
B
15
S
4
G
1
Posts: 286
Reputation: 1,988


Return to How do I....?

Who is online

Users browsing this forum: karthikavnair, OBLIVION, Rable and 6 guests