Revisions to Space Fight’s Physics
Yesterday I posted about the physics simulation in my game, Space Fight. Since then I have had some suggestions on cplusplus.com for improvement. In particular it was pointed out that there is arguably a difference between the physical position of an object and it’s position on screen (thanks helios).
Last time I said the physics object didn’t keep track of it’s own position as it was part of sf::Sprite in the graphics object. I am now in the process of changing things so that the physics object keeps track of its position separately from the graphics object and then the two values are synchronised by the GameBase class which inherits from both of them.
More on this later, when I’ve finished implementing it!