Overhaul the Platformer Physics System #20

Manually merged
kirsle merged 1 commits from physics into master 2020-04-05 04:08:27 +00:00
  • Player character now experiences acceleration and friction when
    walking around the map!
  • Actor position and movement had to be converted from int's
    (render.Point) to float64's to support fine-grained acceleration
    steps.
  • Added "physics" package and physics.Vector to be a float64 counterpart
    for render.Point. Vector is used for uix.Actor.Position() for the sake
    of movement math. Vector is flattened back to a render.Point for
    collision purposes, since the levels and hitboxes are pixel-bound.
  • Refactor the uix.Actor to no longer extend the doodads.Drawing (so it
    can have a Position that's a Vector instead of a Point). This broke
    some code that expected .Doodad to directly reference the
    Drawing.Doodad: now you had to refer to it as a.Drawing.Doodad which
    was ugly. Added convenience method .Doodad() for a shortcut.
  • Moved functions like GetBoundingRect() from doodads package to
    collision, where it uses its own slimmer Actor interface for just the
    relevant methods it needs.
* Player character now experiences acceleration and friction when walking around the map! * Actor position and movement had to be converted from int's (render.Point) to float64's to support fine-grained acceleration steps. * Added "physics" package and physics.Vector to be a float64 counterpart for render.Point. Vector is used for uix.Actor.Position() for the sake of movement math. Vector is flattened back to a render.Point for collision purposes, since the levels and hitboxes are pixel-bound. * Refactor the uix.Actor to no longer extend the doodads.Drawing (so it can have a Position that's a Vector instead of a Point). This broke some code that expected `.Doodad` to directly reference the Drawing.Doodad: now you had to refer to it as `a.Drawing.Doodad` which was ugly. Added convenience method .Doodad() for a shortcut. * Moved functions like GetBoundingRect() from doodads package to collision, where it uses its own slimmer Actor interface for just the relevant methods it needs.
kirsle closed this pull request 2020-04-05 04:08:27 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: SketchyMaze/doodle#20
There is no content yet.