enemy behavior problems

For questions about using Classic.

Post » Tue Mar 29, 2011 12:34 pm

hey guys! once again im having some trouble.
this is all basics and ive gone through platform school to try and troubleshoot my issues,but im still at a dead end.
im trying to make a really simple enemy behavior.
meanin,that the enemy would patrol back and forth on his platform,NEVER leaving that particular platform.
im having issues trying to make the enemy detect the player and chase him when the player is on the same platform,but to stop chasing and continue patrolling, if the player goes out of this particular platform. also,im trying to make it so that the enemy tries to hit the player every,say, 3 seconds.

so,if anyone could make some sense to this mess of a code,id be thankful:

[url:2bs64gtj]http://dl.dropbox.com/u/11157144/enemy-behav-test.cap[/url:2bs64gtj]
B
4
S
2
G
2
Posts: 109
Reputation: 1,318

Post » Tue Mar 29, 2011 5:12 pm

You don't necessarily have to use LOS. I see you are using an invisible marker for your enemy already, so if you make an event where the player is overlapping that marker, the enemy could chase the player while he's within it, but then stop when he isn't. Also, if you want something to happen every 3 seconds, then you can use the object "wait"-- which is something I wish I realized a month ago. :(
B
5
S
1
G
2
Posts: 99
Reputation: 1,575

Post » Tue Mar 29, 2011 6:33 pm

hi and thanks for replying.
i made a new experiment, and got a little further(still not completely satisfied though).
heres the .cap:

[url:1q0zz8kl]http://dl.dropbox.com/u/11157144/enemy-behav.cap[/url:1q0zz8kl]

so now the enemy stays on his platform and chases the player,but theres some annoying issues:
first, theres some really ugly random jerking,when the enemy changes direction

second, when you encounter the first enemy near the second, the second one rushes from his platform towards the player,id like to avoid that.i know the problem is because the player is already overlapping the enemyblock sprite,when the second enemy sees him, i just dont know how to fix that.

the third enemy is just weird,because the player is approaching from below,and i dont really know how to best handle that situation smoothly.

anyone up for a challenge n give some hints? :)
B
4
S
2
G
2
Posts: 109
Reputation: 1,318


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests