The Daily Click ::. Forums ::. Klik Coding Help ::. Enemies that chase the player?
 

Post Reply  Post Oekaki 
 

Posted By Message

Arekus



Registered
  07/04/2008
Points
  21
18th April, 2008 at 18:24:09 -

Title says it all.... Looking to make enemies chase the player in my platform game. Think like the ghosts from the mario series, but without the disappearing.... Thanks

 
n/a

Ricky

loves Left For Dead 2

Registered
  28/12/2006
Points
  4075

Has Donated, Thank You!Game of the Week WinnerVIP MemberWii OwnerHero of TimeGOTM Winner! - November 2009I am an April Fool
18th April, 2008 at 18:47:13 -

Can the enemies fly? or do they walk?

 
-

Arekus



Registered
  07/04/2008
Points
  21
18th April, 2008 at 20:34:07 -

Honestly, an example of both would be great, but the enemy that I originally had in mind flies. To be honest, it is a giant bee.

 
n/a

SoldjahBoy



Registered
  25/10/2006
Points
  100
19th April, 2008 at 09:13:08 -

Is there a range at which they will be activated or do they follow the player if his back is turned like in Mario?

You can make an ivisible detector like a big circle which is positioned always at the enemies X,Y coordinate, and if the player is overlapping the detector make the enemy "always look in direction of player, start movement" (assuming the enemy is using bouncing ball movement). If it will be based on where the player is facing, rather than a range detection... you would have to do something like:

(psudeo code)
-Enemy X is greater than Player X and Player is direction "left" then
-enemy look at player, start movement

-Enemy X is less than Player X and Player is direction "right" then
-enemy lok at player, start movement

something along those lines. Forgive me if I am not making perfect sense... I'm a little tired after a long day

 
What's wrong with pillow shading? O.o

Arekus



Registered
  07/04/2008
Points
  21
19th April, 2008 at 13:14:58 -

Hmm.... not able to get it to work like this... I tried...

Collision between player and detector
Create object "Enemy" at 0,0 from Nest
Turn Internal Flag 1 "Nest" On


Internal Flag 1 Nest is on
Bee looks at "Player"
Start Movement

hmm? o.O

Image Edited by the Author.

Got it working now... Thanks a ton for the response, It really helped.

Image Edited by the Author.

 
n/a

SoldjahBoy



Registered
  25/10/2006
Points
  100
19th April, 2008 at 20:36:28 -


Originally Posted by Arekus

Got it working now... Thanks a ton for the response, It really helped.

Image Edited by the Author.



Cool glad I could help... I was really tried and a bit drunk last night after the party lol... I wasn't really sure how much sense I was making at the time lol.

 
What's wrong with pillow shading? O.o

J.R.P



Registered
  16/08/2007
Points
  384
20th April, 2008 at 06:24:06 -


Originally Posted by SoldjahBoy

Originally Posted by Arekus

Got it working now... Thanks a ton for the response, It really helped.

Image Edited by the Author.



Cool glad I could help... I was really tried and a bit drunk last night after the party lol... I wasn't really sure how much sense I was making at the time lol.



me drunk now "hic" HEY! get that pony off my couch!


 
That there is one damn fine coat your wearin.

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
21st April, 2008 at 07:04:48 -

You might also want to check out the fantastic "Last Known Pursuit" method for your enemies. I've used something very similar and it's a big improvement over enemies that mindlessly chase you until the end of time.

Here it is now:

http://www.create-games.com/article.asp?id=1620

Not to be a Deadmandines fanboy, but basically anything Dines writes is God and should be extremely helpful for almost anything you need game-wise.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!
   

Post Reply



 



Advertisement

Worth A Click