Darthfett / A-Priori-Physics-System

A side-scroller game based upon Mega Man X, with a priori collision detection, and objects being represented as a sequence of connected points.
3 stars 0 forks source link

Have Shape.shape always be indicative of current position #29

Closed Darthfett closed 12 years ago

Darthfett commented 12 years ago

No more of this nonsense: entity.shape[index] + entity.position

Fixing this issue will also help to avoid any unintentional copying of points/lines, and allow direct passing of lines so that things like color can be set on the 'real' object.

Darthfett commented 12 years ago

As of c395616, the shape seems to be updating correctly upon position updates. However, if updating on-access is enabled, there seems to be an issue if the draw methods are accessing the shape.

For example, if I enable updating on-access, and use the default blit draw methods, everything seems to work fine. However, if I cause blit draw methods to access the object's shape attribute -- or use the -g parameter when running the game (-g option inherently accesses the shape in-order to draw outlines), the collisions are all screwed up.

Note that in this commit, I have disabled on-access shape updating in order to keep everything working the same with -g. As a result, running the game with -g causes an interesting effect -- the shape is drawn at the last position until a position update -- when a collision occurs, or the player does a control (such as acceleration).