I have written a demonstration of a simple path-finding algorithm (in Python), for use in grid-based computer games. It used a breadth-first search to route a sprite from one part of a map to another, avoiding obstacles in between. The code is a listing taken from my forthcoming book, Beginning Game Development with Python and Pygame. There's no documentation I'm afraid. If you want to know how it works, you will have to buy the book. :-)

Download path finding demo

To run it, you will need PyGame, and of course Python. The code is completely public domain, use it for whatever purpose you want and you don't owe me a penny. Here be a screenshot...

fuguswim
This blog post was posted to It's All Geek to Me on Friday April 20th, 2007 at 6:07PM
 

5 Responses to "Swim Fugu, Swim"

  • Jay P
    April 20th, 2007, 7:17 p.m.

    Amazon is saying August for publishing. Any chance it'll be out earlier?

  • April 20th, 2007, 7:33 p.m.

    Sorry, it's unlikely to be out any earlier!

  • April 21st, 2007, 10:34 p.m.

    Excellent. I can't wait to get a hold of this book, although it will be little new to me, I want something to recommend to my friends and the newcomers to #python @ freenode who are always asking for good books. Good luck!

  • July 11th, 2007, 5:35 a.m.

    Looks like a neat book. I might be able to make my computer science teacher get a copy or two, and we can use them for our after-school programming stuff. I'm not too great on teaching this stuff.

  • July 27th, 2007, 11:29 a.m.

    I cant wait to buy the book! :D

Leave a Comment

You can use bbcode in the comment: e.g. [b]This is bold[/b], [url]http://www.willmcgugan.com[/url], [code python]import this[/code]
Preview Posting...
Previewing comment, please wait a moment...
Will McGugan

My name is Will McGugan. I am an unabashed geek, an author, a hacker and a Python expert – amongst other things!

You are reading my tech blog. See the homepage for my other blogs.

Search for Posts
Possibly related posts
Tags
Popular Tags
 
Archives
2009
 
Recent Comments
I've just recently read the book, got it from the university library actually. I didn't bother with any of the ...
- Gregory on A bad review
Hi Will, I brought your book from Amazon. I think its a great book. It has given me everything i ...
- P K on A bad review
@ Anatoliy But this is, hopefully, what you're looking for. His library is extensive enough that it provide the features ...
Thanks for this. I started writing my own and was starting to get a little frustrated when a friend pointed ...
- Ahlywog on BBCode Python Module
A little bit faster version: def flatten(l): if isinstance(l, basestring): return l # raise TypeError if not iterable iter(l) rs ...
 
© 2008 Will McGugan.

A technoblog blog, design by Will McGugan