Commit Graph

24 Commits

Author SHA1 Message Date
c5cea8dcb3 partial refactoring so we use EnemyMap.t for collection of enemies 2025-02-13 13:36:30 +00:00
4c8b404c09 add code so that bat also moves vertically (in addition to previous horizontal movement) when updating enemy state 2025-02-12 00:25:55 +00:00
9e9675aaab decrease memory consumption of quad tree by refraining from storing bounding box metadata (except for the global root which stores the width and height) 2025-02-01 01:03:57 +00:00
547b5bac97 use an immutable vector (always of length 4) for representing quad tree's internal nodes 2025-01-31 06:24:51 +00:00
76c5f9d662 change maxSize of quad tree's leaf nodes (from a max length of 3 to a max length of 9) 2025-01-31 06:01:02 +00:00
a6b04ff98e implement functor to fold over quad tree 2025-01-29 07:34:48 +00:00
7138a05cd3 move quad tree helper functions which are useful in quad-tree.sml and will be useful in quad-tree-fold.sml, to quad-tree-type.sml, so quad-tree.sml only exports public API suitable for users 2025-01-29 07:07:54 +00:00
9b7d7a1396 fix compile errors after previous commit (which involved reimplementing the quad tree to eliminate the possibility of a class of bugs I was experiencing; the problem was that the quad bounds were being passed recursively in different functions, but the long argument list in these functions made it difficult to see where the mismatch was) 2025-01-27 23:41:59 +00:00
6369be21fa tentatively refactor quad tree to make it more succinct + eliminate a class of potential bugs (passing wrong quad values through recursion) 2025-01-27 23:27:52 +00:00
42b42220d0 fully restructure quad tree from one that holds overlapping items in parent nodes, into one that holds overlapping items in each quadrant instead 2025-01-27 06:04:52 +00:00
b7a609b447 fix quad tree queries (queries should not choose only one quadrant because they may validly visit two or more quadrants if query covers two leaf nodes), resulting in regressions. Fix one regression: reimplement wall patches (this time also optimised because there is no intgermediary list) 2025-01-27 04:52:49 +00:00
e644160e38 enemy dropping below platform (without any bugs) is fully implemented now 2025-01-23 01:06:16 +00:00
84ea0ce24b code functor to fold through a specified region of the quad tree, without having to allocate an intermediary list or using a closure (which both have runtime costs) 2025-01-18 22:54:34 +00:00
560ef3f99a add function to get ID of first item found at location in quad tree (returns ~1 instead of NONE if no item is found) 2025-01-17 21:48:18 +00:00
75e28b892e done getting player's projectiles to collide with enemies successfully, and tested (although the code of the enemy reacting to the player is not the best) 2025-01-11 21:35:55 +00:00
0367b3a23c progress detecting collision between enemy and player's projectile, and decrementing enemy's health once detected 2025-01-11 13:45:29 +00:00
8344138c55 add function to quad tree to get only bottom-side queries 2024-12-17 22:04:46 +00:00
cc7f30f718 add GameType.game_type which stores player and wall types, add GameUpdate.update function which takes a game type and returns a new game type, and refactor player/wall files, and gl-draw file, in light of these changes 2024-12-15 09:10:19 +00:00
9144c97fba get player to react to wall quad tree 2024-12-13 22:48:34 +00:00
a1b8aead30 complete function to get collision sides in quad tree 2024-12-10 08:42:36 +00:00
7dbacd4792 add function to return which side a collision occurs at 2024-12-09 07:05:21 +00:00
244640c1d6 add signature to quad-tree.sml, making it an opaque module 2024-12-09 00:23:00 +00:00
068f0277b9 add function to get list of collision object from quad tree 2024-12-08 23:38:50 +00:00
6f14edd528 code insert function for quad tree 2024-12-07 11:12:19 +00:00