[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Move sprite and stop it.
I think I understand your move_to problem now. I had to invent that wheel for myself a while ago and the math was not trivial for me. I had to get my son to teach me new tricks. :) Even though they may not be the most elegant math solutions, they are reliable.
I uploaded this very basic demo: http://trollsouttaluckland.googlecode.com/files/sprite_test.py.
Line 104 is the call to sprite's move_to.
Line 106 is the code to swap the locations.
The real work of move_to is done in the class and supporting functions.
Cheers.
Gumm