Commit Graph

4 Commits (38614ee2807cfc59dcc48299702e2f96bd640afd)

Author SHA1 Message Date
Noah 38614ee280 Tighten Doodad JavaScript API, User Documentation
* Tightens up the surface area of API methods available to the
  JavaScript VMs for doodads. Variables and functions are carefully
  passed in one-by-one so the doodad script can only access intended
  functions and not snoop on undocumented APIs.
* Wrote tons of user documentation for Doodad Scripts: documented the
  full surface area of the exposed JavaScript API now that the surface
  area is known and limited.
* Early WIP code for the Campaign JSON
2020-04-21 23:50:45 -07:00
Noah 08e65c32b5 Overhaul the Platformer Physics System
* 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.
2020-04-04 21:00:32 -07:00
Noah c3d7348843 Inventory System for Level Actors
* Added an inventory system for actors as a replacement to the arbitrary
  key/value data store. Colored keys now add themselves to the player's
  inventory, and colored doors check the inventory.
* Inventory is a map[string]int between doodad filenames
  (red-key.doodad) and quantity (0 for key items/unlimited qty).
* API methods to add and remove inventory.
* Items HUD appears in Play Mode in lower-left corner showing doodad
  sprites of all the items in the Player's inventory.
2020-04-02 23:09:46 -07:00
Noah 3cb99ad5f8 New (Colored) Locked Door Doodads
* Revamped the sprites for the four colored locked doors. They now have
  a side-view profile perspective rather than a front view.
* Doors open facing the left or the right based on what direction the
  colliding actor approached it from.
2020-04-02 21:43:41 -07:00