Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Right now I'm using lists as position, velocity, and acceleration vectors in my game. Is that a better option than using NumPy's arrays (not the standard library's) as vectors (with float data types)? I'm frequently adding vectors and changing their values directly, then placing the values in these vectors into a Pygame Rect. The vector is used for position (because Rects can't hold floats, so we can't go "between" pixels), and the Rect is used for rendering (because Pygame will only take in Rects for rendering positions).

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

This answer recommends gameobjects which has a Vector2 class. I'm not sure how it will interact with Pygame's Rects.

share|improve this answer
    
Hrm. A little bit of timeit experimentation shows that this isn't actually faster. Well, gameobjects ought to be useful anyway. Thanks! –  JesseTG Nov 24 '12 at 20:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.