[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Moving a sprite along a map.



On Wed, 25 Jul 2007 10:33:10 +0200, aspersieman <aspersieman@xxxxxxxxx> wrote:

On Wed, 25 Jul 2007 10:21:24 +0200, Julián Lamas Rodríguez <julian.lamas@xxxxxxxxx> wrote:

Hello,

Well I'm new to Pygame too, but I think I know what you need.

You should have a logical representation of what you have on the map.
You also need to implement a little of AI, using a pathfinding
algorithm. Look here for more information:

http://www.gamedev.net/reference/list.asp?categoryid=18#194

A* is one of the preferred algorithms for pathfinding. Hope this could help.

Bye.

2007/7/25, aspersieman <aspersieman@xxxxxxxxx>:
Hello All

I'm relatively new to python and pygame. I'm making a sort of tower
defense game, involving llamas and stuff. I have managed to generate a
map, that can have its layout (a bunch of lines on a .png) read from a
text file, and that creates a 'path' where the 'creeps' are supposed to
run along.

My problem is, how do I program a 'creep' to run along a specific path on my map? What I would ideally like is for the 'creeps' to 'know' where to go, in other words they would always run in one direction along a winding
path and this path can be randomly generated.

Can anybody suggest an algorithm or point me to a relevant example where I
can have this answered please?

Thanks for any help :)

Nicolaas


Thanks I think thats exactly what I was looking for :)

Nicolaas



Hi again

Just in case anybody else was looking for stuff on pathfinding, I've found this cool example. Its written in python.

Regards

Nicolaas

--

 ~)
  (_---;        The Llama compels me...
   /|~|\
  / / / |