Commit Graph

36 Commits

Author SHA1 Message Date
HyperOnion 1dcae8d8c6 add world utility function for setting tiles to empty. 2023-06-28 15:18:24 +02:00
HyperOnion e3b91c2341 make representation of empty tiles consistent.
previously, world generation would represent empty tiles as the number
0, while other code would expect them to be an object with its `type`
property set to `"empty"`. the object representation is now used
consistently.
2023-06-28 15:18:24 +02:00
HyperOnion 03e5e03665 recursively update tiles within boxes. 2023-06-28 15:18:24 +02:00
HyperOnion 7845e87e05 improve grass growth.
grass now checks all adjacent tiles when attempting to grow.
2023-06-28 15:18:24 +02:00
HyperOnion 3851a9f67a initial grass test.
start working on tile updating code; add grass as test & demo for this.
add temporary "texture" for grass, and keybind for creating it.
2023-06-28 15:18:24 +02:00
HyperOnion 56bfd99796 fix typo in iter_2d.
replace two "for in array" loops with "for of array" loops. the former gives indexes
as strings, whereas the latter gives the actual array items.
2023-06-28 15:18:24 +02:00
HyperOnion 7a86687941 add todo list and todo item. 2023-06-28 15:18:24 +02:00
HyperOnion d5564b5dfe fix readme formatting typo. 2023-06-28 15:18:24 +02:00
HyperOnion 2e3396c751 add various rambles to readme. 2023-06-28 15:18:24 +02:00
HyperOnion e1abb85dc9 rewrite readme info about exiting boxes. 2023-06-28 15:18:24 +02:00
HyperOnion a2fd4440bf don't render box contents if they would be small enough to be invisible. 2023-06-28 15:18:24 +02:00
HyperOnion 3e84eefaba refactor graphics code.
separate tile drawing from box/world drawing, and simplify some of the
math.
2023-06-28 15:18:24 +02:00
HyperOnion e0d4c823d1 track nesting depth in boxes. 2023-06-28 15:18:24 +02:00
HyperOnion 0b7fe53553 fix world save & load bug.
previously, serialization of world data couldn't handle boxes, since
they contain references to their parents, meaning worlds are cyclic.
this commit fixes this, and changes world loading to correctly re-assign
parents to boxes after deserializing them.

this bug is what happens when you commit without testing for more than a
few seconds.
2023-06-28 15:18:24 +02:00
HyperOnion ec1b4f6bea fix worlds with boxes not saving & loading due to cyclic references. 2023-06-28 15:18:24 +02:00
HyperOnion 4b1ae32bb1 add autosave and world reset button. 2023-06-28 15:18:24 +02:00
HyperOnion 4a858f5592 fix unnoticeable bug in world creation code. 2023-06-28 15:18:24 +02:00
HyperOnion b92951a4cc implement saving and loading world data to file. 2023-06-28 15:18:24 +02:00
HyperOnion 8cd629bc5e add keys for more paint colors. 2023-06-28 15:18:24 +02:00
HyperOnion 4fefdfdbb2 add demo video. 2023-06-28 15:18:24 +02:00
HyperOnion 99104f6557 create readme. 2023-06-28 15:18:24 +02:00
HyperOnion 5f2c64f0e0 add more temp controls for experimenting. 2023-06-28 15:18:24 +02:00
HyperOnion 33f980bc7c tiny refactor of entity code. 2023-06-28 15:18:24 +02:00
HyperOnion e4ea5ee3ae handle out of bounds positions in tile manipulation functions. 2023-06-28 15:18:24 +02:00
HyperOnion 7341877447 make box checkerboard floors line up nicely. 2023-06-28 15:18:24 +02:00
HyperOnion 9fd2b0e21b create basic paint tile type and some controls for creating paint. 2023-06-24 14:15:27 +02:00
HyperOnion 204075465c recursively draw box contents inside of them. 2023-06-24 14:15:27 +02:00
HyperOnion b2b4d9dced implement basic box entering and exiting in entity movement. 2023-06-24 14:15:27 +02:00
HyperOnion 68c93726f0 refactor world code to no longer assume the player entity:s pov. 2023-06-24 14:15:27 +02:00
HyperOnion c8e8d7eb70 begin refactoring movement logic out of player code into entity code. 2023-06-24 14:15:27 +02:00
HyperOnion 96678ea5a2 remove dead comment. 2023-06-24 14:15:27 +02:00
HyperOnion 9deb3b024a change canvas size to be a power of 9. 2023-06-24 14:15:27 +02:00
HyperOnion fbf0960e7e create entity module and refactor player into entity. 2023-06-24 14:15:27 +02:00
HyperOnion f7caf8a3a8 implement basic box functionality. 2023-06-24 14:15:27 +02:00
HyperOnion b4976a0d94 basic player movement and general cleanup. 2023-06-24 14:15:27 +02:00
HyperOnion 82a1cd243a get basic graphics set up. 2023-06-24 14:15:27 +02:00