dimanche 6 juillet 2014

Is it possible to move a rect/object a decimal amount of pixels in pygame?


Vote count:

0




I am trying to make a program in pygame where there is a rect/object chasing the mouse over the shortest possible path, at a constant speed. I have the math worked out, but pygame never lets me move my rectangle a decimal amount of pixels.


Is it possible to move a rectangle, say, (0.8,3.2) pixels in pygame?


If so, please leave the syntax in the answer.


Also, if there is some function or simple code I could write that just moves my rectangle to the closest pixel, that would be OK as well, just I would prefer an answer to the (above) question.



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire