[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Moving a sprite along a map.
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Moving a sprite along a map.
- From: aspersieman <aspersieman@xxxxxxxxx>
- Date: Wed, 25 Jul 2007 08:34:00 +0200
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Wed, 25 Jul 2007 02:35:25 -0400
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:to:subject:from:content-type:mime-version:content-transfer-encoding:message-id:user-agent; b=IlyNsjSqbCpiVhC/xtyNjVAcKJKOn/ZEw/aoUrhwGV8LdMFrBfFQSfmWRXueTO/kMT1nQA4/OKrPMX6qx8l1KdtR7lk9NqcEEneJzN1todPS+u0GFIxreW2UyD2oPSrQB8RcUuSrVwKD4K67nYmBrSxM3HuAMSuzGYcp/hPS+Xk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:to:subject:from:content-type:mime-version:content-transfer-encoding:message-id:user-agent; b=kuDeWA/ny/AJUMmk77JBHQxI/VnC8nC6NUrNj0lvY8tVR0867dRS+/tUbbsqBJKjPpjgR0YCFBtooB+eAJRXN6R94vh1+r2UCmeWTjZ4YCnMIdJnFikVGaNYHmNOogGebQ3e12IeasoZwz73elq6Gx3busAnC1g4vLhqUTLH/NI=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
- User-agent: Opera Mail/9.20 (Win32)
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
--
~)
(_---; The Llama compels me...
/|~|\
/ / / |