Platformer Enemy AI

For questions about using Classic.

Post » Wed Jan 28, 2009 3:28 pm

I'm working on an action platformer game, and I can't figure out how to do the enemy AI. I've been playing around with it for a while and haven't manage to do much more than make the enemy face me and shoot a bullet every once and a while. Does anyone know where to find a tutorial or a source file that could help? (Or just explain it)

Heres my source file, not much done yet:
http://www.mediafire.com/?sharekey=fa03 ... f6e8ebb871
B
5
G
3
Posts: 49
Reputation: 1,038

Post » Wed Jan 28, 2009 3:51 pm

viewtopic.php?f=4&t=1949&st=0&sk=t&sd=a&start=60

Deadeye gave a good explanation on how he did it here.
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Wed Jan 28, 2009 3:59 pm

Yeah, I found that earlier. Is there anything simpler? I really just want to figure out how to make it walk back and forth.
B
5
G
3
Posts: 49
Reputation: 1,038

Post » Wed Jan 28, 2009 5:18 pm

http://www.mediafire.com/?sharekey=fa03 ... f6e8ebb871

I made some turret enemies to kill, and first it made it so if you killed one all of them died. Now, no matter which one you shoot, the first one dies and then the second one. Any ideas?
B
5
G
3
Posts: 49
Reputation: 1,038

Post » Wed Jan 28, 2009 7:48 pm

[quote="lokijki":1l8nfirc]Yeah, I found that earlier. Is there anything simpler? I really just want to figure out how to make it walk back and forth.[/quote:1l8nfirc]
Try another deadeye thread. You can do it like he did his platforms. He has a platform bouncer at each end of the platform's "patrol zone" and when the platform collides with a platform bouncer it turns around and heads back the other way.
B
3
S
2
G
4
Posts: 271
Reputation: 2,017

Post » Wed Jan 28, 2009 8:11 pm

Well I didn't use the turret behavior so far, but it looks like if you put Sprite (the enemy)and RockFeet in a container it does work. Btw I don't think it always destroys the first, but resets the base object when you kill one.

Of course when you kill an enemy rockfeet will be destroyed as well. But you could always spawn another sprite for some kind of debris.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Wed Jan 28, 2009 9:30 pm

Ok, thanks with the help so far, but I got another one.

http://www.mediafire.com/?sharekey=fa03 ... f6e8ebb871

As soon as I put spikes in I've gotten a bunch of crashes whenever I hit them and occasionally when I die in other ways. Debug mode says the problem is in the script that makes the effect when a bullet hits something.
B
5
G
3
Posts: 49
Reputation: 1,038

Post » Wed Jan 28, 2009 10:19 pm

Your problem aren't the spikes. It has something to do with the quicksave/quickload. When you reach the checkpoint (save sprite)you have a quicksave action. When you die now (hit spikes), the game attempts to quickload and crashes.

Well a crash is a bug and should be reported, if it isn't already. Maybe smb else has more insight on this issue.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests