Creating AI using Bullet behavior

Get help using Construct 2

Post » Thu Apr 18, 2013 4:26 pm

I need some help. I'm trying to create an AI that closes in on the player, then backs away after a certain distance. The idea is to create an AI that rushes the player, then goes off to the side while still shooting (strafing).



For those checking the .capx:

-CloseRange is the range in which the AI should be close to the player and needs to start moving away.
-Right now I'm only testing to try to get it work for the player. The AI currently does not detect asteroids and account for them.
-Please test using keyboard only, since touch controls are not working properly at the moment.

SpaceGame.capxExcal2013-04-18 16:35:01
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Fri Apr 19, 2013 1:19 am

I guess one of my issues is that as soon as the enemy is outside 'close range', when I set the bullet angle of motion back toward the player, this causes the speed of the enemy to instantly change. There is no acceleration that slows the enemy ship down and then causes it to move towards the player - it just magically changes motion.

Should I be using CustomMovement for this instead of Bullet?
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Fri Apr 19, 2013 3:20 am

Alright, I've switched to using CustomMovement behavior. It seems to be mostly working now (link is updated).

However, what's with the fire rate of Turret? It seems to fire really randomly and not according to my set fire rate except in a head-on angle.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194


Return to How do I....?

Who is online

Users browsing this forum: Nifl and 28 guests