The Daily Click ::. Forums ::. Klik Coding Help ::. Need Help with Path Movement
 

Post Reply  Post Oekaki 
 

Posted By Message

Lifesoft



Registered
  27/07/2006
Points
  4
27th July, 2006 at 17:49:19 -

Hi,

I'm working on a game in which I need a set of enemies to walk around on set paths but randomly, like the ghosts on Pacman. What is the best way to set up a simple 4 direction movement like this?

 
n/a

Silveraura

God's God

Registered
  08/08/2002
Points
  6747

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
28th July, 2006 at 13:51:29 -

You could have the enemies have sensors on 4 sides, and if the side sensors are on a wall, just move up and down, same with top and bottom sensors. Change direction randomly based on the sensors. Shouldn't be to hard.

 
http://www.facebook.com/truediamondgame

RenatoDep

The Ion Adventurer

Registered
  22/03/2003
Points
  804

KlikCast Star
28th July, 2006 at 14:00:16 -

I wouldn't use the pathmovement for that. I'd just do a custom movement, or maybe even the bounce movement with only 4 directions, when it touches those sensors like brandon said, pick a random direction out of those 4.

 
http://www.galaxiachronicles.com
http://www.eivix.com

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
28th July, 2006 at 14:06:30 -

Newt: He never said he was using "Path Movement," he said he wants to make "A path movement like the pacman ghosts." Honestly

 
n/a

RenatoDep

The Ion Adventurer

Registered
  22/03/2003
Points
  804

KlikCast Star
28th July, 2006 at 14:08:40 -

Ah ok Well, my suggestion is still valid. Honestly.

Image Edited by the Author.

 
http://www.galaxiachronicles.com
http://www.eivix.com

Lifesoft



Registered
  27/07/2006
Points
  4
28th July, 2006 at 14:57:24 -

Thanks for your suggestions. I have a few questions though. I had initially tried using the bounce method but when setting up the angles the lowest setting is 8, and I obviously want only 4. This may not be the cause of my problems, but my enemies are always getting off track inside the paths they are in, as they aren't as wide as the paths themselves. Also, when you say "custom movement", what all does that entail? I'm obviously pretty new at this so all your help is greatly appreciated.

 
n/a

Silveraura

God's God

Registered
  08/08/2002
Points
  6747

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
28th July, 2006 at 15:00:29 -

Fixing the problem with enemies not being as wide as the paths is easy, just move the sensors out farther from the enemy, if that doesn't work. Make the enemies bigger.

 
http://www.facebook.com/truediamondgame

Lifesoft



Registered
  27/07/2006
Points
  4
28th July, 2006 at 15:11:28 -

Yeah, that's definitely what I need to do if I'm going the sensor route, but my paths aren't all exactly the same size, which makes things more difficult. If all else fails, I guess I can go back and adjust my paths to be perfectly sized, but hopefully I can find another method of keeping them from bouncing around.

 
n/a

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
29th July, 2006 at 05:21:24 -

Seeing as pacman is on a grid, why not make them move a grid square at a time, then check whether a wall is in the way

 
n/a

Werbad



Registered
  18/09/2002
Points
  235
29th July, 2006 at 11:01:48 -

I made a quick example of a grid-based enemy AI
http://rapidshare.de/files/27450621/grimovement.zip.html
This movement uses no detectors and works with multiple enemies
This is an MMF example, but since it only uses 1 active object it could easily be converted to TGF if needed, i just don't have TGF on this computer...

 
n/a

Lifesoft



Registered
  27/07/2006
Points
  4
31st July, 2006 at 03:40:48 -

Ah! Thank you so much this is perfect. Thanks to everyone for their help as well.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click