How do I make a charging enemy

Get help using Construct 2

Post » Thu Mar 21, 2013 12:47 pm

I would like to make a charging enemy.

(Top down game)
Enemy going random straight direction at speed 80 (as a bullet)
When the enemy reaches 500 pixels away from the player it stops and adjusts it's angle to the player for 1 second
Then it charges in that direction at 200 speed without changing for 3 seconds.
after charging it will wait 2 seconds before setting it's speed back to 80 and randomly setting it's angle and moving again.

When I tried to do this it would work the first time but then once the enemy goes back to normal it was very choppy and didn't work.

If anyone can post their way of doing this it would be very helpful and I would appreciate it a lot.
B
3
Posts: 3
Reputation: 283

Post » Thu Mar 21, 2013 1:09 pm

Can you link your .capx ? I can try to fix your system.
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Fri Mar 22, 2013 6:09 am

Ok here you go
https://www.dropbox.com/s/4yiawsyzfv96bcr/Charge%20Test.capx
B
3
Posts: 3
Reputation: 283

Post » Sat Mar 23, 2013 6:21 am

No answers yet, bump
B
3
Posts: 3
Reputation: 283

Post » Sat Mar 23, 2013 6:46 am

I think it has something to do with your routine running more than once. While one set of "Waits" is going on, more are also starting. Which gives the overlap of the "Charge" Variable toggling 1 and 0 real fast. Compounding the problem.

I dragged Event 8 into Events 7 as a sub-event, so it only ran when Charge turned to 1, and it seems to work, except for the bullet angle vs the sprite angle.
B
201
S
52
G
30
Posts: 897
Reputation: 36,621


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests