Archive
Space Fight – Physics
So how do objects interact with each other in the game, and indeed, how can we generalise their individual manipulation in the world?
Important: This is my first post where I use some physics and vector algebra. If you aren’t comfortable with these topics, and would like help understanding the posts, feel free to comment and I’ll give you some help and/or suggestions. Moreover, if you are happy with these topics, but think I’ve done a bad job of explaining, then tell me that as well!
Individual Objects
Position and Facing
A physics object in the game doesn’t keep track of it’s own position or facing for technical reasons (they is part of the graphics object, which gets them from sf::Sprite). Nonetheless, a physics object is capable of retrieving and modifying it’s position via virtual functions and polymorphism. The same is true for it’s facing/angle.
