Compare commits

...
Sign in to create a new pull request.

225 commits
Grid ... main

Author SHA1 Message Date
6dead4cc61 Added new Enemy Sprites 2025-10-23 10:07:55 +02:00
77464c39d7 Disabled Debug Cam 2025-10-22 14:09:43 +02:00
8ec8ea59ba Fixed water being cut off on the left 2025-10-22 13:27:21 +02:00
40a80801e7 Debug Cam 2025-10-22 13:22:15 +02:00
b2aa7b2907 Fixed a crash on building destruction 2025-10-22 13:09:12 +02:00
b4dbd50a8f Prevented natural spawn of vines 2025-10-22 03:31:05 +02:00
b75e6be470 Documented and refactored world scripts. 2025-10-22 03:29:21 +02:00
8ca085192d Documented and adjusted vine initialization 2025-10-22 03:04:15 +02:00
808ffb337e Journal no longer contains duplicates
Added some documentation to grid.gd
2025-10-22 02:23:16 +02:00
930d9e6d8e Removed initial load time 2025-10-22 02:04:12 +02:00
248b1915b6 Fixed vines spawning inactively at some point 2025-10-22 01:45:25 +02:00
1ea01c30d6 Fixed a crash in the boss fight 2025-10-21 17:54:43 +02:00
42ea2d3d75 Made vines spawn precisely at unique items 2025-10-21 16:07:22 +02:00
49d48da550 Fundamental adjustments and fixes for vine spawning 2025-10-21 16:06:16 +02:00
8786d30936 Fixed bug in offset calculation 2025-10-17 14:20:42 +02:00
8f2a1146f0 Restricted Petal Spawns to unique items 2025-10-17 12:57:41 +02:00
07b5114f23 Fixed a crash induced by lacking components of enemy hurtboxes 2025-10-17 12:54:05 +02:00
de06759514 Refactored and documented utils 2025-10-15 16:00:47 +02:00
cabc547b51 Refactored and documented UI code 2025-10-14 16:24:45 +02:00
5b880fa1ac Refactored trap code 2025-10-14 16:09:40 +02:00
0072a5e2e3 Documented status code 2025-10-14 15:57:23 +02:00
c2649a6032 Fixed "Play Again" not resetting the grid 2025-10-14 15:07:38 +02:00
14e7fc057f Refactored sword code 2025-10-14 15:05:34 +02:00
2a346363eb Minor refactor in player code 2025-10-14 14:45:39 +02:00
d9dae634ef Refactored player code and added quick access to cardinal directions to EarthALigner 2025-10-14 14:43:38 +02:00
20dea147ba Documented Item Spawn Code 2025-10-14 11:57:01 +02:00
a404950b92 Fixed error in HP display 2025-10-12 18:29:14 +02:00
b2c54a0e14 Refactored and documented item codes. 2025-10-12 18:26:36 +02:00
01ee8f051f Refactored and documented leech and segment code. 2025-10-12 17:59:43 +02:00
75194e1700 Refactored and documented boss spawner, destroy area and ghost 2025-10-12 17:17:09 +02:00
8c11ee3000 Refactored and documented boss code. 2025-10-11 20:02:47 +02:00
60e32002c1 Refactored and documented blob_big.gd 2025-10-11 19:44:05 +02:00
b3b6998e14 Refactoring of blob.gd 2025-10-11 19:37:25 +02:00
c558f31583 Some refactoring and documentation of the building code.
Removed empty background.gd.
2025-10-11 19:30:55 +02:00
28640e94c6 Fixed crash related to status effects 2025-10-11 19:06:46 +02:00
c33d892cf0 Active Vines now apply statusses 2025-10-11 18:22:15 +02:00
786444e789 Turned Grid into an autoload node. Made Buildings persist after death. 2025-10-11 17:36:43 +02:00
a042bb1282 Introduced Status Effects 2025-10-11 16:37:14 +02:00
2acc452f19 Added Vines to non-common item spawns 2025-10-11 12:47:24 +02:00
a1208fa8a4 Vine Spawns on Petal Interaction 2025-10-05 15:01:51 +02:00
d3a46ee779 Fixed vines overlapping with themselves after being extended around the whole planet 2025-10-03 18:21:46 +02:00
c2104f2d24 z_index fix 2025-10-03 17:11:36 +02:00
be1e8a658f Some code cleanup 2025-10-03 17:09:51 +02:00
8d642f694d First Growing Vine 2025-10-03 16:36:28 +02:00
f790694373 Fixed major oopsie 2025-10-03 11:33:13 +02:00
5e2ca5be83 File cleanup and addition of Buds and Vines, yet to obtain functionality 2025-10-03 11:31:45 +02:00
c73dd1dbd6 Building code cleanup 2025-10-03 11:30:45 +02:00
8e9f7723d9 Made Extra Jump unique
Fixed Boss getting stuck during slam
2025-10-02 19:37:56 +02:00
7687844ea6 Increased Health Spawnrate
Fixed Hit Knockback resetting vertical movement
2025-10-02 18:39:10 +02:00
7186482a3f Fixed Upslash + Backslash interaction 2025-10-02 18:31:42 +02:00
7451279024 Bug Fixes for updash and horizontal dash 2025-10-02 18:28:10 +02:00
e2ccf87792 Fixed a crash on item collection 2025-10-02 18:12:42 +02:00
f6d2c22e84 Removed Bow from common item pool (oopsie) 2025-10-02 18:01:55 +02:00
85f7d32f71 Added indicator for remaining uses of active item 2025-10-02 17:59:23 +02:00
697e5ad9e4 Fixed attack knockback for upslash and backslash 2025-10-02 15:26:45 +02:00
9b05276ad6 Attack Knockback + Controller Keybinds 2025-10-02 15:08:59 +02:00
2d2b63fd74 Fixed a bug desyncing weapon direction and weapon hitbox. Removed angle from FPS counter. 2025-10-02 14:06:25 +02:00
beb0b697ea Added color modulated background 2025-09-24 17:43:16 +02:00
8740b632a1 Added grass 2025-09-24 16:37:34 +02:00
f98c89ef94 Adjusted item sizes 2025-09-24 16:13:48 +02:00
e37c27a280 Fixed the build 2025-09-23 18:46:21 +02:00
0020947533 Added item journal 2025-09-23 17:40:50 +02:00
cf69b51ea8 Additional keybinds for WASD + Mouse Scheme 2025-09-23 15:52:33 +02:00
bd42aa7963 Proper Item Pool Handling 2025-09-23 15:50:34 +02:00
408fbb40e3 Modified Damage Behavior and Item Spawn Rate 2025-09-23 15:10:45 +02:00
a42d798490 Adjusted damage behavior against enemies 2025-09-23 13:36:19 +02:00
39df6cd554 Unlocked framerate 2025-09-23 12:36:15 +02:00
28a6e98d3d Adjusted Item Spawnrates + Boss HP 2025-09-23 12:20:33 +02:00
7265c16a2f Adjustments to horizontal dash 2025-09-22 17:42:23 +02:00
f9075777e8 Adjusted Player Hit iframes 2025-09-22 17:33:52 +02:00
39b825f572 Added ends to leeches 2025-09-22 17:32:54 +02:00
0b03dda8a3 Minor changes to draw order and ceiling height 2025-09-22 17:13:50 +02:00
561962cca9 Added Leech Sprite, fixed platform dropdown jank 2025-09-22 17:03:48 +02:00
88bd17c8c3 Smoothened Leeches + increased Player jump height 2025-09-22 15:39:58 +02:00
ffd8e6b857 Added horizontal dash 2025-09-20 12:42:20 +02:00
bee56c2ce5 Fixed Backslash Size 2025-09-20 02:38:45 +02:00
bffe842d49 Fixed unique items not spawning outside of main menu 2025-09-20 02:20:43 +02:00
102fd4f34a "Fixed" my editor bug and fixed arrow facing right when shot to the left 2025-09-20 01:15:57 +02:00
c314000857 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-19 15:33:50 +02:00
058f01c305 Fix 2025-09-19 15:35:40 +02:00
51a1d884f0 Wrapup 2025-09-19 15:34:59 +02:00
d59e4eddc0 Increased arrow damage and added export templates 2025-09-19 15:33:21 +02:00
f0740fdca0 Giant Leech Room 2025-09-19 15:20:23 +02:00
565fbfcc8e Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-19 15:13:18 +02:00
d34ecc35e4 Added victory screen 2025-09-19 15:12:56 +02:00
603dc76e63 Boss Sounds 2025-09-19 15:12:35 +02:00
02edf033fe Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-19 14:59:52 +02:00
8963841341 Boss Deathsound 2025-09-19 14:58:59 +02:00
9be3c02117 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-19 14:58:11 +02:00
b0b1d35473 Added sounds for high jump pickup and boss slam 2025-09-19 14:55:31 +02:00
38eb4d8c72 Bear Trap Sprite + Typo 2025-09-19 14:54:13 +02:00
353160794a Added High Jump and more sounds 2025-09-19 14:42:16 +02:00
56f3336cab Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-19 13:43:31 +02:00
5d63488c95 Removed Boss from Main 2025-09-19 13:43:02 +02:00
9cb4015303 Boss Sprite 2025-09-19 13:42:23 +02:00
4699a8f22c Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-19 12:42:53 +02:00
6d1086848e Changed updash pickup sound volume 2025-09-19 12:42:13 +02:00
a3d119294f Fixed Player Animation 2025-09-19 12:24:23 +02:00
b30465742f Fixed walk animation 2025-09-19 12:16:17 +02:00
af14ac6fee Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-19 12:09:10 +02:00
5d92732c6f Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-19 12:09:50 +02:00
3ab73d7a37 Minor visual change 2025-09-19 12:09:12 +02:00
a8f92305ec Attack animation 2025-09-19 12:08:35 +02:00
ec6c4a774d Debunked flat-earthers 2025-09-19 12:08:28 +02:00
e3d6d956fc Added intro text 2025-09-19 12:02:17 +02:00
e73b3f01ff Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-19 11:26:55 +02:00
83e6f059b5 Leech gravity 2025-09-19 11:26:39 +02:00
968c7ca450 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-19 11:19:14 +02:00
bd873a4c39 Added arrow texture 2025-09-19 11:18:29 +02:00
6cd4de5fe6 Bow Sprite 2025-09-19 11:08:11 +02:00
c89fbae042 Made wave adjust to height and fixed boss sounds 2025-09-19 10:32:55 +02:00
0c0decb12b Fixed Audio breaking the entire game 2025-09-19 10:14:17 +02:00
16d9639dd1 Added some sound effects 2025-09-19 03:33:03 +02:00
550f3c1e2f Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-19 02:12:58 +02:00
205e8740f9 Many new item sprites 2025-09-19 02:12:28 +02:00
07c875c249 spam 2025-09-19 00:20:27 +02:00
c05ea7ff0f Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-19 00:20:12 +02:00
27b5d5115a Introduced maximum build height 2025-09-19 00:18:49 +02:00
3379f148c3 Easier dropping 2025-09-18 23:51:27 +02:00
54d183c245 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-18 23:29:00 +02:00
e2420fffbd Made boss spawn and fixed main menu button on death screen 2025-09-18 23:23:57 +02:00
ec20efd4f3 Custom Font 2025-09-18 23:23:44 +02:00
1a238bdf32 Water Color 2025-09-18 23:01:14 +02:00
ec43fc4a3e Folder structure 2025-09-18 22:57:36 +02:00
a1042a826c Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-18 22:56:43 +02:00
e5260c4c05 done stuff?? 2025-09-18 22:56:04 +02:00
bf5233d824 Connected Boss Fight 2025-09-18 20:34:11 +02:00
0b843960c4 removed debug stuff 2025-09-18 20:16:53 +02:00
58bed67228 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-18 20:14:01 +02:00
1fc1aa3ca9 Implemented rise water attack 2025-09-18 20:13:48 +02:00
85eee00790 Added splash attack 2025-09-18 20:09:53 +02:00
a647505e37 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-18 19:37:20 +02:00
8c0deb42a2 Attempted to use the particle system 2025-09-18 19:35:52 +02:00
36666f4e78 Boss in Main Scene Fixed 2025-09-18 18:30:14 +02:00
07e54a2cdf Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-18 18:13:12 +02:00
ebc9a77acb Added Boss
Added Giant Leech
2025-09-18 18:10:44 +02:00
798e64e284 Included Graphics 2025-09-18 17:47:49 +02:00
fe4d719624 Wrote method "create_tsunami" 2025-09-18 15:43:44 +02:00
ba48534c65 Added "water" 2025-09-18 14:49:30 +02:00
714ea48554 Extra Jump 2025-09-18 11:22:03 +02:00
65ba4684ea Hit Flash 2025-09-18 03:09:00 +02:00
ad2e1bc692 Added Ghost animation, removed leech debug material 2025-09-18 02:57:31 +02:00
434fc41db4 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth and Leeches!! 2025-09-18 02:53:20 +02:00
517eb56063 Leech Prototype 2025-09-18 00:32:37 +02:00
e5e54a7127 More room layouts and fixed unique items 2025-09-17 23:43:52 +02:00
4f35cb88f2 Connected the last few buttons. Done with UI! 2025-09-17 19:55:21 +02:00
f4ca41ae09 spam 2025-09-17 19:27:06 +02:00
26af582cf2 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-17 19:26:16 +02:00
accf24ea08 Added Main Menu 2025-09-17 19:25:22 +02:00
eefd58da42 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-17 18:25:58 +02:00
d8fa672b90 Folder structure + Backslash Item 2025-09-17 18:23:42 +02:00
b9e8da7a7c Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-17 18:07:21 +02:00
267787c67e Performed a summoning ritual for initial buildings (also resized some
sprites)
2025-09-17 18:05:43 +02:00
8fbaf0c282 Healthbar Sprites 2025-09-17 17:51:54 +02:00
040bbdc677 Minor item pickup fix 2025-09-17 17:27:27 +02:00
16718459df Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-17 17:19:09 +02:00
4c8a152ca5 Fixed Cooldowns changing when trying to pick up items 2025-09-17 17:18:28 +02:00
50b262bc36 Allowed discarding items 2025-09-17 17:04:16 +02:00
0c1b7b9270 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-17 16:49:06 +02:00
51a5418c82 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-17 16:48:57 +02:00
5410aa51e4 Texture files + final knockback fix 2025-09-17 16:43:44 +02:00
17142e2a5b Made the item display work (incl. cooldown) 2025-09-17 16:41:29 +02:00
82acee9e00 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-17 15:59:41 +02:00
aec5133150 Broke Activ Items 2025-09-17 15:59:14 +02:00
fae00cfe1f Fixed morning star knockback 2025-09-17 15:20:02 +02:00
8c6f4ec327 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-17 15:13:43 +02:00
26b7bee6fc Added Bow
Fixed Ghost Knockback being all over the place
2025-09-17 15:10:13 +02:00
5658b57749 Made hp bar aware of max hp 2025-09-17 14:39:22 +02:00
fc55aa4c09 Fixed dependencies 2025-09-17 14:08:57 +02:00
a8f61bfce3 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-17 14:06:20 +02:00
d58b54d138 Fixed Item Spawn crash 2025-09-17 14:05:11 +02:00
40217226b9 Fixed Heal Item, added Healthup Item, Folder structure improvements 2025-09-17 14:03:37 +02:00
e923619977 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-17 13:00:15 +02:00
4be01c1aa1 Added Active Items, an Updash Item and the possibility for items to not be immediately connected 2025-09-17 12:57:04 +02:00
bb0fda15d4 Fixed Item Alignment 2025-09-17 12:53:16 +02:00
5fe2772097 Intergrated ItemSpawn into the game 2025-09-17 12:37:09 +02:00
f19bda7886 Fixed platform drop, added heal item 2025-09-17 12:19:19 +02:00
16103c15b2 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-17 12:18:16 +02:00
68b7c1a298 Added ItemSpawn 2025-09-17 12:17:32 +02:00
0c6003a4b3 Removed a print 2025-09-17 11:15:54 +02:00
45fa950595 Platform Dropdown 2025-09-17 11:15:00 +02:00
ba473f9d0d Fixed enemies persisting on restart 2025-09-17 10:41:09 +02:00
9134c32d2c Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-17 02:41:53 +02:00
0257dc0770 Ceiling Platforms for the two buildings + some room layout 2025-09-17 02:29:35 +02:00
c19f0f5a3b Automatic curved positioning of objects in buildings 2025-09-17 01:42:14 +02:00
dd0aef3469 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-16 23:45:09 +02:00
f7e79ddd56 godot changed random stuff 2025-09-16 23:42:55 +02:00
8f17240cba Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-16 23:42:50 +02:00
4576cb8972 Platform, Sprites and flying debug building 2025-09-16 23:42:09 +02:00
d4a67336d6 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-16 23:38:19 +02:00
9160f7240f Made a proper death-screen 2025-09-16 23:37:45 +02:00
d8da52ca2f Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-16 20:18:01 +02:00
3954225bf2 Morning Star zindex 2025-09-16 20:17:34 +02:00
8c5d3cc126 Fixed building sprite bounding box 2025-09-16 19:47:32 +02:00
be1aa59c7f Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-16 19:43:54 +02:00
ace2285c80 started death screen 2025-09-16 19:34:30 +02:00
a556897413 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-16 19:20:21 +02:00
3db72dcd53 File Structure Fix 2025-09-16 19:13:11 +02:00
ce99e4c2ee Morning Star 2025-09-16 19:12:40 +02:00
87b1c2c9ba Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-16 18:12:21 +02:00
00e2793a53 Made rendering buildings more efficient 2025-09-16 18:11:54 +02:00
5dca64d944 New character sprites 2025-09-16 18:01:04 +02:00
cf2dd03dc0 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-16 16:47:46 +02:00
ffbf1dc287 fixed an upsi 2025-09-16 16:47:35 +02:00
165809dd76 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-16 16:42:23 +02:00
c1efbf1a5f Removed a print 2025-09-16 16:40:54 +02:00
ea0917f3dc Made ghost and player appear on top of buildings 2025-09-16 16:39:03 +02:00
17bcdb6214 Made haunted houses make up half of all spawns 2025-09-16 16:29:02 +02:00
b3b8ba3304 Made buildings EnemyList more robust 2025-09-16 16:24:53 +02:00
85c16a2d69 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-16 16:14:56 +02:00
906cd25871 Made Every building come with a ghost 2025-09-16 16:13:14 +02:00
10e87b8d73 Limited Ghost Aggression 2025-09-16 15:43:35 +02:00
root
c67eec8e05 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-16 15:20:48 +02:00
root
b4635e81d0 Parameter adjustments 2025-09-16 15:19:57 +02:00
385c62818e Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-16 15:16:12 +02:00
5cb035656d did building generation and a healthbar 2025-09-16 15:12:40 +02:00
root
c1268be3a5 Sword Attack and Knockback 2025-09-16 14:59:40 +02:00
20530bfd32 changed folder structure 2025-09-16 12:02:37 +02:00
02fc67cb37 Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth 2025-09-16 11:45:11 +02:00
0dbdca8efb Made buildings spawn randomly 2025-09-16 11:44:16 +02:00
root
ae56d78b22 More player adjustments, Node for aligning to earth center 2025-09-16 11:41:34 +02:00
11bd9d46fd Merge branch 'Grid' 2025-09-16 11:04:54 +02:00
root
9a23e5c8df Character script cleanup, parameter adjustments, etc 2025-09-16 10:28:02 +02:00
root
6432ac8b13 Player Health, Ghost Enemy 2025-09-16 00:28:49 +02:00
root
370424a696 Initial Player Scene 2025-09-15 19:15:43 +02:00
376 changed files with 8786 additions and 144 deletions

