How do I Make Enemies move properly?

Get help using Construct 2

Post » Thu Oct 23, 2014 7:38 pm

If you saw the tutorial, for make a game like "Ghost shooter",when you play the completed version of the game you made they just move without changing direction,if you play the game on the link at the start of the tutorial,they change direction to you without hitting the layout and changing direction,could anyone teach me that?
B
3
Posts: 9
Reputation: 193

Post » Thu Oct 23, 2014 7:52 pm

Have you completed the tutorial? Can you send over your capx file?
B
11
S
2
Posts: 46
Reputation: 739

Post » Thu Oct 23, 2014 7:55 pm

I think you missed this part of the tutorial...

Making monsters a little smarter
Right now the monsters just wander off the layout to the right. Let's make them a bit more interesting. First of all, let's start them at a random angle.

Condition: System -> On start of Layout
Action: Monster -> Set angle -> random(360)

Event 4 of the tutorial.
They will still wander off forever when they leave the layout, never to be seen again. Let's keep them inside. What we'll do is point them back at the player when they leave the layout. This does two things: they always stay within the layout, and if the player stands still, monsters come right for them!

Condition: Monster -> Is outside layout
Action: Monster -> Set angle toward position -> For X, Player.X - for Y, Player.Y.

Run the game. If you hang around for a while, you'll notice the monsters stay around the layout too, and they're going in all kinds of directions. It's hardly AI, but it'll do!
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
66
S
17
G
8
Posts: 637
Reputation: 9,370

Post » Thu Oct 23, 2014 8:02 pm

hint: it's on page 5 of the tutorial
B
11
S
2
Posts: 46
Reputation: 739

Post » Fri Oct 24, 2014 3:58 pm

They just walk on,they don't change direction
B
3
Posts: 9
Reputation: 193

Post » Fri Oct 24, 2014 3:59 pm

I also want to make them go over other objects too
B
3
Posts: 9
Reputation: 193

Post » Fri Oct 24, 2014 8:47 pm

If your intended movements for your enemies (aside from the going over objects) is the same as the tutorial then if your not getting the same result as the tutorial you need to redo it because the tutorial is correct and works.

As far as "go over objects" this is an extremely vague expectation. Exactly how would you like them to go over objects, overlap, climb, jump, and what are these objects; solids, sprite, other enemies? What is your gameplay top-down like the tutorial or other?
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
66
S
17
G
8
Posts: 637
Reputation: 9,370


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, Bootfit, brunopalermo, Exabot [Bot], Huemerson, unicornspitfire, Yahoo [Bot] and 1 guest