Commit Graph

6 Commits (c1a87e03e6f6253ff466c0ad662f555c18473a12)

Author SHA1 Message Date
Noah c1a87e03e6 Switch JavaScript engine to goja
* Switch from otto to goja for JavaScript engine.
* goja supports many ES6 syntax features like arrow functions,
  const/let, for-of with more coming soon.
* Same great features as otto, more modern environment for doodads!
2022-01-16 20:09:27 -08:00
Noah d8d59fa700 Condensed Palette, Bird AI Update
* The Red Bird now records its original altitude on the level and will
  try and return there should it accidentally climb up or down a wall.
  Sometimes goes into a wavy pattern surrounding its original altitude.
* Editor UI: in the default (vertical) toolbar, the Palette now has a
  two column view to show more color choices on screen at once.
* User setting added: hide the touch control hints.
2021-10-12 20:49:48 -07:00
Noah 2cf8a44b8f Animations for Thief + No More Moonwalking
* Adds walking animations for the Thief.
* Mobile doodads no longer moonwalk: their A.I. used to wait for the
  animation to finish before setting the appropriate animation, so when
  it changed directions it would "moonwalk" for a time. Their A.I. is
  now updated to cancel the animation if they change directions so to
  immediately play the correct animation.
2021-09-03 19:54:10 -07:00
Noah a40cc0602e Thief and Inventory APIs
This commit adds the Thief character with starter graphics
(no animations).

The Thief walks back and forth and will steal items from other
doodads, including the player. For singleton items that have no
quantity, like the Colored Keys, the Thief will only steal one
if he does not already have it. Quantitied items like the
Small Key are always stolen.

Flexibility in the playable character is introduced: Boy,
Azulian, Bird, and Thief all respond to playable controls.
There is not currently a method to enable these apart from
modifying balance.PlayerCharacterDoodad at compile time.

New and Changed Doodads

* Thief: new doodad that walks back and forth and will steal
  items from other characters inventory.
* Bird: has no inventory and cannot pick up items, unless player
  controlled. Its hitbox has also been fixed so it collides with
  floors correctly - not something normally seen in the Bird.
* Boy: opts in to have inventory.
* Keys (all): only gives themselves to actors having inventories.

JavaScript API - New functions available

* Self.IsPlayer() - returns if the current actor IS the player.
* Self.SetInventory(bool) - doodads must opt-in to having an
  inventory. Keys should only give themselves to doodads having
  an inventory.
* Self.HasInventory() bool
* Self.AddItem(filename, qty)
* Self.RemoveItem(filename, qty)
* Self.HasItem(filename)
* Self.Inventory() - returns map[string]int
* Self.ClearInventory()
* Self.OnLeave(func(e)) now receives a CollideEvent as parameter
  instead of the useless actor ID. Notably, e.Actor is the
  leaving actor and e.Settled is always true.

Other Changes

* Play Mode: if playing as a character which doesn't obey gravity,
  such as the bird, antigravity controls are enabled by default.
  If you `import antigravity` you can turn gravity back on.
* Doodad collision scripts are no longer run in parallel
  goroutines. It made the Thief's job difficult trying to steal
  items in many threads simultaneously!
2021-08-09 22:42:22 -07:00
Noah 375af544a7 Doodads: Use Key and Working Warp Doors
* The "Use Key" (Q or Spacebar) now activates the Warp Door instead of a
  collision event doing so.
* Warp Doors are now functional: the player opens a door, disappears,
  the door closes; player is teleported to the linked door which opens,
  appears the player and closes.
* If the player exits thru a Blue or Orange door which is disabled
  (dotted outline), the door still opens and drops the player off but
  returns to a Disabled state, acting as a one-way door.
* Clean up several debug log lines from Doodle and doodad scripts.
2021-01-03 15:19:21 -08:00
Noah fae8c1af5e Doodads: Warp Doors, Bird, Larger State Blocks
* The blue and orange ON/OFF state blocks have all been increased in
  size to better match the player character (42x42 up from 33x33)
* Added a new mob: the Red Bird. It flies back and forth while
  maintaining its altitude, similar to the Red Azulian. Planned AI
  behavior is to divebomb the player when it gets close. Dive sprites
  are included but not yet hooked up in JavaScript.
* Warp Doors! (WIP). They have a golden "W" on them and come in three
  varieties: Brown, Blue and Orange. The blue and orange ones are
  sensitive to the State Block and will become dotted outlines when
  inactive (and can not be entered in this state). The door opens for
  the player character, makes him disappear, then closes again. The plan
  is it will then warp you to the location of a linked Warp Door
  elsewhere on the level, but for now it will just make the player
  re-appear after completing the Close Door animation.
2020-12-29 20:31:35 -08:00