BIN
Witchwoode-Regular.ttf Normal file

Binary file not shown.

View file

@ -0,0 +1,36 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://bi8hie1rxoieb"
path="res://.godot/imported/Witchwoode-Regular.ttf-bd7e89948f14c769586bf11e9355d4c0.fontdata"
[deps]
source_file="res://Witchwoode-Regular.ttf"
dest_files=["res://.godot/imported/Witchwoode-Regular.ttf-bd7e89948f14c769586bf11e9355d4c0.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
modulate_color_glyphs=false
hinting=1
subpixel_positioning=4
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View file

@ -0,0 +1,49 @@
[gd_scene load_steps=6 format=3 uid="uid://bcph46qvs6s1"]
[ext_resource type="Script" uid="uid://c6q1tgl7kag67" path="res://background/background.gd" id="1_gsnt7"]
[ext_resource type="Texture2D" uid="uid://bk0lxjv2qjxnp" path="res://world/Background Prototype/Background Prototype Layer 1.png" id="1_qjy44"]
[ext_resource type="Texture2D" uid="uid://b3d276mpm5mqr" path="res://world/Background Prototype/Background Prototype Layer 4.png" id="2_eva80"]
[ext_resource type="Texture2D" uid="uid://b6fkgig57ki5j" path="res://world/Background Prototype/Background Prototype Layer 2.png" id="2_gsnt7"]
[ext_resource type="Texture2D" uid="uid://tctuwr3rmof4" path="res://world/Background Prototype/Background Prototype Layer 3.png" id="3_3phoi"]
[node name="Background" type="Node2D"]
script = ExtResource("1_gsnt7")
[node name="Parallax2D" type="Parallax2D" parent="."]
scroll_scale = Vector2(0.1, 0.1)
repeat_size = Vector2(1920, 1080)
repeat_times = 2
[node name="Sprite2D" type="Sprite2D" parent="Parallax2D"]
position = Vector2(960, 540)
scale = Vector2(2, 2)
texture = ExtResource("1_qjy44")
[node name="Parallax2D2" type="Parallax2D" parent="."]
scroll_scale = Vector2(0.4, 0.4)
repeat_size = Vector2(1920, 1080)
repeat_times = 2
[node name="Sprite2D" type="Sprite2D" parent="Parallax2D2"]
position = Vector2(960, 540)
scale = Vector2(2, 2)
texture = ExtResource("2_gsnt7")
[node name="Parallax2D3" type="Parallax2D" parent="."]
scroll_scale = Vector2(0.7, 0.7)
repeat_size = Vector2(1920, 1080)
repeat_times = 2
[node name="Sprite2D" type="Sprite2D" parent="Parallax2D3"]
position = Vector2(960, 540)
scale = Vector2(2, 2)
texture = ExtResource("3_3phoi")
[node name="Parallax2D4" type="Parallax2D" parent="."]
repeat_size = Vector2(1920, 1080)
repeat_times = 2
[node name="Sprite2D" type="Sprite2D" parent="Parallax2D4"]
position = Vector2(960, 540)
scale = Vector2(2, 2)
texture = ExtResource("2_eva80")

13
background/bg_image.gd Normal file
View file

@ -0,0 +1,13 @@
extends TextureRect
@export var colors : Array[Color] = [Color(0.3, 1, 1) * 0.7, Color(1, 0.6, 0.6) * 0.7, Color(1, 1, 1) * 0.7]
# Modulate the background with an interpolation of the colors in the list,
# depending on the players position on the earth.
func _process(_delta: float) -> void:
var index : int = floor((%Player.position.angle() + PI)/ TAU * colors.size())
var diff = (%Player.position.angle() + PI)/ TAU * colors.size() - index
self.modulate = linear_color_interpolation(colors[index], colors[(index + 1) % colors.size()], diff)
func linear_color_interpolation(c1 : Color, c2 : Color, t : float):
return c1 + (c2 - c1) * t

View file

@ -0,0 +1 @@
uid://gul4u5tw1vxk

View file

@ -1,27 +0,0 @@
class_name Building extends Node2D
var location : Vector2i # x is the angle, y is the height in the grid
var dimension : Vector2i = Vector2.ONE # same as above
@onready var grid : Grid = get_parent()
# make sure location is set before adding a building to the scene tree
# also make sure that the buildings are instantiated as children of the grid
func _ready() -> void:
var angle = location.x * TAU / grid.num_collumns; # currently assumes anchor is bottom left
var height = grid.ground_radius + location.y * grid.cell_height;
position = height * Vector2.from_angle(angle)
print(angle, " ", height, " ", position)
func overlaps(other : Building):
# heights don't overlap
if location.y >= other.location.y + other.dimension.y: return false # other is below
if location.y + dimension.y <= other.location.y: return false # other is above
# angles overlap. We can now assume heights overlap
var relative_other_loc = (other.location.x - location.x + grid.num_collumns) % grid.num_collumns
if dimension.x > relative_other_loc: return true
if relative_other_loc + other.dimension > grid.num_collumns: return true
# If we get here, angles do not overlap
return false

View file

@ -1,23 +0,0 @@
[gd_scene load_steps=6 format=3 uid="uid://djawvtdwp423v"]
[ext_resource type="Script" uid="uid://b2ji03ekijjnn" path="res://building.gd" id="1_5j34s"]
[ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="2_2yopf"]
[ext_resource type="Shader" uid="uid://c7gb1nqwvkr37" path="res://building.gdshader" id="2_f1gjg"]
[ext_resource type="Script" uid="uid://dj7d4d2xs3nci" path="res://building_mesh.gd" id="4_qnfc1"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_qnfc1"]
resource_local_to_scene = true
shader = ExtResource("2_f1gjg")
shader_parameter/ground_height = 3000.0
shader_parameter/cell_height = 300.0
shader_parameter/num_cells = 60
[node name="Building" type="Node2D"]
script = ExtResource("1_5j34s")
[node name="Sprite2D" type="Sprite2D" parent="."]
self_modulate = Color(0.1764706, 0, 0.003921569, 0.003921569)
material = SubResource("ShaderMaterial_qnfc1")
scale = Vector2(7, 7)
texture = ExtResource("2_2yopf")
script = ExtResource("4_qnfc1")

View file

@ -1,7 +0,0 @@
extends Sprite2D
func _ready() -> void:
var location = Vector2i(get_parent().location)
var dimension = Vector2i(get_parent().dimension)
print(location, dimension)
self_modulate = Color8(location.x, location.y, dimension.x, dimension.y)

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://djir4ehm8kif"
path="res://.godot/imported/Building 1x2 fixed.png-e90afc0d25a8919ada570064ed667de1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://buildings/Building 1x2 fixed.png"
dest_files=["res://.godot/imported/Building 1x2 fixed.png-e90afc0d25a8919ada570064ed667de1.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://3weywjfsapax"
path="res://.godot/imported/Building 2x1 downside.png-4b432eb4152bab7dd594f2976783dfd3.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://buildings/Building 2x1 downside.png"
dest_files=["res://.godot/imported/Building 2x1 downside.png-4b432eb4152bab7dd594f2976783dfd3.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dfy0gccqgggp2"
path="res://.godot/imported/Building 2x1 fixed.png-b02748fa52aebae62f987c8fd86c364f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://buildings/Building 2x1 fixed.png"
dest_files=["res://.godot/imported/Building 2x1 fixed.png-b02748fa52aebae62f987c8fd86c364f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

43
buildings/building.gd Normal file
View file

@ -0,0 +1,43 @@
class_name Building extends Node2D
@export var location : Vector2i # x is the angle, y is the height in the grid
@export var dimension : Vector2i = Vector2(2, 1) # same as above
@export var blocks_area = true
var objects = []
var destroyed = false
# make sure location is set before adding a building to the scene tree
# also make sure that the buildings are instantiated as children of the grid
func _ready() -> void:
global_position = Grid.get_world_position(location)
if blocks_area:
Grid.buildings.append(self)
if get_node_or_null("ObjectList") != null:
var obj_list = $ObjectList
Grid.call_deferred("place_object_list", obj_list, self)
func overlaps(other : Building):
# heights don't overlap
if location.y >= other.location.y + other.dimension.y: return false # other is below
if location.y + dimension.y <= other.location.y: return false # other is above
# angles overlap. We can now assume heights overlap
var relative_other_loc = (other.location.x - location.x + Grid.num_collumns) % Grid.num_collumns
if dimension.x > relative_other_loc: return true
if relative_other_loc + other.dimension.x > Grid.num_collumns: return true
# If we get here, angles do not overlap
return false
func destroy():
if not destroyed:
# On destruction, the building is removed from the list and destroyed together with all its objects.
Grid.buildings.remove_at(Grid.buildings.find(self))
for object in objects:
if object != null and not ("collected" in object and object.collected):
object.queue_free()
destroyed = true
queue_free()

View file

@ -11,11 +11,16 @@ varying vec2 world_position;
void vertex() void vertex()
{ {
location = ivec2(128. * COLOR.xy);
dimension = ivec2(128. * COLOR.zw);
vec2 myloc = vec2(location) + UV * (vec2(dimension) + vec2(0., .5));
float angle = float(myloc.x) * TAU / 60.;
float height = float(myloc.y) * cell_height + ground_height;
VERTEX = vec2(cos(angle), sin(angle)) * height;
//VERTEX = myloc;
VERTEX = (inverse(MODEL_MATRIX) * vec4(VERTEX, 0, 1)).xy;
world_position = (MODEL_MATRIX * vec4(VERTEX, 0.0, 1.0)).xy; world_position = (MODEL_MATRIX * vec4(VERTEX, 0.0, 1.0)).xy;
location = ivec2(256. * COLOR.xy);
dimension = ivec2(256. * COLOR.zw);
//location = ivec2(45, 1);
//dimension = ivec2(1, 1);
} }
void fragment() { void fragment() {
@ -23,13 +28,15 @@ void fragment() {
float angle = atan(world_position.y, world_position.x); float angle = atan(world_position.y, world_position.x);
float sample_y = 1. - ((radius - ground_height) / cell_height - float( location.y)) / float(dimension.y); float sample_y = 1. - ((radius - ground_height) / cell_height - float( location.y)) / float(dimension.y);
sample_y = 1. - (1. - sample_y) * 0.97;
float sample_x = mod(fract(angle / TAU + 1.) * float(num_cells) - float(location.x) + float(num_cells), float(num_cells)) / float(dimension.x); float sample_x = mod(fract(angle / TAU + 1.) * float(num_cells) - float(location.x) + float(num_cells), float(num_cells)) / float(dimension.x);
if(sample_y > 1. || sample_y < 0. || sample_x > 1. || sample_x < 0.) { if(sample_y > 1. || sample_y < 0. || sample_x > 1. || sample_x < 0.) {
discard; discard;
} }
COLOR = texture(TEXTURE, vec2(sample_x, sample_y)); COLOR = texture(TEXTURE, vec2(sample_x, sample_y));
//COLOR = vec4(ivec4(location, dimension)); //COLOR = vec4(ivec4(location, dimension))/16.;
//COLOR = vec4(1., 1., 1., 1.);
} }

View file

@ -0,0 +1,13 @@
[gd_scene load_steps=2 format=3 uid="uid://ceg7ahpj5x12g"]
[ext_resource type="Script" uid="uid://colvx6wq0e8n7" path="res://world/building_generator.gd" id="1_cwnke"]
[node name="Building Generator" type="Node"]
script = ExtResource("1_cwnke")
initial_buildings = 10
[node name="Timer" type="Timer" parent="."]
wait_time = 2.5
autostart = true
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]

View file

@ -0,0 +1,8 @@
extends Sprite2D
@export var grid_offset : Vector2i = Vector2i.ZERO
func _ready() -> void:
var location = Vector2i(get_parent().location) + grid_offset
var dimension = Vector2i(get_parent().dimension)
self_modulate = 2 * Color8(location.x, location.y, dimension.x, dimension.y)

View file

@ -0,0 +1,70 @@
[gd_scene load_steps=10 format=3 uid="uid://dliwqqmrxldjh"]
[ext_resource type="Script" uid="uid://b2ji03ekijjnn" path="res://buildings/building.gd" id="1_c7qov"]
[ext_resource type="Shader" uid="uid://c7gb1nqwvkr37" path="res://buildings/building.gdshader" id="2_6a6ii"]
[ext_resource type="Texture2D" uid="uid://dfy0gccqgggp2" path="res://buildings/Building 2x1 fixed.png" id="3_ihg0a"]
[ext_resource type="Script" uid="uid://dj7d4d2xs3nci" path="res://buildings/building_mesh.gd" id="4_505qw"]
[ext_resource type="Texture2D" uid="uid://3weywjfsapax" path="res://buildings/Building 2x1 downside.png" id="5_012sa"]
[ext_resource type="PackedScene" uid="uid://dpv1w56yr1xue" path="res://traps/morning_star.tscn" id="6_qwyfo"]
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://utils/platform.tscn" id="8_evf2t"]
[ext_resource type="PackedScene" uid="uid://h3caql0b6vft" path="res://traps/bear_trap.tscn" id="9_c7qov"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_pfkkr"]
shader = ExtResource("2_6a6ii")
shader_parameter/ground_height = 3000.0
shader_parameter/cell_height = 300.0
shader_parameter/num_cells = 60
[node name="Building2" type="Node2D"]
script = ExtResource("1_c7qov")
[node name="Sprite2D" type="Sprite2D" parent="."]
material = SubResource("ShaderMaterial_pfkkr")
scale = Vector2(25, 25)
texture = ExtResource("3_ihg0a")
script = ExtResource("4_505qw")
[node name="Sprite2D2" type="Sprite2D" parent="."]
material = SubResource("ShaderMaterial_pfkkr")
scale = Vector2(25, 25)
texture = ExtResource("5_012sa")
script = ExtResource("4_505qw")
grid_offset = Vector2i(0, -1)
[node name="ObjectList" type="Node2D" parent="."]
[node name="MorningStar" parent="ObjectList" instance=ExtResource("6_qwyfo")]
position = Vector2(238, -149)
[node name="Platform" parent="ObjectList" instance=ExtResource("8_evf2t")]
visible = false
position = Vector2(75, -295)
collision_layer = 41
[node name="Platform2" parent="ObjectList" instance=ExtResource("8_evf2t")]
visible = false
position = Vector2(225, -295)
collision_layer = 41
[node name="Platform3" parent="ObjectList" instance=ExtResource("8_evf2t")]
visible = false
position = Vector2(375, -295)
collision_layer = 41
[node name="Platform4" parent="ObjectList" instance=ExtResource("8_evf2t")]
visible = false
position = Vector2(525, -295)
collision_layer = 41
[node name="Platform5" parent="ObjectList" instance=ExtResource("8_evf2t")]
position = Vector2(431, -150)
scale = Vector2(2.688, 3)
[node name="BearTrap" parent="ObjectList" instance=ExtResource("9_c7qov")]
position = Vector2(270, -9)
[node name="DebugSprite" type="Sprite2D" parent="."]
visible = false
position = Vector2(300, -150)
scale = Vector2(1.172, 1.172)
texture = ExtResource("3_ihg0a")

View file

@ -0,0 +1,70 @@
[gd_scene load_steps=10 format=3 uid="uid://oflm2yjjwhf"]
[ext_resource type="Script" uid="uid://b2ji03ekijjnn" path="res://buildings/building.gd" id="1_ivy1q"]
[ext_resource type="Shader" uid="uid://c7gb1nqwvkr37" path="res://buildings/building.gdshader" id="2_yuthg"]
[ext_resource type="Texture2D" uid="uid://dfy0gccqgggp2" path="res://buildings/Building 2x1 fixed.png" id="3_vtou7"]
[ext_resource type="Script" uid="uid://dj7d4d2xs3nci" path="res://buildings/building_mesh.gd" id="4_2shqy"]
[ext_resource type="Texture2D" uid="uid://3weywjfsapax" path="res://buildings/Building 2x1 downside.png" id="5_hu6aj"]
[ext_resource type="PackedScene" uid="uid://5nb7pf8g1ck" path="res://enemies/leech/giant_leech.tscn" id="8_r3b86"]
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://utils/platform.tscn" id="8_y6yyb"]
[ext_resource type="PackedScene" uid="uid://xj0of571aur1" path="res://items/generic/item_spawn.tscn" id="9_jmdjr"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_pfkkr"]
shader = ExtResource("2_yuthg")
shader_parameter/ground_height = 3000.0
shader_parameter/cell_height = 300.0
shader_parameter/num_cells = 60
[node name="Building2" type="Node2D"]
script = ExtResource("1_ivy1q")
[node name="Sprite2D" type="Sprite2D" parent="."]
material = SubResource("ShaderMaterial_pfkkr")
scale = Vector2(25, 25)
texture = ExtResource("3_vtou7")
script = ExtResource("4_2shqy")
[node name="Sprite2D2" type="Sprite2D" parent="."]
material = SubResource("ShaderMaterial_pfkkr")
scale = Vector2(25, 25)
texture = ExtResource("5_hu6aj")
script = ExtResource("4_2shqy")
grid_offset = Vector2i(0, -1)
[node name="ObjectList" type="Node2D" parent="."]
[node name="Platform" parent="ObjectList" instance=ExtResource("8_y6yyb")]
visible = false
position = Vector2(75, -295)
collision_layer = 41
[node name="Platform2" parent="ObjectList" instance=ExtResource("8_y6yyb")]
visible = false
position = Vector2(225, -295)
collision_layer = 41
[node name="Platform3" parent="ObjectList" instance=ExtResource("8_y6yyb")]
visible = false
position = Vector2(375, -295)
collision_layer = 41
[node name="Platform4" parent="ObjectList" instance=ExtResource("8_y6yyb")]
visible = false
position = Vector2(525, -295)
collision_layer = 41
[node name="Platform5" parent="ObjectList" instance=ExtResource("8_y6yyb")]
position = Vector2(300, -150)
scale = Vector2(2.688, 3)
[node name="ItemSpawn" parent="ObjectList" instance=ExtResource("9_jmdjr")]
position = Vector2(300, -200)
[node name="Giant_Leech" parent="ObjectList" instance=ExtResource("8_r3b86")]
position = Vector2(400, -340)
[node name="DebugSprite" type="Sprite2D" parent="."]
visible = false
position = Vector2(300, -150)
scale = Vector2(1.172, 1.172)
texture = ExtResource("3_vtou7")

View file

@ -0,0 +1,53 @@
[gd_scene load_steps=8 format=3 uid="uid://cmofmd0vf3hx3"]
[ext_resource type="Script" uid="uid://b2ji03ekijjnn" path="res://buildings/building.gd" id="1_q3nfb"]
[ext_resource type="Shader" uid="uid://c7gb1nqwvkr37" path="res://buildings/building.gdshader" id="2_uv7v8"]
[ext_resource type="Texture2D" uid="uid://djir4ehm8kif" path="res://buildings/Building 1x2 fixed.png" id="3_uv7v8"]
[ext_resource type="Script" uid="uid://dj7d4d2xs3nci" path="res://buildings/building_mesh.gd" id="4_bl5jt"]
[ext_resource type="PackedScene" uid="uid://chu67ci7sl488" path="res://enemies/ghost/ghost.tscn" id="5_23fi7"]
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://utils/platform.tscn" id="6_e6j05"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_qnfc1"]
resource_local_to_scene = true
shader = ExtResource("2_uv7v8")
shader_parameter/ground_height = 3000.0
shader_parameter/cell_height = 300.0
shader_parameter/num_cells = 60
[node name="Building" type="Node2D"]
script = ExtResource("1_q3nfb")
dimension = Vector2i(1, 2)
[node name="Sprite2D" type="Sprite2D" parent="."]
self_modulate = Color(0.176471, 0, 0.00392157, 0.00392157)
material = SubResource("ShaderMaterial_qnfc1")
scale = Vector2(25, 25)
texture = ExtResource("3_uv7v8")
script = ExtResource("4_bl5jt")
[node name="ObjectList" type="Node2D" parent="."]
[node name="Ghost" parent="ObjectList" instance=ExtResource("5_23fi7")]
position = Vector2(150, -300)
[node name="Platform" parent="ObjectList" instance=ExtResource("6_e6j05")]
visible = false
position = Vector2(75, -595)
collision_layer = 41
[node name="Platform2" parent="ObjectList" instance=ExtResource("6_e6j05")]
visible = false
position = Vector2(225, -595)
collision_layer = 41
[node name="Platform3" parent="ObjectList" instance=ExtResource("6_e6j05")]
position = Vector2(290, -431)
[node name="Platform4" parent="ObjectList" instance=ExtResource("6_e6j05")]
position = Vector2(62, -184)
[node name="DebugSprite" type="Sprite2D" parent="."]
visible = false
position = Vector2(150, -300)
scale = Vector2(1.172, 1.172)
texture = ExtResource("3_uv7v8")

View file

@ -0,0 +1,68 @@
[gd_scene load_steps=10 format=3 uid="uid://6y637jp2tbma"]
[ext_resource type="Script" uid="uid://b2ji03ekijjnn" path="res://buildings/building.gd" id="1_w5m4l"]
[ext_resource type="Shader" uid="uid://c7gb1nqwvkr37" path="res://buildings/building.gdshader" id="2_wod1l"]
[ext_resource type="Texture2D" uid="uid://djir4ehm8kif" path="res://buildings/Building 1x2 fixed.png" id="3_elmbw"]
[ext_resource type="Script" uid="uid://dj7d4d2xs3nci" path="res://buildings/building_mesh.gd" id="4_1cnhw"]
[ext_resource type="PackedScene" uid="uid://chu67ci7sl488" path="res://enemies/ghost/ghost.tscn" id="5_rh5oo"]
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://utils/platform.tscn" id="6_caaff"]
[ext_resource type="PackedScene" uid="uid://xj0of571aur1" path="res://items/generic/item_spawn.tscn" id="7_elmbw"]
[ext_resource type="PackedScene" uid="uid://dpv1w56yr1xue" path="res://traps/morning_star.tscn" id="8_1cnhw"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_qnfc1"]
resource_local_to_scene = true
shader = ExtResource("2_wod1l")
shader_parameter/ground_height = 3000.0
shader_parameter/cell_height = 300.0
shader_parameter/num_cells = 60
[node name="Building" type="Node2D"]
script = ExtResource("1_w5m4l")
dimension = Vector2i(1, 2)
[node name="Sprite2D" type="Sprite2D" parent="."]
self_modulate = Color(0.176471, 0, 0.00392157, 0.00392157)
material = SubResource("ShaderMaterial_qnfc1")
scale = Vector2(25, 25)
texture = ExtResource("3_elmbw")
script = ExtResource("4_1cnhw")
[node name="ObjectList" type="Node2D" parent="."]
[node name="Ghost" parent="ObjectList" instance=ExtResource("5_rh5oo")]
position = Vector2(-38, -481)
[node name="Platform" parent="ObjectList" instance=ExtResource("6_caaff")]
visible = false
position = Vector2(75, -595)
collision_layer = 41
[node name="Platform2" parent="ObjectList" instance=ExtResource("6_caaff")]
visible = false
position = Vector2(225, -595)
collision_layer = 41
[node name="Platform3" parent="ObjectList" instance=ExtResource("6_caaff")]
position = Vector2(5, -251)
[node name="Platform4" parent="ObjectList" instance=ExtResource("6_caaff")]
position = Vector2(286, -138)
[node name="Platform5" parent="ObjectList" instance=ExtResource("6_caaff")]
position = Vector2(269, -435)
scale = Vector2(2.49, 3.1)
[node name="ItemSpawn" parent="ObjectList" instance=ExtResource("7_elmbw")]
position = Vector2(149, -645)
[node name="MorningStar" parent="ObjectList" instance=ExtResource("8_1cnhw")]
position = Vector2(39, -552)
[node name="Ghost2" parent="ObjectList" instance=ExtResource("5_rh5oo")]
position = Vector2(301, -39)
[node name="DebugSprite" type="Sprite2D" parent="."]
visible = false
position = Vector2(150, -300)
scale = Vector2(1.172, 1.172)
texture = ExtResource("3_elmbw")

View file

@ -0,0 +1,60 @@
[gd_scene load_steps=10 format=3 uid="uid://dt827qxyycg8n"]
[ext_resource type="Script" uid="uid://b2ji03ekijjnn" path="res://buildings/building.gd" id="1_pww4b"]
[ext_resource type="Shader" uid="uid://c7gb1nqwvkr37" path="res://buildings/building.gdshader" id="2_qsju2"]
[ext_resource type="Texture2D" uid="uid://djir4ehm8kif" path="res://buildings/Building 1x2 fixed.png" id="3_0yjll"]
[ext_resource type="Script" uid="uid://dj7d4d2xs3nci" path="res://buildings/building_mesh.gd" id="4_ri5b7"]
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://utils/platform.tscn" id="6_kom4b"]
[ext_resource type="PackedScene" uid="uid://xj0of571aur1" path="res://items/generic/item_spawn.tscn" id="7_sr858"]
[ext_resource type="PackedScene" uid="uid://h3caql0b6vft" path="res://traps/bear_trap.tscn" id="8_pww4b"]
[ext_resource type="PackedScene" uid="uid://dpv1w56yr1xue" path="res://traps/morning_star.tscn" id="8_ta0fd"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_qnfc1"]
resource_local_to_scene = true
shader = ExtResource("2_qsju2")
shader_parameter/ground_height = 3000.0
shader_parameter/cell_height = 300.0
shader_parameter/num_cells = 60
[node name="Building" type="Node2D"]
script = ExtResource("1_pww4b")
dimension = Vector2i(1, 2)
[node name="Sprite2D" type="Sprite2D" parent="."]
self_modulate = Color(0.176471, 0, 0.00392157, 0.00392157)
material = SubResource("ShaderMaterial_qnfc1")
scale = Vector2(25, 25)
texture = ExtResource("3_0yjll")
script = ExtResource("4_ri5b7")
[node name="ObjectList" type="Node2D" parent="."]
[node name="Platform" parent="ObjectList" instance=ExtResource("6_kom4b")]
visible = false
position = Vector2(75, -595)
collision_layer = 41
[node name="Platform2" parent="ObjectList" instance=ExtResource("6_kom4b")]
visible = false
position = Vector2(225, -595)
collision_layer = 41
[node name="Platform5" parent="ObjectList" instance=ExtResource("6_kom4b")]
position = Vector2(85, -287)
scale = Vector2(2.49, 3.1)
[node name="ItemSpawn" parent="ObjectList" instance=ExtResource("7_sr858")]
position = Vector2(149, -645)
rarity_bonus = 0.5
[node name="MorningStar" parent="ObjectList" instance=ExtResource("8_ta0fd")]
position = Vector2(39, -552)
[node name="BearTrap" parent="ObjectList" instance=ExtResource("8_pww4b")]
position = Vector2(165, -7)
[node name="DebugSprite" type="Sprite2D" parent="."]
visible = false
position = Vector2(150, -300)
scale = Vector2(1.172, 1.172)
texture = ExtResource("3_0yjll")

View file

@ -0,0 +1,78 @@
[gd_scene load_steps=12 format=3 uid="uid://djawvtdwp423v"]
[ext_resource type="Script" uid="uid://b2ji03ekijjnn" path="res://buildings/building.gd" id="1_5j34s"]
[ext_resource type="Shader" uid="uid://c7gb1nqwvkr37" path="res://buildings/building.gdshader" id="2_xx8ra"]
[ext_resource type="Texture2D" uid="uid://dfy0gccqgggp2" path="res://buildings/Building 2x1 fixed.png" id="3_xr4t5"]
[ext_resource type="Script" uid="uid://dj7d4d2xs3nci" path="res://buildings/building_mesh.gd" id="4_xr4t5"]
[ext_resource type="Texture2D" uid="uid://3weywjfsapax" path="res://buildings/Building 2x1 downside.png" id="5_pfkkr"]
[ext_resource type="PackedScene" uid="uid://dpv1w56yr1xue" path="res://traps/morning_star.tscn" id="5_xr4t5"]
[ext_resource type="PackedScene" uid="uid://chu67ci7sl488" path="res://enemies/ghost/ghost.tscn" id="7_35wcg"]
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://utils/platform.tscn" id="8_sifiv"]
[ext_resource type="PackedScene" uid="uid://xj0of571aur1" path="res://items/generic/item_spawn.tscn" id="9_i1qmw"]
[ext_resource type="PackedScene" uid="uid://b62xcg0dd3vct" path="res://enemies/leech/leech.tscn" id="10_ibnxs"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_pfkkr"]
shader = ExtResource("2_xx8ra")
shader_parameter/ground_height = 3000.0
shader_parameter/cell_height = 300.0
shader_parameter/num_cells = 60
[node name="Building2" type="Node2D"]
script = ExtResource("1_5j34s")
[node name="Sprite2D" type="Sprite2D" parent="."]
material = SubResource("ShaderMaterial_pfkkr")
scale = Vector2(25, 25)
texture = ExtResource("3_xr4t5")
script = ExtResource("4_xr4t5")
[node name="Sprite2D2" type="Sprite2D" parent="."]
material = SubResource("ShaderMaterial_pfkkr")
scale = Vector2(25, 25)
texture = ExtResource("5_pfkkr")
script = ExtResource("4_xr4t5")
grid_offset = Vector2i(0, -1)
[node name="ObjectList" type="Node2D" parent="."]
[node name="MorningStar" parent="ObjectList" instance=ExtResource("5_xr4t5")]
position = Vector2(397, -3)
[node name="Ghost" parent="ObjectList" instance=ExtResource("7_35wcg")]
position = Vector2(118, -125)
[node name="Platform" parent="ObjectList" instance=ExtResource("8_sifiv")]
visible = false
position = Vector2(75, -295)
collision_layer = 41
[node name="Platform2" parent="ObjectList" instance=ExtResource("8_sifiv")]
visible = false
position = Vector2(225, -295)
collision_layer = 41
[node name="Platform3" parent="ObjectList" instance=ExtResource("8_sifiv")]
visible = false
position = Vector2(375, -295)
collision_layer = 41
[node name="Platform4" parent="ObjectList" instance=ExtResource("8_sifiv")]
visible = false
position = Vector2(525, -295)
collision_layer = 41
[node name="Platform5" parent="ObjectList" instance=ExtResource("8_sifiv")]
position = Vector2(300, -150)
scale = Vector2(2.688, 3)
[node name="ItemSpawn" parent="ObjectList" instance=ExtResource("9_i1qmw")]
position = Vector2(300, -200)
[node name="Leech" parent="ObjectList" instance=ExtResource("10_ibnxs")]
position = Vector2(240, -340)
[node name="DebugSprite" type="Sprite2D" parent="."]
visible = false
position = Vector2(300, -150)
scale = Vector2(1.172, 1.172)
texture = ExtResource("3_xr4t5")

View file

@ -0,0 +1,75 @@
[gd_scene load_steps=12 format=3 uid="uid://c7ddsyd8kcjji"]
[ext_resource type="Script" uid="uid://b2ji03ekijjnn" path="res://buildings/building.gd" id="1_0710n"]
[ext_resource type="Shader" uid="uid://c7gb1nqwvkr37" path="res://buildings/building.gdshader" id="2_7e5ul"]
[ext_resource type="Texture2D" uid="uid://dfy0gccqgggp2" path="res://buildings/Building 2x1 fixed.png" id="3_lxvry"]
[ext_resource type="Script" uid="uid://dj7d4d2xs3nci" path="res://buildings/building_mesh.gd" id="4_h84o2"]
[ext_resource type="Texture2D" uid="uid://3weywjfsapax" path="res://buildings/Building 2x1 downside.png" id="5_v4fh6"]
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://utils/platform.tscn" id="6_me65q"]
[ext_resource type="PackedScene" uid="uid://xj0of571aur1" path="res://items/generic/item_spawn.tscn" id="7_crruu"]
[ext_resource type="PackedScene" uid="uid://h3caql0b6vft" path="res://traps/bear_trap.tscn" id="8_fkxmk"]
[ext_resource type="PackedScene" uid="uid://chu67ci7sl488" path="res://enemies/ghost/ghost.tscn" id="9_6hrl3"]
[ext_resource type="PackedScene" uid="uid://b62xcg0dd3vct" path="res://enemies/leech/leech.tscn" id="10_7e5ul"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_pfkkr"]
shader = ExtResource("2_7e5ul")
shader_parameter/ground_height = 3000.0
shader_parameter/cell_height = 300.0
shader_parameter/num_cells = 60
[node name="Building2" type="Node2D"]
script = ExtResource("1_0710n")
[node name="Sprite2D" type="Sprite2D" parent="."]
material = SubResource("ShaderMaterial_pfkkr")
scale = Vector2(25, 25)
texture = ExtResource("3_lxvry")
script = ExtResource("4_h84o2")
[node name="Sprite2D2" type="Sprite2D" parent="."]
material = SubResource("ShaderMaterial_pfkkr")
scale = Vector2(25, 25)
texture = ExtResource("5_v4fh6")
script = ExtResource("4_h84o2")
grid_offset = Vector2i(0, -1)
[node name="ObjectList" type="Node2D" parent="."]
[node name="Platform" parent="ObjectList" instance=ExtResource("6_me65q")]
visible = false
position = Vector2(75, -295)
collision_layer = 41
[node name="Platform2" parent="ObjectList" instance=ExtResource("6_me65q")]
visible = false
position = Vector2(225, -295)
collision_layer = 41
[node name="Platform3" parent="ObjectList" instance=ExtResource("6_me65q")]
visible = false
position = Vector2(375, -295)
collision_layer = 41
[node name="Platform4" parent="ObjectList" instance=ExtResource("6_me65q")]
visible = false
position = Vector2(525, -295)
collision_layer = 41
[node name="ItemSpawn" parent="ObjectList" instance=ExtResource("7_crruu")]
position = Vector2(137, -329)
rarity_bonus = 0.25
[node name="BearTrap" parent="ObjectList" instance=ExtResource("8_fkxmk")]
position = Vector2(465, -301)
[node name="Ghost" parent="ObjectList" instance=ExtResource("9_6hrl3")]
position = Vector2(301, -49)
[node name="Leech" parent="ObjectList" instance=ExtResource("10_7e5ul")]
position = Vector2(176, -340)
[node name="DebugSprite" type="Sprite2D" parent="."]
visible = false
position = Vector2(300, -150)
scale = Vector2(1.172, 1.172)
texture = ExtResource("3_lxvry")

View file

@ -1,5 +0,0 @@
extends Node2D
@export var radius : float;
func _draw():
draw_circle(Vector2.ZERO, radius, Color.BLACK, true, -1.0, true)

View file

@ -1 +0,0 @@
uid://b5fhsy1xlreco

View file

@ -1,29 +0,0 @@
[gd_scene load_steps=4 format=3 uid="uid://33k5v6skcbsm"]
[ext_resource type="Script" uid="uid://b5fhsy1xlreco" path="res://draw_circle.gd" id="2_2bhor"]
[ext_resource type="Script" uid="uid://m3vyyfk8gnma" path="res://grid.gd" id="3_2bhor"]
[sub_resource type="CircleShape2D" id="CircleShape2D_5i67w"]
radius = 3000.0
[node name="Earth" type="Node2D"]
[node name="Ground" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Ground"]
shape = SubResource("CircleShape2D_5i67w")
[node name="GroundVisual" type="Node2D" parent="Ground"]
script = ExtResource("2_2bhor")
radius = 3000.0
[node name="Camera2D" type="Camera2D" parent="."]
position = Vector2(47, -3283)
[node name="Grid" type="Node2D" parent="."]
script = ExtResource("3_2bhor")
ground_radius = 3000.0
cell_height = 300.0
num_collumns = 60
debug = true
metadata/_custom_type_script = "uid://m3vyyfk8gnma"

BIN
enemies/Elite.pdn Normal file

Binary file not shown.

BIN
enemies/Elite_Body.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
enemies/Elite_Head.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://caqimfmdp7jsd"
path="res://.godot/imported/Untitled 15.png-9f7aef1d51ca656d39c301d3244f358e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://enemies/boss/Untitled 15.png"
dest_files=["res://.godot/imported/Untitled 15.png-9f7aef1d51ca656d39c301d3244f358e.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

35
enemies/boss/blob.gd Normal file
View file

@ -0,0 +1,35 @@
extends Node2D
var moving = false
@onready var player = get_tree().get_root().get_node("main/Player")
var speed = 500
# The target is set on initialization and never updated.
@onready var target = player.position
var reached = false
signal target_reached
func _ready() -> void:
# Wait one second before firing
await get_tree().create_timer(1).timeout
moving = true
func _process(delta: float) -> void:
# Fire towards the center of the cross
if moving:
position += (target - global_position).normalized().rotated(-get_parent().rotation) * speed * delta
# When reaching the center, inform parent node
if((global_position - target).length() < 40):
moving = false
if not reached:
target_reached.emit()
reached = true
# Damage the player on contact
if has_node("Area2D") and $Area2D.overlaps_body(player):
player.hurt(1, global_position-player.position)

1
enemies/boss/blob.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://d4n32kt7t726k

38
enemies/boss/blob_big.gd Normal file
View file

@ -0,0 +1,38 @@
extends Node2D
@onready var player = get_tree().get_root().get_node("main/Player")
var speed = 200
var angular_speed = TAU/8
var lifetime = 5
var ready_blobs = 0
var num_blobs = 0
var particles_ended = false
func _on_target_reached():
ready_blobs += 1
func _ready() -> void:
# Count those children that have a "target reached" signal and connect them.
for child in get_children():
if "target_reached" in child:
num_blobs += 1
child.connect("target_reached", _on_target_reached)
$SplashSound.play()
func _process(delta: float) -> void:
# Once all child blobs have reached their target, start moving as one while slowly rotating.
if ready_blobs == num_blobs:
position += (player.position - position).normalized() * speed * delta
rotate(angular_speed * delta)
lifetime -= delta
# In the end, clear all child blobs, then the rest.
if lifetime < 0 and not particles_ended:
particles_ended = true
for child in get_children():
if "target_reached" in child:
child.get_node("GPUParticles2D").emitting = false
child.get_node("Area2D").queue_free()
if lifetime < -2:
queue_free()

View file

@ -0,0 +1 @@
uid://b22hbgn80m4l0

View file

@ -0,0 +1,23 @@
[gd_scene load_steps=4 format=3 uid="uid://bg2hgia0jqnqf"]
[ext_resource type="Script" uid="uid://b22hbgn80m4l0" path="res://enemies/boss/blob_big.gd" id="1_xkk63"]
[ext_resource type="PackedScene" uid="uid://ck0bj7444wfsl" path="res://enemies/boss/blob_small.tscn" id="2_jl75s"]
[ext_resource type="AudioStream" uid="uid://bl05nrrcsjaus" path="res://sounds/slime-splat-4-219250.mp3" id="3_d2us1"]
[node name="blob_big" type="Node2D"]
script = ExtResource("1_xkk63")
[node name="Blob" parent="." instance=ExtResource("2_jl75s")]
position = Vector2(400, 0)
[node name="Blob2" parent="." instance=ExtResource("2_jl75s")]
position = Vector2(-400, 0)
[node name="Blob3" parent="." instance=ExtResource("2_jl75s")]
position = Vector2(0, -400)
[node name="Blob4" parent="." instance=ExtResource("2_jl75s")]
position = Vector2(0, 400)
[node name="SplashSound" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("3_d2us1")

View file

@ -0,0 +1,37 @@
[gd_scene load_steps=5 format=3 uid="uid://ck0bj7444wfsl"]
[ext_resource type="Script" uid="uid://d4n32kt7t726k" path="res://enemies/boss/blob.gd" id="1_wigkh"]
[ext_resource type="Texture2D" uid="uid://dvlvu37up72gt" path="res://enemies/boss/bubble.png" id="2_jle3w"]
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_aaw6g"]
particle_flag_disable_z = true
emission_shape = 1
emission_sphere_radius = 53.96
angular_velocity_min = -1.60933e-05
angular_velocity_max = -1.60933e-05
orbit_velocity_min = 0.184
orbit_velocity_max = 0.184
radial_velocity_min = 91.95
radial_velocity_max = 160.92
gravity = Vector3(0, 0, 0)
[sub_resource type="CircleShape2D" id="CircleShape2D_i5m1y"]
radius = 45.0
[node name="Blob" type="Node2D"]
script = ExtResource("1_wigkh")
[node name="GPUParticles2D" type="GPUParticles2D" parent="."]
amount = 100
texture = ExtResource("2_jle3w")
lifetime = 0.1
speed_scale = 0.3
fixed_fps = 60
process_material = SubResource("ParticleProcessMaterial_aaw6g")
[node name="Area2D" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
shape = SubResource("CircleShape2D_i5m1y")

144
enemies/boss/boss.gd Normal file
View file

@ -0,0 +1,144 @@
extends CharacterBody2D
@onready var player = get_tree().get_root().get_node("main/Player")
var moves = ["slam", "wave", "water_rise", "splash"]
@export var big_blob : PackedScene
@onready var water : Water = get_tree().get_root().get_node("main/Water")
# How often water has been risen.
var risen = 0
# Managing idle behavior between attacks.
var attack_ready = true
var idle_dir : Vector2 = Vector2.ZERO
var idle_dir_remaining = 0
var idle_move = true
var target_pos = Vector2.ZERO
var damage = 1
var dead = false
signal grounded
signal slam_step_finished
func choose_next_move() -> String:
# Water rises at 75% and 50% of remaining HP.
if $EnemyHurtbox.hp <= 3 * $EnemyHurtbox.max_hp / 4 and risen == 0:
risen += 1
return "water_rise"
if $EnemyHurtbox.hp <= $EnemyHurtbox.max_hp / 2 and risen == 1:
risen += 1
return "water_rise"
var pool = ["splash"]
# Heavily decrease slam probability if boss height is low.
if not (position.length() - water.radius < 450 and randf()<0.75):
pool.append("slam")
# Heavily decrease wave probability if player is very high up.
if not (player.position.length() > water.radius + 900 and randf()<0.75):
pool.append("wave")
return ["slam", "wave", "splash"].pick_random()
func _process(_delta: float) -> void:
if dead: return
if attack_ready:
attack_ready = false
call(choose_next_move())
func _physics_process(delta: float) -> void:
if dead: return
up_direction = $EarthAligner.up
if(is_on_floor()):
grounded.emit()
if idle_move: move_idle(delta)
if($Hitbox.overlaps_body(player)):
player.hurt(damage, self.position - player.position)
move_and_slide()
func move_idle(delta : float):
# Pick a random target roughly above the player's head every 0.5 seconds.
idle_dir_remaining -= delta
if(idle_dir_remaining <= 0):
target_pos = player.position + player.get_node("EarthAligner").up * 400
target_pos += randf_range(0, max(200, (target_pos - global_position).length())*0.25) * Vector2.from_angle(randf_range(0,TAU))
idle_dir = (target_pos - global_position).normalized()* max(200, (target_pos - global_position).length()) * 0.4
idle_dir_remaining = 0.5
velocity = idle_dir
func slam():
# Move up, Slam Down, Repeat. Afterwards, linger for a moment.
# The slam destroys buildings.
idle_move = false
velocity = up_direction * 500
await get_tree().create_timer(0.6).timeout
await slam_step()
damage = 1
velocity = up_direction * 500
await get_tree().create_timer(0.3).timeout
await slam_step()
velocity = up_direction * 35
await get_tree().create_timer(3).timeout
idle_move = true
attack_ready = true
func slam_step():
# End a downslam after ground is reached or 1.5 seconds have passed.
# Then destroy buildings hit.
damage = 2
velocity = up_direction * -1500
grounded.connect(func(): slam_step_finished.emit())
get_tree().create_timer(1.5).timeout.connect(func(): slam_step_finished.emit())
await slam_step_finished
$SoundSlam.play()
destroy_below()
damage = 1
func destroy_below():
if dead: return
for body in $DestructionChecker.get_overlapping_bodies():
if(body.has_method("destroy")): body.destroy()
func wave():
# Raise a wave from the water at the boundary of the screen and move it towards the center.
var angle = player.position.angle()
var dir = randi_range(0, 1) * 2 - 1
var speed = 3000 / water.radius_base
water.create_tsunami(angle - speed * dir * TAU/30, dir, speed)
await get_tree().create_timer(0.5).timeout
$Wave.play()
await get_tree().create_timer(3.5).timeout
attack_ready = true
func water_rise():
# Increase the water level by 1 room height.
water.rise_water()
await get_tree().create_timer(5).timeout
attack_ready = true
func splash():
# Form four small blobs around the player which merge into one.
var blob_instance = big_blob.instantiate()
get_tree().get_root().get_node("main").add_child(blob_instance)
blob_instance.position = player.position
blob_instance.rotation = randf_range(0, TAU)
await get_tree().create_timer(5).timeout
attack_ready = true
func die():
# Clear everything else, then wait for Audio Players to make sure sounds are not cut off.
dead = true
for child in get_children():
if not child is AudioStreamPlayer2D:
child.queue_free()
$DeathSound.play()
await $DeathSound.finished
await get_tree().create_timer(1).timeout
get_tree().change_scene_to_file("res://ui/victory_screen/victory_screen.tscn")
queue_free()
func _on_enemy_hurtbox_damage_taken(_damage, _dir, _id) -> void:
if dead: return
$AudioStreamPlayer2D.play()

1
enemies/boss/boss.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://uv672p8f4n6k

77
enemies/boss/boss.tscn Normal file
View file

@ -0,0 +1,77 @@
[gd_scene load_steps=11 format=3 uid="uid://cpe4s6vsn0ujd"]
[ext_resource type="Script" uid="uid://uv672p8f4n6k" path="res://enemies/boss/boss.gd" id="1_skx2t"]
[ext_resource type="PackedScene" uid="uid://bg2hgia0jqnqf" path="res://enemies/boss/blob_big.tscn" id="2_o1i15"]
[ext_resource type="PackedScene" uid="uid://mtfsdd4cdf3a" path="res://utils/enemy_hurtbox.tscn" id="2_skx2t"]
[ext_resource type="Texture2D" uid="uid://q5mu3lxlsd6f" path="res://enemies/boss/boss2.png" id="3_opohk"]
[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="4_lnbgr"]
[ext_resource type="AudioStream" uid="uid://co07360hqn6fk" path="res://sounds/686321__cjspellsfish__punch-land-soft.wav" id="6_opohk"]
[ext_resource type="AudioStream" uid="uid://ngkksuy3438s" path="res://sounds/slime-impact-352473.mp3" id="7_auiwu"]
[ext_resource type="AudioStream" uid="uid://cd03po7vk17rt" path="res://sounds/sea-wave-34088.mp3" id="8_h4k8w"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_lnbgr"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_lnbgr"]
size = Vector2(300, 250)
[node name="Boss" type="CharacterBody2D"]
scale = Vector2(1.8, 1.8)
collision_mask = 32
script = ExtResource("1_skx2t")
big_blob = ExtResource("2_o1i15")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
rotation = 1.5708
scale = Vector2(10, 10)
shape = SubResource("CapsuleShape2D_lnbgr")
[node name="Sprite2D" type="Sprite2D" parent="."]
scale = Vector2(1.5, 1.5)
texture = ExtResource("3_opohk")
[node name="EnemyHurtbox" parent="." node_paths=PackedStringArray("canvasItem") instance=ExtResource("2_skx2t")]
collision_layer = 16
collision_mask = 32
max_hp = 800
canvasItem = NodePath("..")
id_block_time = 5.0
[node name="CollisionShape2D" type="CollisionShape2D" parent="EnemyHurtbox"]
rotation = 1.5708
scale = Vector2(11, 11)
shape = SubResource("CapsuleShape2D_lnbgr")
[node name="EarthAligner" parent="." instance=ExtResource("4_lnbgr")]
[node name="Hitbox" type="Area2D" parent="."]
scale = Vector2(1.05, 1.05)
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
rotation = 1.5708
scale = Vector2(10, 10)
shape = SubResource("CapsuleShape2D_lnbgr")
[node name="DestructionChecker" type="Area2D" parent="."]
collision_mask = 10
[node name="CollisionShape2D" type="CollisionShape2D" parent="DestructionChecker"]
position = Vector2(0, 200)
shape = SubResource("RectangleShape2D_lnbgr")
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("6_opohk")
volume_db = 15.0
[node name="SoundSlam" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("7_auiwu")
volume_db = 12.0
[node name="DeathSound" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("7_auiwu")
volume_db = 10.0
[node name="Wave" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("8_h4k8w")
[connection signal="damage_taken" from="EnemyHurtbox" to="." method="_on_enemy_hurtbox_damage_taken"]
[connection signal="died" from="EnemyHurtbox" to="." method="die"]

BIN
enemies/boss/boss2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://q5mu3lxlsd6f"
path="res://.godot/imported/boss2.png-35ba66553dce9db015aee038fd8ec691.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://enemies/boss/boss2.png"
dest_files=["res://.godot/imported/boss2.png-35ba66553dce9db015aee038fd8ec691.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -0,0 +1,13 @@
extends Node
@export var boss : PackedScene
func _ready() -> void:
pass
func _on_water_water_reached_max_height() -> void:
# The boss spawns once the water has risen to its maximum height.
var node = boss.instantiate()
add_sibling(node)
node.position = %Player.position + %Player.get_node("EarthAligner").up * 1000;
queue_free()

View file

@ -0,0 +1 @@
uid://cpaskpj67pnaj

BIN
enemies/boss/bubble.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dvlvu37up72gt"
path="res://.godot/imported/bubble.png-0c7e5ecd706b98b1fc89ca0c332b8765.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://enemies/boss/bubble.png"
dest_files=["res://.godot/imported/bubble.png-0c7e5ecd706b98b1fc89ca0c332b8765.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -0,0 +1,5 @@
extends Area2D
# Attach this to an object to make it destructible
func destroy():
get_parent().queue_free()

View file

@ -0,0 +1 @@
uid://dwvb52u1hnx5m

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b8732t0313bqs"
path="res://.godot/imported/Ghost 0.png-8d937675f5ab76800df31b7061627c3a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://enemies/ghost/ghost animation/Ghost 0.png"
dest_files=["res://.godot/imported/Ghost 0.png-8d937675f5ab76800df31b7061627c3a.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d3b5hmhjw2jyc"
path="res://.godot/imported/Ghost 1.png-995481976799d0dbea8151c0e6c4911f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://enemies/ghost/ghost animation/Ghost 1.png"
dest_files=["res://.godot/imported/Ghost 1.png-995481976799d0dbea8151c0e6c4911f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dfhxhum8lek56"
path="res://.godot/imported/Ghost 2.png-e2649e9d2a684ce9a917daf95b933483.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://enemies/ghost/ghost animation/Ghost 2.png"
dest_files=["res://.godot/imported/Ghost 2.png-e2649e9d2a684ce9a917daf95b933483.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ve5px6ib45g"
path="res://.godot/imported/Ghost 3.png-06caad1192823e1dd881b7bd273e8aff.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://enemies/ghost/ghost animation/Ghost 3.png"
dest_files=["res://.godot/imported/Ghost 3.png-06caad1192823e1dd881b7bd273e8aff.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cmg8yws3gwx6u"
path="res://.godot/imported/Ghost 4.png-5beda85c6f5331ee251ae12d3489921c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://enemies/ghost/ghost animation/Ghost 4.png"
dest_files=["res://.godot/imported/Ghost 4.png-5beda85c6f5331ee251ae12d3489921c.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bs3lt13umfxu8"
path="res://.godot/imported/Ghost 5.png-0726806101c6863f92a162d2ee5e7de2.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://enemies/ghost/ghost animation/Ghost 5.png"
dest_files=["res://.godot/imported/Ghost 5.png-0726806101c6863f92a162d2ee5e7de2.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

53
enemies/ghost/ghost.gd Normal file
View file

@ -0,0 +1,53 @@
extends Area2D
@onready var player : CharacterBody2D = get_tree().get_root().get_node_or_null("main/Player")
var target : CharacterBody2D
# Base stats
var speed = 100
var damage = 1
# Aggro range determines at which distance the ghost targets the player,
# Chase range determines at which distance the ghost stops pursuing the player.
var aggro_range = 900
var chase_range = 1400
var current_knockback = Vector2.ZERO
var knockback_weight = 800
func _ready() -> void:
$AnimatedSprite2D.play("default")
func _process(delta: float) -> void:
if !is_instance_valid(player):
return
var dist = (position - player.position).length()
# Set target based on aggression range and whether target is already set
if(dist > chase_range):
target = null
elif(target == null and dist <= aggro_range):
target = player
# Move towards the target at constant speed
if(target!=null):
var motion = -(position - target.position).normalized() * speed
self.position += motion * delta * min(1, dist/(motion.length()*delta))
# Process knockback
self.position += current_knockback * delta
current_knockback = current_knockback/pow(1.3, 60*delta)
if(self.overlaps_body(player)):
player.hurt(damage, self.global_position-player.global_position)
func _on_death():
# First free all other children, then wait for Death Sound to finish
for child in get_children():
if not child is AudioStreamPlayer2D:
child.queue_free()
await $HurtSound.finished
self.queue_free()
func _on_damage_taken(_damage : int, dir: Vector2, _id):
current_knockback = - dir * knockback_weight
$HurtSound.play()

View file

@ -0,0 +1 @@
uid://12jns4dppxxj

61
enemies/ghost/ghost.tscn Normal file
View file

@ -0,0 +1,61 @@
[gd_scene load_steps=10 format=3 uid="uid://chu67ci7sl488"]
[ext_resource type="Script" uid="uid://12jns4dppxxj" path="res://enemies/ghost/ghost.gd" id="1_6attn"]
[ext_resource type="PackedScene" uid="uid://mtfsdd4cdf3a" path="res://utils/enemy_hurtbox.tscn" id="2_34o1m"]
[ext_resource type="Texture2D" uid="uid://d3b5hmhjw2jyc" path="res://enemies/ghost/ghost animation/Ghost 1.png" id="3_34o1m"]
[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="3_obmiq"]
[ext_resource type="Texture2D" uid="uid://b8732t0313bqs" path="res://enemies/ghost/ghost animation/Ghost 0.png" id="3_rbwoc"]
[ext_resource type="Texture2D" uid="uid://dfhxhum8lek56" path="res://enemies/ghost/ghost animation/Ghost 2.png" id="4_4awot"]
[ext_resource type="AudioStream" uid="uid://co07360hqn6fk" path="res://sounds/686321__cjspellsfish__punch-land-soft.wav" id="7_eqcb8"]
[sub_resource type="CircleShape2D" id="CircleShape2D_6attn"]
[sub_resource type="SpriteFrames" id="SpriteFrames_je28r"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("3_rbwoc")
}, {
"duration": 1.0,
"texture": ExtResource("3_34o1m")
}, {
"duration": 1.0,
"texture": ExtResource("4_4awot")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[node name="Ghost" type="Area2D"]
z_index = 5
scale = Vector2(0.8, 0.8)
collision_layer = 0
collision_mask = 4
script = ExtResource("1_6attn")
[node name="EnemyHurtbox" parent="." node_paths=PackedStringArray("canvasItem") instance=ExtResource("2_34o1m")]
max_hp = 50
canvasItem = NodePath("..")
id_block_time = 0.2
[node name="CollisionShape2D" type="CollisionShape2D" parent="EnemyHurtbox"]
scale = Vector2(6, 6)
shape = SubResource("CircleShape2D_6attn")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_je28r")
frame_progress = 0.235914
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
scale = Vector2(5, 5)
shape = SubResource("CircleShape2D_6attn")
[node name="EarthAligner" parent="." instance=ExtResource("3_obmiq")]
[node name="HurtSound" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("7_eqcb8")
volume_db = 15.0
[connection signal="damage_taken" from="EnemyHurtbox" to="." method="_on_damage_taken"]
[connection signal="died" from="EnemyHurtbox" to="." method="_on_death"]

View file

@ -0,0 +1,73 @@
[gd_scene load_steps=7 format=3 uid="uid://5nb7pf8g1ck"]
[ext_resource type="Script" uid="uid://b70f2ylbb3btt" path="res://enemies/leech/leech.gd" id="1_wfsrb"]
[ext_resource type="PackedScene" uid="uid://cvoicwo2xnf7e" path="res://enemies/leech/segment.tscn" id="2_7ngsb"]
[ext_resource type="PackedScene" uid="uid://dn8qucrpq6k72" path="res://enemies/leech/segment_end.tscn" id="2_poqop"]
[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="3_vk62e"]
[ext_resource type="AudioStream" uid="uid://co07360hqn6fk" path="res://sounds/686321__cjspellsfish__punch-land-soft.wav" id="4_ps8gx"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_cq6dk"]
size = Vector2(2, 15)
[node name="Giant_Leech" type="Area2D"]
scale = Vector2(1, 1.2)
script = ExtResource("1_wfsrb")
broadth = 400
max_hp = 180
[node name="Segments" type="Node2D" parent="."]
[node name="SegmentEnd1" parent="Segments" instance=ExtResource("2_poqop")]
scale = Vector2(-2, -2)
[node name="Segment2" parent="Segments" instance=ExtResource("2_7ngsb")]
scale = Vector2(2, 2)
[node name="Segment3" parent="Segments" instance=ExtResource("2_7ngsb")]
scale = Vector2(2, 2)
[node name="Segment4" parent="Segments" instance=ExtResource("2_7ngsb")]
scale = Vector2(2, 2)
[node name="Segment5" parent="Segments" instance=ExtResource("2_7ngsb")]
scale = Vector2(2, 2)
[node name="Segment6" parent="Segments" instance=ExtResource("2_7ngsb")]
scale = Vector2(2, 2)
[node name="Segment7" parent="Segments" instance=ExtResource("2_7ngsb")]
scale = Vector2(2, 2)
[node name="Segment8" parent="Segments" instance=ExtResource("2_7ngsb")]
scale = Vector2(2, 2)
[node name="Segment9" parent="Segments" instance=ExtResource("2_7ngsb")]
scale = Vector2(2, 2)
[node name="SegmentEnd2" parent="Segments" instance=ExtResource("2_poqop")]
scale = Vector2(2, 2)
[node name="EarthAligner" parent="." instance=ExtResource("3_vk62e")]
[node name="StepChecker" type="Area2D" parent="."]
position = Vector2(248, 31.2)
collision_layer = 0
collision_mask = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="StepChecker"]
position = Vector2(0, 25)
shape = SubResource("RectangleShape2D_cq6dk")
[node name="GroundSensor" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="GroundSensor"]
position = Vector2(0, 25)
shape = SubResource("RectangleShape2D_cq6dk")
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("4_ps8gx")
[connection signal="damage_taken" from="." to="." method="_on_damage_taken"]
[connection signal="died" from="." to="." method="_on_death"]

116
enemies/leech/leech.gd Normal file
View file

@ -0,0 +1,116 @@
extends EnemyHurtbox
# The distance from one end to the other while standing
@export var broadth = 250
var move_dir = [-1, 1].pick_random()
const angular_speed = 0.25
# The angle from the base to the moving end
var angle = 0.0 if move_dir == 1 else PI
@onready var segments : Array[Node] = $Segments.get_children()
@onready var segment_count = segments.size()
var dead = false
func _process(delta: float) -> void:
if dead: return
# Fall slowly while not grounded
if not $GroundSensor.has_overlapping_bodies():
position += 200 * delta * $EarthAligner.down
var y = position.length()
var ratio = - move_dir * broadth / (2 * y)
# Due to the curvature of the ground, the leech can not just prescribe a semicircle.
# 2 * rot_angle determines how much further than 180° the moving leg has to move.
# This agrees with the angle of the arc spanned by the leeches standing ends.
var rot_angle = - 2 * asin(ratio)
angle -= TAU * delta * angular_speed * move_dir
# Once the rotation has finished, the other leg is used as the leeches center.
# The leeches position has to be updated accordingly.
if(angle > PI + abs(rot_angle) / 2 or angle < - abs(rot_angle) / 2):
angle = fmod(angle + PI, PI)
position = position.rotated(rot_angle)
# StepChecker determines whether there is ground for the next step.
# Place the StepChecker on the side of the next step to be made.
if(move_dir == 1 and angle < 1 or move_dir == -1 and angle > PI - 1):
$StepChecker.global_position = position.rotated(rot_angle)
$StepChecker.rotation = rot_angle
# At some point of the movement, check whether there is ground to step on, turn around otherwise.
if(move_dir == 1 and angle < 0.5 or move_dir == -1 and angle > PI - 0.5):
if(not $StepChecker.has_overlapping_bodies()):
move_dir *= -1
# Update the position and rotation according to the end's position
for i in range(segment_count):
var segment_pos_data = calculate_segment_location_and_rotation(i)
if not is_instance_valid(segments[i]):
get_tree().get_root().print_tree_pretty()
segments[i].position = segment_pos_data.position
segments[i].rotation = segment_pos_data.rotation
func calculate_segment_location_and_rotation (i) -> Dictionary:
var aerial_end_location = Vector2.from_angle(-angle) * broadth
# Compute the gravicenter of the standing end, the moving end and the apex of the movement.
var gravicenter = (aerial_end_location + Vector2(0, -broadth) + Vector2.ZERO) / 3
# Compute the circle through the above gravicenter, the standing end and the moving end.
var ax = gravicenter.x
var ay = gravicenter.y
var bx = aerial_end_location.x
var by = aerial_end_location.y
var cx = 0
var cy = 0
var d = 2 * (ax * (by - cy) + bx * (cy - ay) + cx * (ay - by))
var ux = ((ax * ax + ay * ay) * (by - cy) + (bx * bx + by * by) * (cy - ay) + (cx * cx + cy * cy) * (ay - by)) / d
var uy = ((ax * ax + ay * ay) * (cx - bx) + (bx * bx + by * by) * (ax - cx) + (cx * cx + cy * cy) * (bx - ax)) / d
var circum_center = Vector2(ux, uy)
var radius = circum_center.length()
# Determine the direction of the correct arc between the standing and the moving end
var switch_arc_dir = false
# When the moving end crosses above the standing end, the circumcenter jumps
# from one side of the leech to the other, reverting the direction of the arc
if ux < 0:
switch_arc_dir = !switch_arc_dir
# For sufficiently large size of circum_center.angle() it can happen that
# the sign of the (circum_center - aerial_end_location).angle() flips while
# that of circum_center.angle() doesn't, which has to be counteracted.
if circum_center.angle() > 1:
switch_arc_dir = !switch_arc_dir
var angle1 = - PI + circum_center.angle()
var angle2 = - PI + (circum_center - aerial_end_location).angle()
if(switch_arc_dir):
angle1 += TAU
# In the edge case where the leech is almost a straight line, the circum_center
# and radius approach infty, leading to numerical errors producing flickering.
# This is ruled out by treating these cases as actual straight lines.
if radius > 1000000:
return {"position" : Vector2.UP * broadth * i / (segment_count - 1),
"rotation" : 3 * PI / 2}
# Otherwise, the segments are distributed regularly along the arc.
else:
var arc_angle = (i * angle1 + (segment_count - 1 - i) * angle2)/(segment_count - 1)
return {"position": circum_center + radius * Vector2.from_angle(arc_angle),
"rotation": arc_angle + sign(ux) * PI/2}
func _on_damage_taken(_damage, _dir, _id):
$AudioStreamPlayer2D.play()
func _on_death():
# Free all other children while waiting for the death sound to play.
dead = true
for child in get_children():
if not child is AudioStreamPlayer2D:
child.queue_free()
$AudioStreamPlayer2D.play()
await $AudioStreamPlayer2D.finished
queue_free()

View file

@ -0,0 +1 @@
uid://b70f2ylbb3btt

64
enemies/leech/leech.tscn Normal file
View file

@ -0,0 +1,64 @@
[gd_scene load_steps=7 format=3 uid="uid://b62xcg0dd3vct"]
[ext_resource type="Script" uid="uid://b70f2ylbb3btt" path="res://enemies/leech/leech.gd" id="1_6u582"]
[ext_resource type="PackedScene" uid="uid://dn8qucrpq6k72" path="res://enemies/leech/segment_end.tscn" id="2_i1r8c"]
[ext_resource type="PackedScene" uid="uid://cvoicwo2xnf7e" path="res://enemies/leech/segment.tscn" id="2_oqch2"]
[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="3_0r7dp"]
[ext_resource type="AudioStream" uid="uid://co07360hqn6fk" path="res://sounds/686321__cjspellsfish__punch-land-soft.wav" id="4_b1m5t"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_cq6dk"]
size = Vector2(2, 12)
[node name="Leech" type="Area2D"]
scale = Vector2(1, 1.2)
script = ExtResource("1_6u582")
broadth = 200
max_hp = 80
[node name="Segments" type="Node2D" parent="."]
[node name="SegmentEnd1" parent="Segments" instance=ExtResource("2_i1r8c")]
rotation = 3.1415927
scale = Vector2(-1, -1)
[node name="Segment2" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment3" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment4" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment5" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment6" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment7" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment8" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="SegmentEnd2" parent="Segments" instance=ExtResource("2_i1r8c")]
[node name="EarthAligner" parent="." instance=ExtResource("3_0r7dp")]
[node name="StepChecker" type="Area2D" parent="."]
position = Vector2(248, 31.2)
collision_layer = 0
collision_mask = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="StepChecker"]
position = Vector2(0, 14.8)
shape = SubResource("RectangleShape2D_cq6dk")
[node name="GroundSensor" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="GroundSensor"]
position = Vector2(0, 8.8)
shape = SubResource("RectangleShape2D_cq6dk")
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("4_b1m5t")
volume_db = 15.0
[connection signal="damage_taken" from="." to="." method="_on_damage_taken"]
[connection signal="died" from="." to="." method="_on_death"]

View file

@ -0,0 +1,61 @@
[gd_scene load_steps=7 format=3 uid="uid://b62xcg0dd3vct"]
[ext_resource type="Script" uid="uid://b70f2ylbb3btt" path="res://enemies/leech/leech.gd" id="1_6u582"]
[ext_resource type="PackedScene" uid="uid://dn8qucrpq6k72" path="res://enemies/leech/segment_end.tscn" id="2_i1r8c"]
[ext_resource type="PackedScene" uid="uid://cvoicwo2xnf7e" path="res://enemies/leech/segment.tscn" id="2_oqch2"]
[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="3_0r7dp"]
[ext_resource type="AudioStream" uid="uid://co07360hqn6fk" path="res://sounds/686321__cjspellsfish__punch-land-soft.wav" id="4_b1m5t"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_cq6dk"]
size = Vector2(2, 12)
[node name="Leech" type="Node2D"]
scale = Vector2(1, 1.2)
script = ExtResource("1_6u582")
broadth = 200
max_hp = 80
[node name="Segments" type="Node2D" parent="."]
[node name="SegmentEnd1" parent="Segments" instance=ExtResource("2_i1r8c")]
rotation = 3.1415927
scale = Vector2(-1, -1)
[node name="Segment2" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment3" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment4" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment5" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment6" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment7" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment8" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="SegmentEnd2" parent="Segments" instance=ExtResource("2_i1r8c")]
[node name="EarthAligner" parent="." instance=ExtResource("3_0r7dp")]
[node name="RayCast2D" type="Area2D" parent="."]
position = Vector2(248, 31.2)
collision_layer = 0
collision_mask = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="RayCast2D"]
position = Vector2(0, 14.8)
shape = SubResource("RectangleShape2D_cq6dk")
[node name="RayCast2D2" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="RayCast2D2"]
position = Vector2(0, 8.8)
shape = SubResource("RectangleShape2D_cq6dk")
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("4_b1m5t")
volume_db = 15.0

View file

@ -0,0 +1,61 @@
[gd_scene load_steps=7 format=3 uid="uid://b62xcg0dd3vct"]
[ext_resource type="Script" uid="uid://b70f2ylbb3btt" path="res://enemies/leech/leech.gd" id="1_6u582"]
[ext_resource type="PackedScene" uid="uid://dn8qucrpq6k72" path="res://enemies/leech/segment_end.tscn" id="2_i1r8c"]
[ext_resource type="PackedScene" uid="uid://cvoicwo2xnf7e" path="res://enemies/leech/segment.tscn" id="2_oqch2"]
[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="3_0r7dp"]
[ext_resource type="AudioStream" uid="uid://co07360hqn6fk" path="res://sounds/686321__cjspellsfish__punch-land-soft.wav" id="4_b1m5t"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_cq6dk"]
size = Vector2(2, 12)
[node name="Leech" type="Node2D"]
scale = Vector2(1, 1.2)
script = ExtResource("1_6u582")
broadth = 200
max_hp = 80
[node name="Segments" type="Node2D" parent="."]
[node name="SegmentEnd1" parent="Segments" instance=ExtResource("2_i1r8c")]
rotation = 3.1415927
scale = Vector2(-1, -1)
[node name="Segment2" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment3" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment4" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment5" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment6" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment7" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment8" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="SegmentEnd2" parent="Segments" instance=ExtResource("2_i1r8c")]
[node name="EarthAligner" parent="." instance=ExtResource("3_0r7dp")]
[node name="RayCast2D" type="Area2D" parent="."]
position = Vector2(248, 31.2)
collision_layer = 0
collision_mask = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="RayCast2D"]
position = Vector2(0, 14.8)
shape = SubResource("RectangleShape2D_cq6dk")
[node name="RayCast2D2" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="RayCast2D2"]
position = Vector2(0, 8.8)
shape = SubResource("RectangleShape2D_cq6dk")
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("4_b1m5t")
volume_db = 15.0

View file

@ -0,0 +1,61 @@
[gd_scene load_steps=7 format=3 uid="uid://b62xcg0dd3vct"]
[ext_resource type="Script" uid="uid://b70f2ylbb3btt" path="res://enemies/leech/leech.gd" id="1_6u582"]
[ext_resource type="PackedScene" uid="uid://dn8qucrpq6k72" path="res://enemies/leech/segment_end.tscn" id="2_i1r8c"]
[ext_resource type="PackedScene" uid="uid://cvoicwo2xnf7e" path="res://enemies/leech/segment.tscn" id="2_oqch2"]
[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="3_0r7dp"]
[ext_resource type="AudioStream" uid="uid://co07360hqn6fk" path="res://sounds/686321__cjspellsfish__punch-land-soft.wav" id="4_b1m5t"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_cq6dk"]
size = Vector2(2, 12)
[node name="Leech" type="Node2D"]
scale = Vector2(1, 1.2)
script = ExtResource("1_6u582")
broadth = 200
max_hp = 80
[node name="Segments" type="Node2D" parent="."]
[node name="SegmentEnd1" parent="Segments" instance=ExtResource("2_i1r8c")]
rotation = 3.1415927
scale = Vector2(-1, -1)
[node name="Segment2" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment3" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment4" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment5" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment6" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment7" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="Segment8" parent="Segments" instance=ExtResource("2_oqch2")]
[node name="SegmentEnd2" parent="Segments" instance=ExtResource("2_i1r8c")]
[node name="EarthAligner" parent="." instance=ExtResource("3_0r7dp")]
[node name="RayCast2D" type="Area2D" parent="."]
position = Vector2(248, 31.2)
collision_layer = 0
collision_mask = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="RayCast2D"]
position = Vector2(0, 14.8)
shape = SubResource("RectangleShape2D_cq6dk")
[node name="RayCast2D2" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="RayCast2D2"]
position = Vector2(0, 8.8)
shape = SubResource("RectangleShape2D_cq6dk")
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("4_b1m5t")
volume_db = 15.0

11
enemies/leech/segment.gd Normal file
View file

@ -0,0 +1,11 @@
extends Area2D
@onready var player = get_tree().get_root().get_node_or_null("main/Player")
var damage = 1
func _process(_delta: float) -> void:
if (player != null and overlaps_body(player)):
player.hurt(damage, self.global_position-player.global_position)
# Forward taken damage to the parent leech.
func _on_hurtbox_damaged(dmg : int, dir : Vector2, id):
get_parent().get_parent().hurt(dmg, dir, id)

View file

@ -0,0 +1 @@
uid://b3q5khoqnnicx

BIN
enemies/leech/segment.pdn Normal file

Binary file not shown.

BIN
enemies/leech/segment.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bx4w0yifutm7y"
path="res://.godot/imported/segment.png-cdd72fb07696c7bd21dcdf251ba1e79d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://enemies/leech/segment.png"
dest_files=["res://.godot/imported/segment.png-cdd72fb07696c7bd21dcdf251ba1e79d.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -0,0 +1,36 @@
[gd_scene load_steps=5 format=3 uid="uid://cvoicwo2xnf7e"]
[ext_resource type="Script" uid="uid://b3q5khoqnnicx" path="res://enemies/leech/segment.gd" id="1_o43lr"]
[ext_resource type="Texture2D" uid="uid://bx4w0yifutm7y" path="res://enemies/leech/segment.png" id="2_jsq5k"]
[ext_resource type="PackedScene" uid="uid://mtfsdd4cdf3a" path="res://utils/enemy_hurtbox.tscn" id="3_sa5vt"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_fgt1l"]
[node name="Segment" type="Area2D"]
z_index = 4
collision_layer = 0
collision_mask = 4
script = ExtResource("1_o43lr")
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(-1.9073486e-06, 0)
rotation = 1.5707964
scale = Vector2(0.6233792, 0.6257627)
texture = ExtResource("2_jsq5k")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
scale = Vector2(2, 1)
shape = SubResource("RectangleShape2D_fgt1l")
[node name="EnemyHurtbox" parent="." node_paths=PackedStringArray("canvasItem") instance=ExtResource("3_sa5vt")]
collision_layer = 16
canvasItem = NodePath("..")
flashColor = Color(2.00392, 2.00392, 2.00392, 1)
id_block_time = 0.0
[node name="CollisionShape2D" type="CollisionShape2D" parent="EnemyHurtbox"]
visible = false
scale = Vector2(2, 1)
shape = SubResource("RectangleShape2D_fgt1l")
[connection signal="damage_taken" from="EnemyHurtbox" to="." method="_on_hurtbox_damaged"]

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://03pv5447noi8"
path="res://.godot/imported/segment_end.png-3737d47c0764ba7974a4bc464eccda0b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://enemies/leech/segment_end.png"
dest_files=["res://.godot/imported/segment_end.png-3737d47c0764ba7974a4bc464eccda0b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -0,0 +1,35 @@
[gd_scene load_steps=5 format=3 uid="uid://dn8qucrpq6k72"]
[ext_resource type="Script" uid="uid://b3q5khoqnnicx" path="res://enemies/leech/segment.gd" id="1_tokuw"]
[ext_resource type="Texture2D" uid="uid://03pv5447noi8" path="res://enemies/leech/segment_end.png" id="2_tokuw"]
[ext_resource type="PackedScene" uid="uid://mtfsdd4cdf3a" path="res://utils/enemy_hurtbox.tscn" id="3_ws4kp"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_fgt1l"]
[node name="Segment" type="Area2D"]
z_index = 4
collision_layer = 0
collision_mask = 4
script = ExtResource("1_tokuw")
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(-1.9073486e-06, 0)
rotation = 1.5707964
scale = Vector2(0.6233792, 0.6257627)
texture = ExtResource("2_tokuw")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
scale = Vector2(2, 1)
shape = SubResource("RectangleShape2D_fgt1l")
[node name="EnemyHurtbox" parent="." node_paths=PackedStringArray("canvasItem") instance=ExtResource("3_ws4kp")]
collision_layer = 16
canvasItem = NodePath("..")
flashColor = Color(2.00392, 2.00392, 2.00392, 1)
[node name="CollisionShape2D" type="CollisionShape2D" parent="EnemyHurtbox"]
visible = false
scale = Vector2(2, 1)
shape = SubResource("RectangleShape2D_fgt1l")
[connection signal="damage_taken" from="EnemyHurtbox" to="." method="_on_hurtbox_damaged"]

110
export_presets.cfg Normal file
View file

@ -0,0 +1,110 @@
[preset.0]
name="Windows Desktop"
platform="Windows Desktop"
runnable=true
advanced_options=false
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../The Dark Side of Earth.exe"
patches=PackedStringArray()
encryption_include_filters=""
encryption_exclude_filters=""
seed=0
encrypt_pck=false
encrypt_directory=false
script_export_mode=2
[preset.0.options]
custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=1
binary_format/embed_pck=false
texture_format/s3tc_bptc=true
texture_format/etc2_astc=false
shader_baker/enabled=false
binary_format/architecture="x86_64"
codesign/enable=false
codesign/timestamp=true
codesign/timestamp_server_url=""
codesign/digest_algorithm=1
codesign/description=""
codesign/custom_options=PackedStringArray()
application/modify_resources=true
application/icon=""
application/console_wrapper_icon=""
application/icon_interpolation=4
application/file_version=""
application/product_version=""
application/company_name=""
application/product_name=""
application/file_description=""
application/copyright=""
application/trademarks=""
application/export_angle=0
application/export_d3d12=0
application/d3d12_agility_sdk_multiarch=true
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"
ssh_remote_deploy/extra_args_ssh=""
ssh_remote_deploy/extra_args_scp=""
ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}'
$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}'
$trigger = New-ScheduledTaskTrigger -Once -At 00:00
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries
$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings
Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true
Start-ScheduledTask -TaskName godot_remote_debug
while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 }
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue"
ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force '{temp_dir}'"
[preset.1]
name="Linux"
platform="Linux"
runnable=true
advanced_options=false
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../The Dark Side of Earth.x86_64"
patches=PackedStringArray()
encryption_include_filters=""
encryption_exclude_filters=""
seed=0
encrypt_pck=false
encrypt_directory=false
script_export_mode=2
[preset.1.options]
custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=1
binary_format/embed_pck=false
texture_format/s3tc_bptc=true
texture_format/etc2_astc=false
shader_baker/enabled=false
binary_format/architecture="x86_64"
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"
ssh_remote_deploy/extra_args_ssh=""
ssh_remote_deploy/extra_args_scp=""
ssh_remote_deploy/run_script="#!/usr/bin/env bash
export DISPLAY=:0
unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
\"{temp_dir}/{exe_name}\" {cmd_args}"
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
rm -rf \"{temp_dir}\""

46
grid.gd
View file

@ -1,46 +0,0 @@
class_name Grid extends Node2D
@export var ground_radius : float
@export var cell_height : float
@export var num_collumns : int
@export var debug : bool
var buildings : Array[Building] = []
func _draw() -> void:
if !debug:
return
for i in range(10):
draw_arc(Vector2.ZERO, ground_radius + i * cell_height, 0, TAU, 250, Color.SKY_BLUE, 1.0, true);
for i in range(num_collumns):
var angle = i * TAU / num_collumns;
draw_line(Vector2.ZERO, 10000 * Vector2.from_angle(angle), Color.SKY_BLUE);
func add_building_to_collumn(building : Building, collumn : int):
# find the height of the top building in the buildings list:
building.location = Vector2(collumn, 0)
var height = 0
# TODO: support other dimensions for buildings
# add the new building one higher than the previous
height += 1
building.location = Vector2i(collumn, height);
# for testing
func _ready() -> void:
var packed : PackedScene = preload("res://building.tscn")
var test_building = packed.instantiate()
test_building.location = Vector2(45, 0)
add_child(test_building)
test_building = packed.instantiate()
test_building.location = Vector2(44, 0)
add_child(test_building)
test_building = packed.instantiate()
test_building.location = Vector2(45, 1)
add_child(test_building)

View file

@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.cte
compress/mode=0 compress/mode=0
compress/high_quality=false compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1 compress/hdr_compression=1
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 compress/channel_pack=0
@ -25,6 +27,10 @@ mipmaps/generate=false
mipmaps/limit=-1 mipmaps/limit=-1
roughness/mode=0 roughness/mode=0
roughness/src_normal="" roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true process/fix_alpha_border=true
process/premult_alpha=false process/premult_alpha=false
process/normal_map_invert_y=false process/normal_map_invert_y=false

View file

@ -0,0 +1,11 @@
extends Area2D
var damage = 20
var direction = Vector2(1,0)
@export var speed = 2000
@onready var dmg_id = Global.next_dmg_id
func _process(delta: float) -> void:
self.position += delta * speed * direction
for area in get_overlapping_areas():
area.hurt(damage, -3 * direction, dmg_id)

View file

@ -0,0 +1 @@
uid://bglrm0bb4nla

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bavoghl2pxs83"
path="res://.godot/imported/arrow.png-2cffe6fabf19679230c231a1fd8a329e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://items/consumables/bow/arrow.png"
dest_files=["res://.godot/imported/arrow.png-2cffe6fabf19679230c231a1fd8a329e.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

View file

@ -0,0 +1,22 @@
[gd_scene load_steps=4 format=3 uid="uid://dfva4dhflxglr"]
[ext_resource type="Script" uid="uid://bglrm0bb4nla" path="res://items/consumables/bow/arrow.gd" id="1_lxthq"]
[ext_resource type="Texture2D" uid="uid://bavoghl2pxs83" path="res://items/consumables/bow/arrow.png" id="2_ilsew"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_tfcgf"]
size = Vector2(20, 5)
[node name="Arrow" type="Area2D"]
collision_layer = 0
collision_mask = 18
script = ExtResource("1_lxthq")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
scale = Vector2(3, 2)
shape = SubResource("RectangleShape2D_tfcgf")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture_filter = 1
position = Vector2(0, -1)
scale = Vector2(2, 2)
texture = ExtResource("2_ilsew")

View file

@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://bu3j6ambrybd2"]
[ext_resource type="Texture2D" uid="uid://bavoghl2pxs83" path="res://items/consumables/bow/arrow.png" id="1_7lvex"]
[node name="TextureRect" type="TextureRect"]
custom_minimum_size = Vector2(0, 3)
texture = ExtResource("1_7lvex")
expand_mode = 3
stretch_mode = 3

View file

@ -0,0 +1,21 @@
extends ActiveItem
@export var cooldown = 0.3
@export var arrow_scene : PackedScene
func actually_collect():
player.set_cooldown(cooldown)
func activate():
player.activate_cooldown()
# Spawn an arrow on activation
var arrow : Area2D = arrow_scene.instantiate()
get_tree().get_root().add_child(arrow)
arrow.position = player.position
arrow.rotation = player.rotation
arrow.direction = player.get_node("EarthAligner").right * player.facing
# Make sure the arrow sprite faces the right direction
if(player.facing == -1):
arrow.get_node("Sprite2D").scale.x = - arrow.get_node("Sprite2D").scale.x
$SoundBowRelease.play()

View file

@ -0,0 +1 @@
uid://bkcip66at5sug

Binary file not shown.

After

Width:  |  Height:  |  Size: 967 B

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d01h01le82gyh"
path="res://.godot/imported/bow.png-7ca2f79a3aaf0404b0d2a5f64b2c7b38.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://items/consumables/bow/bow.png"
dest_files=["res://.godot/imported/bow.png-7ca2f79a3aaf0404b0d2a5f64b2c7b38.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -0,0 +1,47 @@
[gd_scene load_steps=10 format=3 uid="uid://ddn025xnjngko"]
[ext_resource type="Script" uid="uid://bkcip66at5sug" path="res://items/consumables/bow/bow.gd" id="1_xppub"]
[ext_resource type="PackedScene" uid="uid://dfva4dhflxglr" path="res://items/consumables/bow/arrow.tscn" id="2_0id2q"]
[ext_resource type="Texture2D" uid="uid://d01h01le82gyh" path="res://items/consumables/bow/bow.png" id="3_vkelq"]
[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="4_0id2q"]
[ext_resource type="PackedScene" uid="uid://bu3j6ambrybd2" path="res://items/consumables/bow/arrow_icon.tscn" id="4_2dslu"]
[ext_resource type="AudioStream" uid="uid://bg1w0fyeyys2p" path="res://sounds/item-equip-6904.mp3" id="5_gfbg0"]
[ext_resource type="Texture2D" uid="uid://d4mrbgfl7jpqq" path="res://items/generic/ItemShine.png" id="5_o1smo"]
[ext_resource type="AudioStream" uid="uid://10ljbd4djqgb" path="res://sounds/263675__porkmuncher__bow_release_cut.wav" id="7_o1smo"]
[sub_resource type="CircleShape2D" id="CircleShape2D_gllxn"]
radius = 13.239409
[node name="Bow" type="Area2D"]
collision_layer = 0
collision_mask = 4
script = ExtResource("1_xppub")
arrow_scene = ExtResource("2_0id2q")
sprite = ExtResource("3_vkelq")
uses_left_icon = ExtResource("4_2dslu")
uses = 5
icon = ExtResource("3_vkelq")
item_name = "Bow"
[node name="EarthAligner" parent="." instance=ExtResource("4_0id2q")]
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(5, 2)
scale = Vector2(2.17, 3.5)
shape = SubResource("CircleShape2D_gllxn")
[node name="Sprite2D2" type="Sprite2D" parent="."]
position = Vector2(8, 2)
scale = Vector2(1.5, 1.5)
texture = ExtResource("5_o1smo")
[node name="Sprite2D" type="Sprite2D" parent="."]
scale = Vector2(1.4, 1.4)
texture = ExtResource("3_vkelq")
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("5_gfbg0")
volume_db = 15.0
[node name="SoundBowRelease" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("7_o1smo")

View file

@ -0,0 +1,8 @@
extends Item
@export var heal_amount = 1
func collect() -> bool:
if(player.current_hp < player.max_hp):
player.current_hp += heal_amount
return true
return false

View file

@ -0,0 +1 @@
uid://b43fudwi47qfd

Some files were not shown because too many files have changed in this diff Show more