doodle/pkg/level
Noah Petherbridge 1f00af5741 Collision Detection Fix + Doodad CLI Fixes
Fix collision detection when an actor's hitbox is offset from 0,0:

* Actors having a hitbox that didn't begin at X,Y 0,0 used to experience
  clipping issues with level geometry: because the game tracks their Position
  (top left corner of their graphical sprite) and their target position wasn't
  being correctly offset by their hitbox offset.
* To resolve the issue, an "ActorOffset" struct is added: you give it the
  original game's Actor (with its offset hitbox) and it will record the offset
  and give a mocked Actor for collision detection purposes: where the Position
  and Target can be offset and where its Hitbox claims to begin at 0,0 matching
  its offsetted Position.
* The translation between your original Actor and Offset Actor is handled at the
  boundary of the CollidesWithGrid function, so the main algorithm didn't need
  to be messed with and the game itself doesn't need to care about the offset.

Make some fixes to the doodad CLI tool:

* Fix palette colors being duplicated/doubled when converting from an image.
* The --palette flag in `doodad convert` now actually functions: so you can
  supply an initial palette.json with colors and attributes to e.g. mark which
  colors should be solid or fire and give them names. The palette.json doesn't
  need to be comprehensive: it will be extended with new distinct colors as
  needed during the conversion.
2024-05-27 15:14:00 -07:00
..
giant_screenshot Resolve circular import errors for Doodle++ plugin 2024-04-18 22:12:56 -07:00
publishing Resolve circular import errors for Doodle++ plugin 2024-04-18 22:12:56 -07:00
rle Fix RLE Encoding Off-by-One Errors [PTO] 2024-05-24 13:54:41 -07:00
actor_options.go Slippery Pixels + Update Changelog for 0.13.1 2022-10-10 10:52:28 -07:00
actors.go Slippery Pixels + Update Changelog for 0.13.1 2022-10-10 10:52:28 -07:00
chunk_map.go Code cleanup for RLE compression 2024-05-24 16:43:11 -07:00
chunk_rle.go Code cleanup for RLE compression 2024-05-24 16:43:11 -07:00
chunk_test.go (Experimental) Run Length Encoding for Levels 2024-05-23 23:02:01 -07:00
chunk.go Remove never-used GridType accessor + documentation [PTO] 2024-05-24 16:06:43 -07:00
chunker_migrate.go Code cleanup for RLE compression 2024-05-24 16:43:11 -07:00
chunker_test.go (Experimental) Run Length Encoding for Levels 2024-05-23 23:02:01 -07:00
chunker_zipfile.go Fix RLE Encoding Off-by-One Errors [PTO] 2024-05-24 13:54:41 -07:00
chunker.go Code cleanup for RLE compression 2024-05-24 16:43:11 -07:00
filesystem.go Level Screenshots and Thumbnails 2023-12-08 19:48:02 -08:00
fmt_json.go Unit test fixes and code cleanup 2023-12-02 12:33:14 -08:00
fmt_maintenance.go (Experimental) Run Length Encoding for Levels 2024-05-23 23:02:01 -07:00
fmt_readwrite.go (Experimental) Run Length Encoding for Levels 2024-05-23 23:02:01 -07:00
inflate.go Level Thumbnails on Story Mode Select 2023-12-09 14:59:31 -08:00
page_type.go Add MenuScene with New Level UI 2019-06-25 15:01:37 -07:00
palette_defaults.go Update default level palettes for new pixel attributes 2022-10-10 11:17:11 -07:00
palette.go Collision Detection Fix + Doodad CLI Fixes 2024-05-27 15:14:00 -07:00
screenshot.go Level Screenshots and Thumbnails 2023-12-08 19:48:02 -08:00
swatch.go Collision Detection Fix + Doodad CLI Fixes 2024-05-27 15:14:00 -07:00
types.go D++ Default Author and Embedded Doodads Error 2024-04-18 22:31:11 -07:00