The Daily Click ::. Forums ::. Klik Coding Help ::. Bloody Following Problem
 

Post Reply  Post Oekaki 
 

Posted By Message

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
23rd December, 2007 at 23:30:17 -

I've been trying to get the enemy to follow the player if the difference between its X pos and my hero's X pos is less than or equal to 350. But for some reason, the enemy stops following when the difference reaches 140 or 141. I've tried using an active object as a following area and the same is the case. The enemy just stops. Which is very very weird. This is getting really frustrating but oh well, I can always blow his head off

Abs( X( "Base" ) - X( "Zombie" ) ) =< 350 <-- this is the equation im using to set him into follow mode. Maybe I should bouncy ball movement but there's less control over objects in it, aint it?

Image
This is giving me a lot of trouble. He just wont follow beyond that point.

Image
See, the distance at the bottm is 62 but he just stays there. Eat lead, mother @#$%^! *Laughs insanely*

Seriously, any help would be really appreciated.

Image Edited by the Author.

 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
24th December, 2007 at 00:06:23 -

Perhaps the problem is in how the "Follow" mode works; you should elaborate on that. Does it simply set his position to xpos = xpos +- 1, or what? Or do you use the built in ball movement somehow, or is the speed of the zombie dependent on the distance between them? If the last case is correct, it could simply be that as the distance gets below 140ish, whatever equation you are using the get the speed of the zombie in pixels/second is giving a result of less then 1, rounding down to 0. Which would make him stand still. If thats the case, simply add a +1 to whatever equation, so it will always round "up"

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
24th December, 2007 at 00:16:23 -

Thanks for the reply. I was using 'PosX + 1' but somehow it was giving me problems. I've now switched to ball movement. It works but its kinda more complicated. Oh well, whatever works Btw, the screenies look nice dont they? Ok, now that I've got one zombie working, how do you think I should make use of many? Qualifiers? Or some other method such as spread value, which Im not very good at.

Image Edited by the Author.

 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
24th December, 2007 at 05:06:19 -

It's not a Playstation it's a PC!

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
24th December, 2007 at 11:37:08 -

But I love Playstations

 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!
   

Post Reply



 



Advertisement

Worth A Click