├── .gitattributes ├── .gitignore ├── Art ├── Arks │ ├── DinoSprites - doux.png │ ├── DinoSprites - doux.png.import │ ├── DinoSprites - mort.png │ ├── DinoSprites - mort.png.import │ ├── DinoSprites - tard.png │ ├── DinoSprites - tard.png.import │ ├── DinoSprites - vita.png │ ├── DinoSprites - vita.png.import │ └── Info.txt ├── Bitlytic │ ├── B0-Z0.png │ ├── B0-Z0.png.import │ ├── bullet.png │ ├── bullet.png.import │ ├── crosshair.png │ └── crosshair.png.import ├── Kenney │ ├── 1_bit_pack.png │ ├── 1_bit_pack.png.import │ ├── Info.txt │ ├── carrot.png │ ├── carrot.png.import │ ├── crafting_bg.png │ ├── crafting_bg.png.import │ ├── firework.png │ ├── firework.png.import │ ├── fish.png │ ├── fish.png.import │ ├── potion.png │ ├── potion.png.import │ ├── sword.png │ ├── sword.png.import │ ├── ui_packed.png │ └── ui_packed.png.import └── RGS_Dev │ ├── Info.txt │ ├── tileset_blue.png │ ├── tileset_blue.png.import │ ├── tileset_brown.png │ └── tileset_brown.png.import ├── Objects ├── Scenes │ ├── aoe_damage.tscn │ ├── bullet.tscn │ ├── bullet_particles.tscn │ ├── ene297E.tmp │ ├── eneA2C1.tmp │ ├── enemy.tscn │ ├── item_drop.tscn │ ├── lev8705.tmp │ └── level_transition.tscn └── Scripts │ ├── Enemy │ ├── enemy.gd │ ├── enemy_animation.gd │ ├── enemy_chase.gd │ ├── enemy_health.gd │ ├── enemy_health_bar.gd │ └── health_label.gd │ ├── bullet.gd │ ├── bullet_particles.gd │ ├── item_drop.gd │ ├── level_transition.gd │ └── stun_handler.gd ├── Player ├── Animations │ └── player.res ├── Scripts │ ├── aoe_damage.gd │ ├── player.gd │ ├── player_animation.gd │ ├── player_camera.gd │ ├── player_movement.gd │ └── player_weapon.gd ├── pla2974.tmp ├── pla46D.tmp ├── player.tscn ├── player_health.gd ├── player_sprite.gd └── sword.gd ├── README.md ├── Resources ├── Enemy │ ├── blue_dino.tres │ ├── green_dino.tres │ ├── red_dino.tres │ └── yellow_dino.tres ├── Items │ ├── Materials │ │ ├── bone.tres │ │ ├── fish.tres │ │ ├── rock.tres │ │ └── stick.tres │ └── Weapons │ │ ├── bone_sword.tres │ │ ├── stone_axe.tres │ │ ├── stone_pickaxe.tres │ │ └── stone_shovel.tres ├── LootTables │ ├── blue_dino_loot.tres │ ├── red_dino_loot.tres │ └── yellow_dino_loot.tres ├── Recipes │ ├── bone_sword_recipe.tres │ ├── stone_axe_recipe.tres │ ├── stone_pickaxe_recipe.tres │ └── stone_shovel_recipe.tres ├── Tileset │ ├── blue_tiles.tres │ └── brown_tiles.tres ├── WeaponStats │ ├── big_shot.tres │ └── machine_gun.tres └── camera_noise.tres ├── Scenes ├── main.tscn └── main_blue.tscn ├── Sound ├── hitHurt.wav └── hitHurt.wav.import ├── UI ├── Font │ ├── Silkscreen-Bold.ttf │ ├── Silkscreen-Bold.ttf.import │ ├── Silkscreen-Regular.ttf │ └── Silkscreen-Regular.ttf.import ├── Scenes │ ├── craft_button.gd │ ├── crafting_menu.gd │ ├── crafting_menu.tscn │ ├── ingredient.gd │ ├── ingredient.tscn │ ├── item_slot.tscn │ ├── recipe_button.gd │ └── recipe_button.tscn ├── Scripts │ ├── inventory_display.gd │ └── item_slot.gd ├── Theme │ └── main_theme.tres └── item_bar.gd ├── Util ├── Autoload │ ├── camera_shake.gd │ ├── display_manager.gd │ ├── enemy_spawner.gd │ ├── hit_pause.gd │ └── sound_manager.gd ├── Classes │ ├── attack.gd │ └── weapon_stats.gd ├── Components │ ├── health.gd │ ├── hitbox.gd │ └── hurtbox.gd ├── Enemy │ ├── enemy_stats.gd │ └── loot_table.gd ├── Inventory │ └── inventory.gd └── Items │ ├── crafting_ingredient.gd │ ├── crafting_recipe.gd │ ├── crafting_registry.gd │ ├── item.gd │ ├── item_roll.gd │ ├── item_stack.gd │ └── items.gd ├── default_bus_layout.tres ├── export_presets.cfg ├── icon.svg ├── icon.svg.import └── project.godot /.gitattributes: -------------------------------------------------------------------------------- 1 | # Normalize EOL for all files that Git considers text files. 2 | * text=auto eol=lf 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Godot 4+ specific ignores 2 | .godot/ 3 | -------------------------------------------------------------------------------- /Art/Arks/DinoSprites - doux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Art/Arks/DinoSprites - doux.png -------------------------------------------------------------------------------- /Art/Arks/DinoSprites - doux.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://drfyuy8w6p057" 6 | path="res://.godot/imported/DinoSprites - doux.png-9413f6c22a0a0b6b5eb66280c939fc43.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://Art/Arks/DinoSprites - doux.png" 14 | dest_files=["res://.godot/imported/DinoSprites - doux.png-9413f6c22a0a0b6b5eb66280c939fc43.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /Art/Arks/DinoSprites - mort.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Art/Arks/DinoSprites - mort.png -------------------------------------------------------------------------------- /Art/Arks/DinoSprites - mort.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://c5cbe07dk5lyn" 6 | path="res://.godot/imported/DinoSprites - mort.png-4944bd8cdfbc162b53514a6f97b8c4f2.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://Art/Arks/DinoSprites - mort.png" 14 | dest_files=["res://.godot/imported/DinoSprites - mort.png-4944bd8cdfbc162b53514a6f97b8c4f2.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /Art/Arks/DinoSprites - tard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Art/Arks/DinoSprites - tard.png -------------------------------------------------------------------------------- /Art/Arks/DinoSprites - tard.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://cqcr6ctruxfn5" 6 | path="res://.godot/imported/DinoSprites - tard.png-069143546edf47b1dd1c622c0519259d.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://Art/Arks/DinoSprites - tard.png" 14 | dest_files=["res://.godot/imported/DinoSprites - tard.png-069143546edf47b1dd1c622c0519259d.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /Art/Arks/DinoSprites - vita.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Art/Arks/DinoSprites - vita.png -------------------------------------------------------------------------------- /Art/Arks/DinoSprites - vita.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://eb28cx5toii3" 6 | path="res://.godot/imported/DinoSprites - vita.png-e25ab919c4e2a987068a3c0b803fbb7f.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://Art/Arks/DinoSprites - vita.png" 14 | dest_files=["res://.godot/imported/DinoSprites - vita.png-e25ab919c4e2a987068a3c0b803fbb7f.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /Art/Arks/Info.txt: -------------------------------------------------------------------------------- 1 | Link: https://arks.itch.io/dino-characters 2 | -------------------------------------------------------------------------------- /Art/Bitlytic/B0-Z0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Art/Bitlytic/B0-Z0.png -------------------------------------------------------------------------------- /Art/Bitlytic/B0-Z0.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://b8qo5sm247axm" 6 | path="res://.godot/imported/B0-Z0.png-1060b3861fc03e514e9cec92df40b1cd.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://Art/Bitlytic/B0-Z0.png" 14 | dest_files=["res://.godot/imported/B0-Z0.png-1060b3861fc03e514e9cec92df40b1cd.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /Art/Bitlytic/bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Art/Bitlytic/bullet.png -------------------------------------------------------------------------------- /Art/Bitlytic/bullet.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://cr8v60ue1jsl7" 6 | path="res://.godot/imported/bullet.png-283aaa19221fe8b6202bb47a1e411067.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://Art/Bitlytic/bullet.png" 14 | dest_files=["res://.godot/imported/bullet.png-283aaa19221fe8b6202bb47a1e411067.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /Art/Bitlytic/crosshair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Art/Bitlytic/crosshair.png -------------------------------------------------------------------------------- /Art/Bitlytic/crosshair.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://dnp54j8h1op73" 6 | path="res://.godot/imported/crosshair.png-4801de39bb15a47086fac39f4aedb369.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://Art/Bitlytic/crosshair.png" 14 | dest_files=["res://.godot/imported/crosshair.png-4801de39bb15a47086fac39f4aedb369.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /Art/Kenney/1_bit_pack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Art/Kenney/1_bit_pack.png -------------------------------------------------------------------------------- /Art/Kenney/1_bit_pack.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://dnfmimtdyt0r0" 6 | path="res://.godot/imported/1_bit_pack.png-85ca36c0d1df5b77908e36fcbe0e55ad.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://Art/Kenney/1_bit_pack.png" 14 | dest_files=["res://.godot/imported/1_bit_pack.png-85ca36c0d1df5b77908e36fcbe0e55ad.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /Art/Kenney/Info.txt: -------------------------------------------------------------------------------- 1 | Link: https://kenney.nl/assets/1-bit-pack 2 | -------------------------------------------------------------------------------- /Art/Kenney/carrot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Art/Kenney/carrot.png -------------------------------------------------------------------------------- /Art/Kenney/carrot.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://30ltamteuvkx" 6 | path="res://.godot/imported/carrot.png-002f96bcb4aeb01ab290a59ab5060391.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://Art/Kenney/carrot.png" 14 | dest_files=["res://.godot/imported/carrot.png-002f96bcb4aeb01ab290a59ab5060391.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /Art/Kenney/crafting_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Art/Kenney/crafting_bg.png -------------------------------------------------------------------------------- /Art/Kenney/crafting_bg.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://c7h5np6ak151j" 6 | path="res://.godot/imported/crafting_bg.png-8bfa63229a8e850d60e9c6b5a51f608c.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://Art/Kenney/crafting_bg.png" 14 | dest_files=["res://.godot/imported/crafting_bg.png-8bfa63229a8e850d60e9c6b5a51f608c.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /Art/Kenney/firework.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Art/Kenney/firework.png -------------------------------------------------------------------------------- /Art/Kenney/firework.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://0aylbueaelkc" 6 | path="res://.godot/imported/firework.png-8d22a9e7b0dbb320db518ad9ff0f687e.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://Art/Kenney/firework.png" 14 | dest_files=["res://.godot/imported/firework.png-8d22a9e7b0dbb320db518ad9ff0f687e.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /Art/Kenney/fish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Art/Kenney/fish.png -------------------------------------------------------------------------------- /Art/Kenney/fish.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://53h01ho1lvwp" 6 | path="res://.godot/imported/fish.png-81713d198b12aee450a4f0291336be39.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://Art/Kenney/fish.png" 14 | dest_files=["res://.godot/imported/fish.png-81713d198b12aee450a4f0291336be39.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /Art/Kenney/potion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Art/Kenney/potion.png -------------------------------------------------------------------------------- /Art/Kenney/potion.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://c26ro5ifb4gg4" 6 | path="res://.godot/imported/potion.png-b204cf6ce8f6c26d6136443630528b0c.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://Art/Kenney/potion.png" 14 | dest_files=["res://.godot/imported/potion.png-b204cf6ce8f6c26d6136443630528b0c.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /Art/Kenney/sword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Art/Kenney/sword.png -------------------------------------------------------------------------------- /Art/Kenney/sword.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://bsa10ditblwyg" 6 | path="res://.godot/imported/sword.png-f0b7d6229aa25b9f3129ae44c07a0ebd.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://Art/Kenney/sword.png" 14 | dest_files=["res://.godot/imported/sword.png-f0b7d6229aa25b9f3129ae44c07a0ebd.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /Art/Kenney/ui_packed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Art/Kenney/ui_packed.png -------------------------------------------------------------------------------- /Art/Kenney/ui_packed.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://c5xonqa2480cc" 6 | path="res://.godot/imported/ui_packed.png-6e0b32ae6ff8ff3baaed46ef6fad6c83.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://Art/Kenney/ui_packed.png" 14 | dest_files=["res://.godot/imported/ui_packed.png-6e0b32ae6ff8ff3baaed46ef6fad6c83.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /Art/RGS_Dev/Info.txt: -------------------------------------------------------------------------------- 1 | Link: https://rgsdev.itch.io/free-cc0-top-down-tileset-template-pixel-art 2 | -------------------------------------------------------------------------------- /Art/RGS_Dev/tileset_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Art/RGS_Dev/tileset_blue.png -------------------------------------------------------------------------------- /Art/RGS_Dev/tileset_blue.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://bdlnxydf3kem5" 6 | path="res://.godot/imported/tileset_blue.png-a80973e6043e47f0aff1047ccf665077.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://Art/RGS_Dev/tileset_blue.png" 14 | dest_files=["res://.godot/imported/tileset_blue.png-a80973e6043e47f0aff1047ccf665077.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /Art/RGS_Dev/tileset_brown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Art/RGS_Dev/tileset_brown.png -------------------------------------------------------------------------------- /Art/RGS_Dev/tileset_brown.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://cyr2m6q5pv84" 6 | path="res://.godot/imported/tileset_brown.png-e898a4dfbeaa2140469ae1477fd0cd3d.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://Art/RGS_Dev/tileset_brown.png" 14 | dest_files=["res://.godot/imported/tileset_brown.png-e898a4dfbeaa2140469ae1477fd0cd3d.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /Objects/Scenes/aoe_damage.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=3 uid="uid://b87fsq0thjuux"] 2 | 3 | [ext_resource type="Script" path="res://Player/Scripts/aoe_damage.gd" id="1_pt6de"] 4 | 5 | [sub_resource type="CircleShape2D" id="CircleShape2D_qeb0v"] 6 | 7 | [node name="AoEDamage" type="Node2D"] 8 | script = ExtResource("1_pt6de") 9 | area_radius = 50.0 10 | attack_damage = 1.0 11 | cooldown_time = 1.0 12 | knockback_value = 30.0 13 | 14 | [node name="ProcTimer" type="Timer" parent="."] 15 | autostart = true 16 | 17 | [node name="EffectArea" type="Area2D" parent="."] 18 | collision_layer = 2 19 | collision_mask = 4 20 | 21 | [node name="CollisionShape2D" type="CollisionShape2D" parent="EffectArea"] 22 | shape = SubResource("CircleShape2D_qeb0v") 23 | -------------------------------------------------------------------------------- /Objects/Scenes/bullet.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=3 uid="uid://dvnhfujng2ybw"] 2 | 3 | [ext_resource type="Script" path="res://Objects/Scripts/bullet.gd" id="1_7775e"] 4 | [ext_resource type="Texture2D" uid="uid://cr8v60ue1jsl7" path="res://Art/Bitlytic/bullet.png" id="1_gclts"] 5 | [ext_resource type="Script" path="res://Util/Components/hurtbox.gd" id="3_2ig4x"] 6 | 7 | [sub_resource type="CircleShape2D" id="CircleShape2D_0cebq"] 8 | radius = 6.0 9 | 10 | [sub_resource type="CircleShape2D" id="CircleShape2D_jng58"] 11 | radius = 7.0 12 | 13 | [node name="Bullet" type="CharacterBody2D" node_paths=PackedStringArray("hurtbox")] 14 | top_level = true 15 | collision_layer = 0 16 | collision_mask = 128 17 | script = ExtResource("1_7775e") 18 | hurtbox = NodePath("BulletHurtbox") 19 | 20 | [node name="Sprite2D" type="Sprite2D" parent="."] 21 | rotation = 1.5708 22 | texture = ExtResource("1_gclts") 23 | 24 | [node name="Floor Collision" type="CollisionShape2D" parent="."] 25 | shape = SubResource("CircleShape2D_0cebq") 26 | 27 | [node name="BulletHurtbox" type="Area2D" parent="."] 28 | collision_layer = 0 29 | collision_mask = 4 30 | script = ExtResource("3_2ig4x") 31 | 32 | [node name="CollisionShape2D" type="CollisionShape2D" parent="BulletHurtbox"] 33 | shape = SubResource("CircleShape2D_jng58") 34 | -------------------------------------------------------------------------------- /Objects/Scenes/bullet_particles.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=3 uid="uid://drl8260u6fogv"] 2 | 3 | [ext_resource type="Script" path="res://Objects/Scripts/bullet_particles.gd" id="1_0u1m1"] 4 | 5 | [sub_resource type="Gradient" id="Gradient_jr0ln"] 6 | offsets = PackedFloat32Array(0, 0.828729, 0.872928) 7 | colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0.848101, 1, 1, 1, 0) 8 | 9 | [sub_resource type="GradientTexture1D" id="GradientTexture1D_gftm8"] 10 | gradient = SubResource("Gradient_jr0ln") 11 | 12 | [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_p1lar"] 13 | particle_flag_disable_z = true 14 | spread = 180.0 15 | initial_velocity_min = 25.0 16 | initial_velocity_max = 50.0 17 | gravity = Vector3(0, 0, 0) 18 | color_ramp = SubResource("GradientTexture1D_gftm8") 19 | 20 | [node name="BulletParticles" type="GPUParticles2D"] 21 | amount = 32 22 | process_material = SubResource("ParticleProcessMaterial_p1lar") 23 | script = ExtResource("1_0u1m1") 24 | -------------------------------------------------------------------------------- /Objects/Scenes/ene297E.tmp: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=26 format=3 uid="uid://ckfohqhp1io7i"] 2 | 3 | [ext_resource type="Script" path="res://Objects/Scripts/Enemy/enemy.gd" id="1_i5ap4"] 4 | [ext_resource type="Resource" uid="uid://d0vpr4kgckjx6" path="res://Resources/Enemy/yellow_dino.tres" id="2_cu4um"] 5 | [ext_resource type="Texture2D" uid="uid://eb28cx5toii3" path="res://Art/Arks/DinoSprites - vita.png" id="5_8jp15"] 6 | [ext_resource type="Script" path="res://Util/Components/hitbox.gd" id="6_4fu81"] 7 | [ext_resource type="Script" path="res://Objects/Scripts/Enemy/enemy_animation.gd" id="7_136f6"] 8 | [ext_resource type="Script" path="res://Objects/Scripts/Enemy/enemy_chase.gd" id="10_1a1ec"] 9 | [ext_resource type="Script" path="res://Objects/Scripts/Enemy/enemy_health.gd" id="10_uthop"] 10 | [ext_resource type="Script" path="res://Objects/Scripts/stun_handler.gd" id="11_drljl"] 11 | [ext_resource type="Script" path="res://Util/Components/hurtbox.gd" id="12_42qi7"] 12 | [ext_resource type="Script" path="res://Objects/Scripts/Enemy/enemy_health_bar.gd" id="13_5fmek"] 13 | 14 | [sub_resource type="CircleShape2D" id="CircleShape2D_7ufao"] 15 | radius = 13.0 16 | 17 | [sub_resource type="CircleShape2D" id="CircleShape2D_n22t5"] 18 | radius = 8.0 19 | 20 | [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_llgnc"] 21 | radius = 5.0 22 | height = 16.0 23 | 24 | [sub_resource type="Animation" id="Animation_3rrto"] 25 | length = 0.001 26 | tracks/0/type = "value" 27 | tracks/0/imported = false 28 | tracks/0/enabled = true 29 | tracks/0/path = NodePath("Sprite2D:frame") 30 | tracks/0/interp = 1 31 | tracks/0/loop_wrap = true 32 | tracks/0/keys = { 33 | "times": PackedFloat32Array(0), 34 | "transitions": PackedFloat32Array(1), 35 | "update": 1, 36 | "values": [0] 37 | } 38 | tracks/1/type = "value" 39 | tracks/1/imported = false 40 | tracks/1/enabled = true 41 | tracks/1/path = NodePath("Sprite2D:flip_h") 42 | tracks/1/interp = 1 43 | tracks/1/loop_wrap = true 44 | tracks/1/keys = { 45 | "times": PackedFloat32Array(0), 46 | "transitions": PackedFloat32Array(1), 47 | "update": 1, 48 | "values": [false] 49 | } 50 | tracks/2/type = "value" 51 | tracks/2/imported = false 52 | tracks/2/enabled = true 53 | tracks/2/path = NodePath("Sprite2D:modulate") 54 | tracks/2/interp = 1 55 | tracks/2/loop_wrap = true 56 | tracks/2/keys = { 57 | "times": PackedFloat32Array(0), 58 | "transitions": PackedFloat32Array(1), 59 | "update": 0, 60 | "values": [Color(1, 1, 1, 1)] 61 | } 62 | tracks/3/type = "value" 63 | tracks/3/imported = false 64 | tracks/3/enabled = true 65 | tracks/3/path = NodePath("Sprite2D:rotation") 66 | tracks/3/interp = 1 67 | tracks/3/loop_wrap = true 68 | tracks/3/keys = { 69 | "times": PackedFloat32Array(0), 70 | "transitions": PackedFloat32Array(1), 71 | "update": 0, 72 | "values": [0.0] 73 | } 74 | tracks/4/type = "value" 75 | tracks/4/imported = false 76 | tracks/4/enabled = true 77 | tracks/4/path = NodePath("Sprite2D:position") 78 | tracks/4/interp = 1 79 | tracks/4/loop_wrap = true 80 | tracks/4/keys = { 81 | "times": PackedFloat32Array(0), 82 | "transitions": PackedFloat32Array(1), 83 | "update": 0, 84 | "values": [Vector2(0, 0)] 85 | } 86 | tracks/5/type = "value" 87 | tracks/5/imported = false 88 | tracks/5/enabled = true 89 | tracks/5/path = NodePath("Hitbox/CollisionShape2D:disabled") 90 | tracks/5/interp = 1 91 | tracks/5/loop_wrap = true 92 | tracks/5/keys = { 93 | "times": PackedFloat32Array(0), 94 | "transitions": PackedFloat32Array(1), 95 | "update": 1, 96 | "values": [false] 97 | } 98 | tracks/6/type = "value" 99 | tracks/6/imported = false 100 | tracks/6/enabled = true 101 | tracks/6/path = NodePath("HealthBar:modulate") 102 | tracks/6/interp = 1 103 | tracks/6/loop_wrap = true 104 | tracks/6/keys = { 105 | "times": PackedFloat32Array(0), 106 | "transitions": PackedFloat32Array(1), 107 | "update": 0, 108 | "values": [Color(1, 1, 1, 1)] 109 | } 110 | 111 | [sub_resource type="Animation" id="Animation_o6yyx"] 112 | resource_name = "death" 113 | step = 0.05 114 | tracks/0/type = "value" 115 | tracks/0/imported = false 116 | tracks/0/enabled = true 117 | tracks/0/path = NodePath("Sprite2D:frame") 118 | tracks/0/interp = 1 119 | tracks/0/loop_wrap = true 120 | tracks/0/keys = { 121 | "times": PackedFloat32Array(0, 0.05, 0.15), 122 | "transitions": PackedFloat32Array(1, 1, 1), 123 | "update": 1, 124 | "values": [14, 15, 16] 125 | } 126 | tracks/1/type = "value" 127 | tracks/1/imported = false 128 | tracks/1/enabled = true 129 | tracks/1/path = NodePath("Sprite2D:modulate") 130 | tracks/1/interp = 1 131 | tracks/1/loop_wrap = true 132 | tracks/1/keys = { 133 | "times": PackedFloat32Array(0.7, 1), 134 | "transitions": PackedFloat32Array(0.5, 1), 135 | "update": 0, 136 | "values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)] 137 | } 138 | tracks/2/type = "value" 139 | tracks/2/imported = false 140 | tracks/2/enabled = true 141 | tracks/2/path = NodePath("Sprite2D:rotation") 142 | tracks/2/interp = 1 143 | tracks/2/loop_wrap = true 144 | tracks/2/keys = { 145 | "times": PackedFloat32Array(0.7, 1), 146 | "transitions": PackedFloat32Array(0.5, 1), 147 | "update": 0, 148 | "values": [0.0, 6.28319] 149 | } 150 | tracks/3/type = "value" 151 | tracks/3/imported = false 152 | tracks/3/enabled = true 153 | tracks/3/path = NodePath("Sprite2D:position") 154 | tracks/3/interp = 1 155 | tracks/3/loop_wrap = true 156 | tracks/3/keys = { 157 | "times": PackedFloat32Array(0.7, 1), 158 | "transitions": PackedFloat32Array(0.5, 1), 159 | "update": 0, 160 | "values": [Vector2(0, 0), Vector2(0, -14)] 161 | } 162 | tracks/4/type = "value" 163 | tracks/4/imported = false 164 | tracks/4/enabled = true 165 | tracks/4/path = NodePath("Hitbox/CollisionShape2D:disabled") 166 | tracks/4/interp = 1 167 | tracks/4/loop_wrap = true 168 | tracks/4/keys = { 169 | "times": PackedFloat32Array(0), 170 | "transitions": PackedFloat32Array(1), 171 | "update": 1, 172 | "values": [true] 173 | } 174 | tracks/5/type = "value" 175 | tracks/5/imported = false 176 | tracks/5/enabled = true 177 | tracks/5/path = NodePath("HealthBar:modulate") 178 | tracks/5/interp = 1 179 | tracks/5/loop_wrap = true 180 | tracks/5/keys = { 181 | "times": PackedFloat32Array(0, 0.05), 182 | "transitions": PackedFloat32Array(1, 1), 183 | "update": 0, 184 | "values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)] 185 | } 186 | tracks/6/type = "method" 187 | tracks/6/imported = false 188 | tracks/6/enabled = true 189 | tracks/6/path = NodePath(".") 190 | tracks/6/interp = 1 191 | tracks/6/loop_wrap = true 192 | tracks/6/keys = { 193 | "times": PackedFloat32Array(1), 194 | "transitions": PackedFloat32Array(1), 195 | "values": [{ 196 | "args": [], 197 | "method": &"queue_free" 198 | }] 199 | } 200 | 201 | [sub_resource type="Animation" id="Animation_qhy7m"] 202 | resource_name = "idle" 203 | loop_mode = 1 204 | tracks/0/type = "value" 205 | tracks/0/imported = false 206 | tracks/0/enabled = true 207 | tracks/0/path = NodePath("Sprite2D:frame") 208 | tracks/0/interp = 1 209 | tracks/0/loop_wrap = true 210 | tracks/0/keys = { 211 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.6, 0.7, 0.8, 0.9), 212 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1), 213 | "update": 1, 214 | "values": [0, 1, 2, 1, 2, 1, 2, 1, 0] 215 | } 216 | 217 | [sub_resource type="Animation" id="Animation_nwual"] 218 | resource_name = "run_left" 219 | length = 0.6 220 | loop_mode = 1 221 | tracks/0/type = "value" 222 | tracks/0/imported = false 223 | tracks/0/enabled = true 224 | tracks/0/path = NodePath("Sprite2D:frame") 225 | tracks/0/interp = 1 226 | tracks/0/loop_wrap = true 227 | tracks/0/keys = { 228 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5), 229 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1), 230 | "update": 1, 231 | "values": [18, 19, 20, 21, 22, 23] 232 | } 233 | tracks/1/type = "value" 234 | tracks/1/imported = false 235 | tracks/1/enabled = true 236 | tracks/1/path = NodePath("Sprite2D:flip_h") 237 | tracks/1/interp = 1 238 | tracks/1/loop_wrap = true 239 | tracks/1/keys = { 240 | "times": PackedFloat32Array(0), 241 | "transitions": PackedFloat32Array(1), 242 | "update": 1, 243 | "values": [true] 244 | } 245 | 246 | [sub_resource type="Animation" id="Animation_jubin"] 247 | resource_name = "run_right" 248 | length = 0.6 249 | loop_mode = 1 250 | tracks/0/type = "value" 251 | tracks/0/imported = false 252 | tracks/0/enabled = true 253 | tracks/0/path = NodePath("Sprite2D:frame") 254 | tracks/0/interp = 1 255 | tracks/0/loop_wrap = true 256 | tracks/0/keys = { 257 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5), 258 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1), 259 | "update": 1, 260 | "values": [18, 19, 20, 21, 22, 23] 261 | } 262 | tracks/1/type = "value" 263 | tracks/1/imported = false 264 | tracks/1/enabled = true 265 | tracks/1/path = NodePath("Sprite2D:flip_h") 266 | tracks/1/interp = 1 267 | tracks/1/loop_wrap = true 268 | tracks/1/keys = { 269 | "times": PackedFloat32Array(0), 270 | "transitions": PackedFloat32Array(1), 271 | "update": 1, 272 | "values": [false] 273 | } 274 | 275 | [sub_resource type="Animation" id="Animation_whn11"] 276 | resource_name = "stunned" 277 | step = 0.05 278 | tracks/0/type = "value" 279 | tracks/0/imported = false 280 | tracks/0/enabled = true 281 | tracks/0/path = NodePath("Sprite2D:frame") 282 | tracks/0/interp = 1 283 | tracks/0/loop_wrap = true 284 | tracks/0/keys = { 285 | "times": PackedFloat32Array(0, 0.1, 0.15, 0.4, 0.8), 286 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1), 287 | "update": 1, 288 | "values": [14, 15, 16, 14, 13] 289 | } 290 | 291 | [sub_resource type="Animation" id="Animation_xm4x4"] 292 | resource_name = "walk_left" 293 | length = 0.6 294 | loop_mode = 1 295 | tracks/0/type = "value" 296 | tracks/0/imported = false 297 | tracks/0/enabled = true 298 | tracks/0/path = NodePath("Sprite2D:frame") 299 | tracks/0/interp = 1 300 | tracks/0/loop_wrap = true 301 | tracks/0/keys = { 302 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5), 303 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1), 304 | "update": 1, 305 | "values": [4, 5, 6, 7, 8, 9] 306 | } 307 | tracks/1/type = "value" 308 | tracks/1/imported = false 309 | tracks/1/enabled = true 310 | tracks/1/path = NodePath("Sprite2D:flip_h") 311 | tracks/1/interp = 1 312 | tracks/1/loop_wrap = true 313 | tracks/1/keys = { 314 | "times": PackedFloat32Array(0), 315 | "transitions": PackedFloat32Array(1), 316 | "update": 1, 317 | "values": [true] 318 | } 319 | 320 | [sub_resource type="Animation" id="Animation_sirhc"] 321 | resource_name = "walk_right" 322 | length = 0.6 323 | loop_mode = 1 324 | tracks/0/type = "value" 325 | tracks/0/imported = false 326 | tracks/0/enabled = true 327 | tracks/0/path = NodePath("Sprite2D:frame") 328 | tracks/0/interp = 1 329 | tracks/0/loop_wrap = true 330 | tracks/0/keys = { 331 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5), 332 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1), 333 | "update": 1, 334 | "values": [4, 5, 6, 7, 8, 9] 335 | } 336 | tracks/1/type = "value" 337 | tracks/1/imported = false 338 | tracks/1/enabled = true 339 | tracks/1/path = NodePath("Sprite2D:flip_h") 340 | tracks/1/interp = 1 341 | tracks/1/loop_wrap = true 342 | tracks/1/keys = { 343 | "times": PackedFloat32Array(0), 344 | "transitions": PackedFloat32Array(1), 345 | "update": 1, 346 | "values": [false] 347 | } 348 | 349 | [sub_resource type="AnimationLibrary" id="AnimationLibrary_sxd88"] 350 | _data = { 351 | "RESET": SubResource("Animation_3rrto"), 352 | "death": SubResource("Animation_o6yyx"), 353 | "idle": SubResource("Animation_qhy7m"), 354 | "run_left": SubResource("Animation_nwual"), 355 | "run_right": SubResource("Animation_jubin"), 356 | "stunned": SubResource("Animation_whn11"), 357 | "walk_left": SubResource("Animation_xm4x4"), 358 | "walk_right": SubResource("Animation_sirhc") 359 | } 360 | 361 | [sub_resource type="Curve" id="Curve_2q65h"] 362 | _data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), -3.32967, 0.0, 0, 0] 363 | point_count = 2 364 | 365 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_83vmd"] 366 | bg_color = Color(0, 0, 0, 1) 367 | 368 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bwf2k"] 369 | bg_color = Color(0.968627, 0.462745, 0.392157, 1) 370 | 371 | [node name="Enemy" type="CharacterBody2D"] 372 | collision_layer = 4 373 | collision_mask = 196 374 | motion_mode = 1 375 | platform_on_leave = 2 376 | platform_floor_layers = 4294967040 377 | script = ExtResource("1_i5ap4") 378 | stats = ExtResource("2_cu4um") 379 | 380 | [node name="Hitbox" type="Area2D" parent="."] 381 | collision_layer = 4 382 | collision_mask = 0 383 | script = ExtResource("6_4fu81") 384 | 385 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"] 386 | shape = SubResource("CircleShape2D_7ufao") 387 | 388 | [node name="Hurtbox" type="Area2D" parent="."] 389 | collision_layer = 0 390 | script = ExtResource("12_42qi7") 391 | 392 | [node name="Hurt Collision" type="CollisionShape2D" parent="Hurtbox"] 393 | position = Vector2(0, 3) 394 | shape = SubResource("CircleShape2D_n22t5") 395 | debug_color = Color(0.960784, 0.180392, 0.219608, 0.419608) 396 | 397 | [node name="FloorCollision" type="CollisionShape2D" parent="."] 398 | position = Vector2(0, 8) 399 | rotation = 1.57079 400 | shape = SubResource("CapsuleShape2D_llgnc") 401 | 402 | [node name="Sprite2D" type="Sprite2D" parent="."] 403 | texture = ExtResource("5_8jp15") 404 | hframes = 24 405 | 406 | [node name="AnimationPlayer" type="AnimationPlayer" parent="."] 407 | libraries = { 408 | "": SubResource("AnimationLibrary_sxd88") 409 | } 410 | autoplay = "idle" 411 | 412 | [node name="EnemyAnimation" type="Node" parent="." node_paths=PackedStringArray("animation_player", "sprite")] 413 | script = ExtResource("7_136f6") 414 | animation_player = NodePath("../AnimationPlayer") 415 | sprite = NodePath("../Sprite2D") 416 | 417 | [node name="Health" type="Node" parent="." node_paths=PackedStringArray("hitbox", "animation_player")] 418 | script = ExtResource("10_uthop") 419 | hitbox = NodePath("../Hitbox") 420 | animation_player = NodePath("../AnimationPlayer") 421 | 422 | [node name="EnemyChase" type="Node" parent="."] 423 | script = ExtResource("10_1a1ec") 424 | 425 | [node name="StunHandler" type="Node" parent="."] 426 | script = ExtResource("11_drljl") 427 | distance_curve = SubResource("Curve_2q65h") 428 | distance_range = 75.0 429 | 430 | [node name="HealthBar" type="ProgressBar" parent="."] 431 | offset_left = -12.0 432 | offset_top = -17.405 433 | offset_right = 12.0 434 | offset_bottom = -15.405 435 | theme_override_styles/background = SubResource("StyleBoxFlat_83vmd") 436 | theme_override_styles/fill = SubResource("StyleBoxFlat_bwf2k") 437 | max_value = 1.0 438 | value = 0.5 439 | show_percentage = false 440 | script = ExtResource("13_5fmek") 441 | 442 | [connection signal="damaged" from="Hitbox" to="." method="on_damaged"] 443 | [connection signal="health_changed" from="Health" to="HealthBar" method="on_health_changed"] 444 | [connection signal="max_health_changed" from="Health" to="HealthBar" method="on_max_health_changed"] 445 | -------------------------------------------------------------------------------- /Objects/Scenes/eneA2C1.tmp: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=25 format=3 uid="uid://ckfohqhp1io7i"] 2 | 3 | [ext_resource type="Script" path="res://Objects/Scripts/Enemy/enemy.gd" id="1_80gx6"] 4 | [ext_resource type="Texture2D" uid="uid://eb28cx5toii3" path="res://Art/Arks/DinoSprites - vita.png" id="1_k54fi"] 5 | [ext_resource type="Script" path="res://Objects/Scripts/hitbox.gd" id="2_ic17g"] 6 | [ext_resource type="Script" path="res://Util/Components/health.gd" id="3_l2pti"] 7 | [ext_resource type="Script" path="res://Objects/Scripts/Enemy/enemy_state_machine.gd" id="4_dx2tj"] 8 | [ext_resource type="Script" path="res://Objects/Scripts/Enemy/enemy_animation.gd" id="4_qlt5l"] 9 | [ext_resource type="Script" path="res://Objects/Scripts/Enemy/States/enemy_idle.gd" id="6_0u1p1"] 10 | [ext_resource type="Script" path="res://Objects/Scripts/Enemy/States/enemy_wander.gd" id="7_0o0h0"] 11 | [ext_resource type="Script" path="res://Objects/Scripts/Enemy/States/enemy_chase.gd" id="8_3f4cv"] 12 | 13 | [sub_resource type="CircleShape2D" id="CircleShape2D_7ufao"] 14 | radius = 13.0 15 | 16 | [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_llgnc"] 17 | radius = 5.0 18 | height = 16.0 19 | 20 | [sub_resource type="Animation" id="Animation_3rrto"] 21 | length = 0.001 22 | tracks/0/type = "value" 23 | tracks/0/imported = false 24 | tracks/0/enabled = true 25 | tracks/0/path = NodePath("Sprite2D:frame") 26 | tracks/0/interp = 1 27 | tracks/0/loop_wrap = true 28 | tracks/0/keys = { 29 | "times": PackedFloat32Array(0), 30 | "transitions": PackedFloat32Array(1), 31 | "update": 1, 32 | "values": [0] 33 | } 34 | tracks/1/type = "value" 35 | tracks/1/imported = false 36 | tracks/1/enabled = true 37 | tracks/1/path = NodePath("Sprite2D:flip_h") 38 | tracks/1/interp = 1 39 | tracks/1/loop_wrap = true 40 | tracks/1/keys = { 41 | "times": PackedFloat32Array(0), 42 | "transitions": PackedFloat32Array(1), 43 | "update": 1, 44 | "values": [false] 45 | } 46 | 47 | [sub_resource type="Animation" id="Animation_qhy7m"] 48 | resource_name = "idle" 49 | loop_mode = 1 50 | tracks/0/type = "value" 51 | tracks/0/imported = false 52 | tracks/0/enabled = true 53 | tracks/0/path = NodePath("Sprite2D:frame") 54 | tracks/0/interp = 1 55 | tracks/0/loop_wrap = true 56 | tracks/0/keys = { 57 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.6, 0.7, 0.8, 0.9), 58 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1), 59 | "update": 1, 60 | "values": [0, 1, 2, 1, 2, 1, 2, 1, 0] 61 | } 62 | 63 | [sub_resource type="Animation" id="Animation_nwual"] 64 | resource_name = "run_left" 65 | length = 0.6 66 | loop_mode = 1 67 | tracks/0/type = "value" 68 | tracks/0/imported = false 69 | tracks/0/enabled = true 70 | tracks/0/path = NodePath("Sprite2D:frame") 71 | tracks/0/interp = 1 72 | tracks/0/loop_wrap = true 73 | tracks/0/keys = { 74 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5), 75 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1), 76 | "update": 1, 77 | "values": [18, 19, 20, 21, 22, 23] 78 | } 79 | tracks/1/type = "value" 80 | tracks/1/imported = false 81 | tracks/1/enabled = true 82 | tracks/1/path = NodePath("Sprite2D:flip_h") 83 | tracks/1/interp = 1 84 | tracks/1/loop_wrap = true 85 | tracks/1/keys = { 86 | "times": PackedFloat32Array(0), 87 | "transitions": PackedFloat32Array(1), 88 | "update": 1, 89 | "values": [true] 90 | } 91 | 92 | [sub_resource type="Animation" id="Animation_jubin"] 93 | resource_name = "run_right" 94 | length = 0.6 95 | loop_mode = 1 96 | tracks/0/type = "value" 97 | tracks/0/imported = false 98 | tracks/0/enabled = true 99 | tracks/0/path = NodePath("Sprite2D:frame") 100 | tracks/0/interp = 1 101 | tracks/0/loop_wrap = true 102 | tracks/0/keys = { 103 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5), 104 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1), 105 | "update": 1, 106 | "values": [18, 19, 20, 21, 22, 23] 107 | } 108 | tracks/1/type = "value" 109 | tracks/1/imported = false 110 | tracks/1/enabled = true 111 | tracks/1/path = NodePath("Sprite2D:flip_h") 112 | tracks/1/interp = 1 113 | tracks/1/loop_wrap = true 114 | tracks/1/keys = { 115 | "times": PackedFloat32Array(0), 116 | "transitions": PackedFloat32Array(1), 117 | "update": 1, 118 | "values": [false] 119 | } 120 | 121 | [sub_resource type="Animation" id="Animation_xm4x4"] 122 | resource_name = "walk_left" 123 | length = 0.6 124 | loop_mode = 1 125 | tracks/0/type = "value" 126 | tracks/0/imported = false 127 | tracks/0/enabled = true 128 | tracks/0/path = NodePath("Sprite2D:frame") 129 | tracks/0/interp = 1 130 | tracks/0/loop_wrap = true 131 | tracks/0/keys = { 132 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5), 133 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1), 134 | "update": 1, 135 | "values": [4, 5, 6, 7, 8, 9] 136 | } 137 | tracks/1/type = "value" 138 | tracks/1/imported = false 139 | tracks/1/enabled = true 140 | tracks/1/path = NodePath("Sprite2D:flip_h") 141 | tracks/1/interp = 1 142 | tracks/1/loop_wrap = true 143 | tracks/1/keys = { 144 | "times": PackedFloat32Array(0), 145 | "transitions": PackedFloat32Array(1), 146 | "update": 1, 147 | "values": [true] 148 | } 149 | 150 | [sub_resource type="Animation" id="Animation_sirhc"] 151 | resource_name = "walk_right" 152 | length = 0.6 153 | loop_mode = 1 154 | tracks/0/type = "value" 155 | tracks/0/imported = false 156 | tracks/0/enabled = true 157 | tracks/0/path = NodePath("Sprite2D:frame") 158 | tracks/0/interp = 1 159 | tracks/0/loop_wrap = true 160 | tracks/0/keys = { 161 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5), 162 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1), 163 | "update": 1, 164 | "values": [4, 5, 6, 7, 8, 9] 165 | } 166 | tracks/1/type = "value" 167 | tracks/1/imported = false 168 | tracks/1/enabled = true 169 | tracks/1/path = NodePath("Sprite2D:flip_h") 170 | tracks/1/interp = 1 171 | tracks/1/loop_wrap = true 172 | tracks/1/keys = { 173 | "times": PackedFloat32Array(0), 174 | "transitions": PackedFloat32Array(1), 175 | "update": 1, 176 | "values": [false] 177 | } 178 | 179 | [sub_resource type="AnimationLibrary" id="AnimationLibrary_sxd88"] 180 | _data = { 181 | "RESET": SubResource("Animation_3rrto"), 182 | "idle": SubResource("Animation_qhy7m"), 183 | "run_left": SubResource("Animation_nwual"), 184 | "run_right": SubResource("Animation_jubin"), 185 | "walk_left": SubResource("Animation_xm4x4"), 186 | "walk_right": SubResource("Animation_sirhc") 187 | } 188 | 189 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_3q2hq"] 190 | animation = &"idle" 191 | 192 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_1imj2"] 193 | animation = &"walk_left" 194 | 195 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_cym0a"] 196 | animation = &"walk_right" 197 | 198 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_7msoj"] 199 | animation = &"run_right" 200 | 201 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_r3yan"] 202 | animation = &"run_left" 203 | 204 | [sub_resource type="AnimationNodeBlendSpace1D" id="AnimationNodeBlendSpace1D_adqrl"] 205 | blend_point_0/node = SubResource("AnimationNodeAnimation_3q2hq") 206 | blend_point_0/pos = 0.0 207 | blend_point_1/node = SubResource("AnimationNodeAnimation_1imj2") 208 | blend_point_1/pos = -25.0 209 | blend_point_2/node = SubResource("AnimationNodeAnimation_cym0a") 210 | blend_point_2/pos = 25.0 211 | blend_point_3/node = SubResource("AnimationNodeAnimation_7msoj") 212 | blend_point_3/pos = 75.0 213 | blend_point_4/node = SubResource("AnimationNodeAnimation_r3yan") 214 | blend_point_4/pos = -75.0 215 | min_space = -75.0 216 | max_space = 75.0 217 | blend_mode = 1 218 | 219 | [node name="Enemy" type="CharacterBody2D"] 220 | collision_layer = 4 221 | collision_mask = 196 222 | script = ExtResource("1_80gx6") 223 | 224 | [node name="Hitbox" type="Area2D" parent="."] 225 | collision_layer = 4 226 | collision_mask = 0 227 | script = ExtResource("2_ic17g") 228 | 229 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"] 230 | shape = SubResource("CircleShape2D_7ufao") 231 | 232 | [node name="FloorCollision" type="CollisionShape2D" parent="."] 233 | position = Vector2(0, 8) 234 | rotation = 1.57079 235 | shape = SubResource("CapsuleShape2D_llgnc") 236 | 237 | [node name="Sprite2D" type="Sprite2D" parent="."] 238 | texture = ExtResource("1_k54fi") 239 | hframes = 24 240 | 241 | [node name="AnimationPlayer" type="AnimationPlayer" parent="."] 242 | libraries = { 243 | "": SubResource("AnimationLibrary_sxd88") 244 | } 245 | autoplay = "idle" 246 | 247 | [node name="AnimationTree" type="AnimationTree" parent="."] 248 | active = false 249 | libraries = { 250 | "": SubResource("AnimationLibrary_sxd88") 251 | } 252 | tree_root = SubResource("AnimationNodeBlendSpace1D_adqrl") 253 | anim_player = NodePath("../AnimationPlayer") 254 | parameters/blend_position = -0.0589142 255 | 256 | [node name="EnemyAnimation" type="Node" parent="."] 257 | script = ExtResource("4_qlt5l") 258 | 259 | [node name="Health" type="Node" parent="." node_paths=PackedStringArray("hitbox")] 260 | script = ExtResource("3_l2pti") 261 | hitbox = NodePath("../Hitbox") 262 | 263 | [node name="EnemyStateMachine" type="Node" parent="." node_paths=PackedStringArray("initial_state")] 264 | script = ExtResource("4_dx2tj") 265 | initial_state = NodePath("Wander") 266 | 267 | [node name="Idle" type="Node" parent="EnemyStateMachine"] 268 | script = ExtResource("6_0u1p1") 269 | 270 | [node name="Wander" type="Node" parent="EnemyStateMachine"] 271 | script = ExtResource("7_0o0h0") 272 | 273 | [node name="Chase" type="Node" parent="EnemyStateMachine"] 274 | script = ExtResource("8_3f4cv") 275 | -------------------------------------------------------------------------------- /Objects/Scenes/enemy.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=26 format=3 uid="uid://ckfohqhp1io7i"] 2 | 3 | [ext_resource type="Script" path="res://Objects/Scripts/Enemy/enemy.gd" id="1_i5ap4"] 4 | [ext_resource type="Resource" uid="uid://d0vpr4kgckjx6" path="res://Resources/Enemy/yellow_dino.tres" id="2_cu4um"] 5 | [ext_resource type="Texture2D" uid="uid://eb28cx5toii3" path="res://Art/Arks/DinoSprites - vita.png" id="5_8jp15"] 6 | [ext_resource type="Script" path="res://Util/Components/hitbox.gd" id="6_4fu81"] 7 | [ext_resource type="Script" path="res://Objects/Scripts/Enemy/enemy_animation.gd" id="7_136f6"] 8 | [ext_resource type="Script" path="res://Objects/Scripts/Enemy/enemy_chase.gd" id="10_1a1ec"] 9 | [ext_resource type="Script" path="res://Objects/Scripts/Enemy/enemy_health.gd" id="10_uthop"] 10 | [ext_resource type="Script" path="res://Objects/Scripts/stun_handler.gd" id="11_drljl"] 11 | [ext_resource type="Script" path="res://Util/Components/hurtbox.gd" id="12_42qi7"] 12 | [ext_resource type="Script" path="res://Objects/Scripts/Enemy/enemy_health_bar.gd" id="13_5fmek"] 13 | 14 | [sub_resource type="CircleShape2D" id="CircleShape2D_7ufao"] 15 | radius = 13.0 16 | 17 | [sub_resource type="CircleShape2D" id="CircleShape2D_n22t5"] 18 | radius = 8.0 19 | 20 | [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_llgnc"] 21 | radius = 5.0 22 | height = 16.0 23 | 24 | [sub_resource type="Animation" id="Animation_3rrto"] 25 | length = 0.001 26 | tracks/0/type = "value" 27 | tracks/0/imported = false 28 | tracks/0/enabled = true 29 | tracks/0/path = NodePath("Sprite2D:frame") 30 | tracks/0/interp = 1 31 | tracks/0/loop_wrap = true 32 | tracks/0/keys = { 33 | "times": PackedFloat32Array(0), 34 | "transitions": PackedFloat32Array(1), 35 | "update": 1, 36 | "values": [0] 37 | } 38 | tracks/1/type = "value" 39 | tracks/1/imported = false 40 | tracks/1/enabled = true 41 | tracks/1/path = NodePath("Sprite2D:flip_h") 42 | tracks/1/interp = 1 43 | tracks/1/loop_wrap = true 44 | tracks/1/keys = { 45 | "times": PackedFloat32Array(0), 46 | "transitions": PackedFloat32Array(1), 47 | "update": 1, 48 | "values": [false] 49 | } 50 | tracks/2/type = "value" 51 | tracks/2/imported = false 52 | tracks/2/enabled = true 53 | tracks/2/path = NodePath("Sprite2D:modulate") 54 | tracks/2/interp = 1 55 | tracks/2/loop_wrap = true 56 | tracks/2/keys = { 57 | "times": PackedFloat32Array(0), 58 | "transitions": PackedFloat32Array(1), 59 | "update": 0, 60 | "values": [Color(1, 1, 1, 1)] 61 | } 62 | tracks/3/type = "value" 63 | tracks/3/imported = false 64 | tracks/3/enabled = true 65 | tracks/3/path = NodePath("Sprite2D:rotation") 66 | tracks/3/interp = 1 67 | tracks/3/loop_wrap = true 68 | tracks/3/keys = { 69 | "times": PackedFloat32Array(0), 70 | "transitions": PackedFloat32Array(1), 71 | "update": 0, 72 | "values": [0.0] 73 | } 74 | tracks/4/type = "value" 75 | tracks/4/imported = false 76 | tracks/4/enabled = true 77 | tracks/4/path = NodePath("Sprite2D:position") 78 | tracks/4/interp = 1 79 | tracks/4/loop_wrap = true 80 | tracks/4/keys = { 81 | "times": PackedFloat32Array(0), 82 | "transitions": PackedFloat32Array(1), 83 | "update": 0, 84 | "values": [Vector2(0, 0)] 85 | } 86 | tracks/5/type = "value" 87 | tracks/5/imported = false 88 | tracks/5/enabled = true 89 | tracks/5/path = NodePath("Hitbox/CollisionShape2D:disabled") 90 | tracks/5/interp = 1 91 | tracks/5/loop_wrap = true 92 | tracks/5/keys = { 93 | "times": PackedFloat32Array(0), 94 | "transitions": PackedFloat32Array(1), 95 | "update": 1, 96 | "values": [false] 97 | } 98 | tracks/6/type = "value" 99 | tracks/6/imported = false 100 | tracks/6/enabled = true 101 | tracks/6/path = NodePath("HealthBar:modulate") 102 | tracks/6/interp = 1 103 | tracks/6/loop_wrap = true 104 | tracks/6/keys = { 105 | "times": PackedFloat32Array(0), 106 | "transitions": PackedFloat32Array(1), 107 | "update": 0, 108 | "values": [Color(1, 1, 1, 1)] 109 | } 110 | 111 | [sub_resource type="Animation" id="Animation_o6yyx"] 112 | resource_name = "death" 113 | step = 0.05 114 | tracks/0/type = "value" 115 | tracks/0/imported = false 116 | tracks/0/enabled = true 117 | tracks/0/path = NodePath("Sprite2D:frame") 118 | tracks/0/interp = 1 119 | tracks/0/loop_wrap = true 120 | tracks/0/keys = { 121 | "times": PackedFloat32Array(0, 0.05, 0.15), 122 | "transitions": PackedFloat32Array(1, 1, 1), 123 | "update": 1, 124 | "values": [14, 15, 16] 125 | } 126 | tracks/1/type = "value" 127 | tracks/1/imported = false 128 | tracks/1/enabled = true 129 | tracks/1/path = NodePath("Sprite2D:modulate") 130 | tracks/1/interp = 1 131 | tracks/1/loop_wrap = true 132 | tracks/1/keys = { 133 | "times": PackedFloat32Array(0.7, 1), 134 | "transitions": PackedFloat32Array(0.5, 1), 135 | "update": 0, 136 | "values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)] 137 | } 138 | tracks/2/type = "value" 139 | tracks/2/imported = false 140 | tracks/2/enabled = true 141 | tracks/2/path = NodePath("Sprite2D:rotation") 142 | tracks/2/interp = 1 143 | tracks/2/loop_wrap = true 144 | tracks/2/keys = { 145 | "times": PackedFloat32Array(0.7, 1), 146 | "transitions": PackedFloat32Array(0.5, 1), 147 | "update": 0, 148 | "values": [0.0, 6.28319] 149 | } 150 | tracks/3/type = "value" 151 | tracks/3/imported = false 152 | tracks/3/enabled = true 153 | tracks/3/path = NodePath("Sprite2D:position") 154 | tracks/3/interp = 1 155 | tracks/3/loop_wrap = true 156 | tracks/3/keys = { 157 | "times": PackedFloat32Array(0.7, 1), 158 | "transitions": PackedFloat32Array(0.5, 1), 159 | "update": 0, 160 | "values": [Vector2(0, 0), Vector2(0, -14)] 161 | } 162 | tracks/4/type = "value" 163 | tracks/4/imported = false 164 | tracks/4/enabled = true 165 | tracks/4/path = NodePath("Hitbox/CollisionShape2D:disabled") 166 | tracks/4/interp = 1 167 | tracks/4/loop_wrap = true 168 | tracks/4/keys = { 169 | "times": PackedFloat32Array(0), 170 | "transitions": PackedFloat32Array(1), 171 | "update": 1, 172 | "values": [true] 173 | } 174 | tracks/5/type = "value" 175 | tracks/5/imported = false 176 | tracks/5/enabled = true 177 | tracks/5/path = NodePath("HealthBar:modulate") 178 | tracks/5/interp = 1 179 | tracks/5/loop_wrap = true 180 | tracks/5/keys = { 181 | "times": PackedFloat32Array(0, 0.05), 182 | "transitions": PackedFloat32Array(1, 1), 183 | "update": 0, 184 | "values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)] 185 | } 186 | tracks/6/type = "method" 187 | tracks/6/imported = false 188 | tracks/6/enabled = true 189 | tracks/6/path = NodePath(".") 190 | tracks/6/interp = 1 191 | tracks/6/loop_wrap = true 192 | tracks/6/keys = { 193 | "times": PackedFloat32Array(1), 194 | "transitions": PackedFloat32Array(1), 195 | "values": [{ 196 | "args": [], 197 | "method": &"queue_free" 198 | }] 199 | } 200 | 201 | [sub_resource type="Animation" id="Animation_qhy7m"] 202 | resource_name = "idle" 203 | loop_mode = 1 204 | tracks/0/type = "value" 205 | tracks/0/imported = false 206 | tracks/0/enabled = true 207 | tracks/0/path = NodePath("Sprite2D:frame") 208 | tracks/0/interp = 1 209 | tracks/0/loop_wrap = true 210 | tracks/0/keys = { 211 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.6, 0.7, 0.8, 0.9), 212 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1), 213 | "update": 1, 214 | "values": [0, 1, 2, 1, 2, 1, 2, 1, 0] 215 | } 216 | 217 | [sub_resource type="Animation" id="Animation_nwual"] 218 | resource_name = "run_left" 219 | length = 0.6 220 | loop_mode = 1 221 | tracks/0/type = "value" 222 | tracks/0/imported = false 223 | tracks/0/enabled = true 224 | tracks/0/path = NodePath("Sprite2D:frame") 225 | tracks/0/interp = 1 226 | tracks/0/loop_wrap = true 227 | tracks/0/keys = { 228 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5), 229 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1), 230 | "update": 1, 231 | "values": [18, 19, 20, 21, 22, 23] 232 | } 233 | tracks/1/type = "value" 234 | tracks/1/imported = false 235 | tracks/1/enabled = true 236 | tracks/1/path = NodePath("Sprite2D:flip_h") 237 | tracks/1/interp = 1 238 | tracks/1/loop_wrap = true 239 | tracks/1/keys = { 240 | "times": PackedFloat32Array(0), 241 | "transitions": PackedFloat32Array(1), 242 | "update": 1, 243 | "values": [true] 244 | } 245 | 246 | [sub_resource type="Animation" id="Animation_jubin"] 247 | resource_name = "run_right" 248 | length = 0.6 249 | loop_mode = 1 250 | tracks/0/type = "value" 251 | tracks/0/imported = false 252 | tracks/0/enabled = true 253 | tracks/0/path = NodePath("Sprite2D:frame") 254 | tracks/0/interp = 1 255 | tracks/0/loop_wrap = true 256 | tracks/0/keys = { 257 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5), 258 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1), 259 | "update": 1, 260 | "values": [18, 19, 20, 21, 22, 23] 261 | } 262 | tracks/1/type = "value" 263 | tracks/1/imported = false 264 | tracks/1/enabled = true 265 | tracks/1/path = NodePath("Sprite2D:flip_h") 266 | tracks/1/interp = 1 267 | tracks/1/loop_wrap = true 268 | tracks/1/keys = { 269 | "times": PackedFloat32Array(0), 270 | "transitions": PackedFloat32Array(1), 271 | "update": 1, 272 | "values": [false] 273 | } 274 | 275 | [sub_resource type="Animation" id="Animation_whn11"] 276 | resource_name = "stunned" 277 | step = 0.05 278 | tracks/0/type = "value" 279 | tracks/0/imported = false 280 | tracks/0/enabled = true 281 | tracks/0/path = NodePath("Sprite2D:frame") 282 | tracks/0/interp = 1 283 | tracks/0/loop_wrap = true 284 | tracks/0/keys = { 285 | "times": PackedFloat32Array(0, 0.1, 0.15, 0.4, 0.8), 286 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1), 287 | "update": 1, 288 | "values": [14, 15, 16, 14, 13] 289 | } 290 | 291 | [sub_resource type="Animation" id="Animation_xm4x4"] 292 | resource_name = "walk_left" 293 | length = 0.6 294 | loop_mode = 1 295 | tracks/0/type = "value" 296 | tracks/0/imported = false 297 | tracks/0/enabled = true 298 | tracks/0/path = NodePath("Sprite2D:frame") 299 | tracks/0/interp = 1 300 | tracks/0/loop_wrap = true 301 | tracks/0/keys = { 302 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5), 303 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1), 304 | "update": 1, 305 | "values": [4, 5, 6, 7, 8, 9] 306 | } 307 | tracks/1/type = "value" 308 | tracks/1/imported = false 309 | tracks/1/enabled = true 310 | tracks/1/path = NodePath("Sprite2D:flip_h") 311 | tracks/1/interp = 1 312 | tracks/1/loop_wrap = true 313 | tracks/1/keys = { 314 | "times": PackedFloat32Array(0), 315 | "transitions": PackedFloat32Array(1), 316 | "update": 1, 317 | "values": [true] 318 | } 319 | 320 | [sub_resource type="Animation" id="Animation_sirhc"] 321 | resource_name = "walk_right" 322 | length = 0.6 323 | loop_mode = 1 324 | tracks/0/type = "value" 325 | tracks/0/imported = false 326 | tracks/0/enabled = true 327 | tracks/0/path = NodePath("Sprite2D:frame") 328 | tracks/0/interp = 1 329 | tracks/0/loop_wrap = true 330 | tracks/0/keys = { 331 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5), 332 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1), 333 | "update": 1, 334 | "values": [4, 5, 6, 7, 8, 9] 335 | } 336 | tracks/1/type = "value" 337 | tracks/1/imported = false 338 | tracks/1/enabled = true 339 | tracks/1/path = NodePath("Sprite2D:flip_h") 340 | tracks/1/interp = 1 341 | tracks/1/loop_wrap = true 342 | tracks/1/keys = { 343 | "times": PackedFloat32Array(0), 344 | "transitions": PackedFloat32Array(1), 345 | "update": 1, 346 | "values": [false] 347 | } 348 | 349 | [sub_resource type="AnimationLibrary" id="AnimationLibrary_sxd88"] 350 | _data = { 351 | "RESET": SubResource("Animation_3rrto"), 352 | "death": SubResource("Animation_o6yyx"), 353 | "idle": SubResource("Animation_qhy7m"), 354 | "run_left": SubResource("Animation_nwual"), 355 | "run_right": SubResource("Animation_jubin"), 356 | "stunned": SubResource("Animation_whn11"), 357 | "walk_left": SubResource("Animation_xm4x4"), 358 | "walk_right": SubResource("Animation_sirhc") 359 | } 360 | 361 | [sub_resource type="Curve" id="Curve_2q65h"] 362 | _data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), -3.32967, 0.0, 0, 0] 363 | point_count = 2 364 | 365 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_83vmd"] 366 | bg_color = Color(0, 0, 0, 1) 367 | 368 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bwf2k"] 369 | bg_color = Color(0.968627, 0.462745, 0.392157, 1) 370 | 371 | [node name="Enemy" type="CharacterBody2D"] 372 | collision_layer = 4 373 | collision_mask = 196 374 | motion_mode = 1 375 | platform_on_leave = 2 376 | platform_floor_layers = 4294967040 377 | script = ExtResource("1_i5ap4") 378 | stats = ExtResource("2_cu4um") 379 | 380 | [node name="Hitbox" type="Area2D" parent="."] 381 | collision_layer = 4 382 | collision_mask = 0 383 | script = ExtResource("6_4fu81") 384 | 385 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"] 386 | shape = SubResource("CircleShape2D_7ufao") 387 | 388 | [node name="Hurtbox" type="Area2D" parent="."] 389 | collision_layer = 0 390 | script = ExtResource("12_42qi7") 391 | 392 | [node name="Hurt Collision" type="CollisionShape2D" parent="Hurtbox"] 393 | position = Vector2(0, 3) 394 | shape = SubResource("CircleShape2D_n22t5") 395 | debug_color = Color(0.960784, 0.180392, 0.219608, 0.419608) 396 | 397 | [node name="FloorCollision" type="CollisionShape2D" parent="."] 398 | position = Vector2(0, 8) 399 | rotation = 1.57079 400 | shape = SubResource("CapsuleShape2D_llgnc") 401 | 402 | [node name="Sprite2D" type="Sprite2D" parent="."] 403 | texture = ExtResource("5_8jp15") 404 | hframes = 24 405 | 406 | [node name="AnimationPlayer" type="AnimationPlayer" parent="."] 407 | libraries = { 408 | "": SubResource("AnimationLibrary_sxd88") 409 | } 410 | autoplay = "idle" 411 | 412 | [node name="EnemyAnimation" type="Node" parent="." node_paths=PackedStringArray("animation_player", "sprite")] 413 | script = ExtResource("7_136f6") 414 | animation_player = NodePath("../AnimationPlayer") 415 | sprite = NodePath("../Sprite2D") 416 | 417 | [node name="Health" type="Node" parent="." node_paths=PackedStringArray("hitbox", "animation_player")] 418 | script = ExtResource("10_uthop") 419 | hitbox = NodePath("../Hitbox") 420 | animation_player = NodePath("../AnimationPlayer") 421 | 422 | [node name="EnemyChase" type="Node" parent="."] 423 | script = ExtResource("10_1a1ec") 424 | 425 | [node name="StunHandler" type="Node" parent="."] 426 | script = ExtResource("11_drljl") 427 | distance_curve = SubResource("Curve_2q65h") 428 | distance_range = 75.0 429 | 430 | [node name="HealthBar" type="ProgressBar" parent="."] 431 | offset_left = -12.0 432 | offset_top = -17.405 433 | offset_right = 12.0 434 | offset_bottom = -15.405 435 | theme_override_styles/background = SubResource("StyleBoxFlat_83vmd") 436 | theme_override_styles/fill = SubResource("StyleBoxFlat_bwf2k") 437 | max_value = 1.0 438 | value = 0.5 439 | show_percentage = false 440 | script = ExtResource("13_5fmek") 441 | 442 | [connection signal="damaged" from="Hitbox" to="." method="on_damaged"] 443 | [connection signal="died" from="Health" to="." method="on_death"] 444 | [connection signal="health_changed" from="Health" to="HealthBar" method="on_health_changed"] 445 | [connection signal="max_health_changed" from="Health" to="HealthBar" method="on_max_health_changed"] 446 | -------------------------------------------------------------------------------- /Objects/Scenes/item_drop.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=3 uid="uid://gxenn5due63o"] 2 | 3 | [ext_resource type="Script" path="res://Objects/Scripts/item_drop.gd" id="1_o1eft"] 4 | [ext_resource type="Texture2D" uid="uid://dnfmimtdyt0r0" path="res://Art/Kenney/1_bit_pack.png" id="2_s8vul"] 5 | [ext_resource type="Theme" uid="uid://d1eibj6u66lma" path="res://UI/Theme/main_theme.tres" id="3_n20rt"] 6 | 7 | [sub_resource type="AtlasTexture" id="AtlasTexture_jdmqt"] 8 | atlas = ExtResource("2_s8vul") 9 | region = Rect2(528, 320, 16, 16) 10 | 11 | [sub_resource type="CircleShape2D" id="CircleShape2D_f3es1"] 12 | radius = 25.0799 13 | 14 | [node name="ItemDrop" type="Node2D"] 15 | script = ExtResource("1_o1eft") 16 | 17 | [node name="ItemSprite" type="Sprite2D" parent="."] 18 | texture = SubResource("AtlasTexture_jdmqt") 19 | 20 | [node name="Hitbox" type="Area2D" parent="."] 21 | 22 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"] 23 | shape = SubResource("CircleShape2D_f3es1") 24 | 25 | [node name="CountLabel" type="Label" parent="."] 26 | offset_top = -1.0 27 | offset_right = 40.0 28 | offset_bottom = 22.0 29 | scale = Vector2(0.5, 0.5) 30 | theme = ExtResource("3_n20rt") 31 | theme_override_constants/shadow_offset_x = 1 32 | theme_override_constants/shadow_offset_y = 1 33 | theme_override_constants/shadow_outline_size = 0 34 | theme_override_font_sizes/font_size = 16 35 | text = "64" 36 | -------------------------------------------------------------------------------- /Objects/Scenes/lev8705.tmp: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=7 format=3 uid="uid://bol6m2x0tdflu"] 2 | 3 | [ext_resource type="Script" path="res://Objects/Scripts/level_transition.gd" id="1_lo77e"] 4 | [ext_resource type="Texture2D" uid="uid://53h01ho1lvwp" path="res://Art/Kenney/fish.png" id="2_60wfm"] 5 | 6 | [sub_resource type="Animation" id="Animation_oynsq"] 7 | length = 0.001 8 | tracks/0/type = "value" 9 | tracks/0/imported = false 10 | tracks/0/enabled = true 11 | tracks/0/path = NodePath("CanvasLayer/ColorRect:color") 12 | tracks/0/interp = 1 13 | tracks/0/loop_wrap = true 14 | tracks/0/keys = { 15 | "times": PackedFloat32Array(0), 16 | "transitions": PackedFloat32Array(1), 17 | "update": 0, 18 | "values": [Color(0, 0, 0, 0)] 19 | } 20 | 21 | [sub_resource type="Animation" id="Animation_ax8oh"] 22 | resource_name = "fade_out" 23 | tracks/0/type = "value" 24 | tracks/0/imported = false 25 | tracks/0/enabled = true 26 | tracks/0/path = NodePath("CanvasLayer/ColorRect:color") 27 | tracks/0/interp = 1 28 | tracks/0/loop_wrap = true 29 | tracks/0/keys = { 30 | "times": PackedFloat32Array(0, 1), 31 | "transitions": PackedFloat32Array(1, 1), 32 | "update": 0, 33 | "values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1)] 34 | } 35 | tracks/1/type = "method" 36 | tracks/1/imported = false 37 | tracks/1/enabled = true 38 | tracks/1/path = NodePath(".") 39 | tracks/1/interp = 1 40 | tracks/1/loop_wrap = true 41 | tracks/1/keys = { 42 | "times": PackedFloat32Array(1), 43 | "transitions": PackedFloat32Array(1), 44 | "values": [{ 45 | "args": [], 46 | "method": &"switch_to_level" 47 | }] 48 | } 49 | 50 | [sub_resource type="AnimationLibrary" id="AnimationLibrary_rl3xk"] 51 | _data = { 52 | "RESET": SubResource("Animation_oynsq"), 53 | "fade_out": SubResource("Animation_ax8oh") 54 | } 55 | 56 | [sub_resource type="CircleShape2D" id="CircleShape2D_2ukk2"] 57 | 58 | [node name="LevelTransition" type="Area2D"] 59 | script = ExtResource("1_lo77e") 60 | 61 | [node name="CanvasLayer" type="CanvasLayer" parent="."] 62 | 63 | [node name="ColorRect" type="ColorRect" parent="CanvasLayer"] 64 | anchors_preset = 15 65 | anchor_right = 1.0 66 | anchor_bottom = 1.0 67 | grow_horizontal = 2 68 | grow_vertical = 2 69 | color = Color(0, 0, 0, 0) 70 | 71 | [node name="AnimationPlayer" type="AnimationPlayer" parent="."] 72 | libraries = { 73 | "": SubResource("AnimationLibrary_rl3xk") 74 | } 75 | 76 | [node name="CollisionShape2D" type="CollisionShape2D" parent="."] 77 | shape = SubResource("CircleShape2D_2ukk2") 78 | 79 | [node name="Sprite2D" type="Sprite2D" parent="."] 80 | texture = ExtResource("2_60wfm") 81 | -------------------------------------------------------------------------------- /Objects/Scenes/level_transition.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=7 format=3 uid="uid://bol6m2x0tdflu"] 2 | 3 | [ext_resource type="Script" path="res://Objects/Scripts/level_transition.gd" id="1_lo77e"] 4 | [ext_resource type="Texture2D" uid="uid://53h01ho1lvwp" path="res://Art/Kenney/fish.png" id="2_60wfm"] 5 | 6 | [sub_resource type="Animation" id="Animation_oynsq"] 7 | length = 0.001 8 | tracks/0/type = "value" 9 | tracks/0/imported = false 10 | tracks/0/enabled = true 11 | tracks/0/path = NodePath("CanvasLayer/ColorRect:color") 12 | tracks/0/interp = 1 13 | tracks/0/loop_wrap = true 14 | tracks/0/keys = { 15 | "times": PackedFloat32Array(0), 16 | "transitions": PackedFloat32Array(1), 17 | "update": 0, 18 | "values": [Color(0, 0, 0, 0)] 19 | } 20 | 21 | [sub_resource type="Animation" id="Animation_ax8oh"] 22 | resource_name = "fade_out" 23 | tracks/0/type = "value" 24 | tracks/0/imported = false 25 | tracks/0/enabled = true 26 | tracks/0/path = NodePath("CanvasLayer/ColorRect:color") 27 | tracks/0/interp = 1 28 | tracks/0/loop_wrap = true 29 | tracks/0/keys = { 30 | "times": PackedFloat32Array(0, 1), 31 | "transitions": PackedFloat32Array(1, 1), 32 | "update": 0, 33 | "values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1)] 34 | } 35 | tracks/1/type = "method" 36 | tracks/1/imported = false 37 | tracks/1/enabled = true 38 | tracks/1/path = NodePath(".") 39 | tracks/1/interp = 1 40 | tracks/1/loop_wrap = true 41 | tracks/1/keys = { 42 | "times": PackedFloat32Array(1), 43 | "transitions": PackedFloat32Array(1), 44 | "values": [{ 45 | "args": [], 46 | "method": &"switch_to_level" 47 | }] 48 | } 49 | 50 | [sub_resource type="AnimationLibrary" id="AnimationLibrary_rl3xk"] 51 | _data = { 52 | "RESET": SubResource("Animation_oynsq"), 53 | "fade_out": SubResource("Animation_ax8oh") 54 | } 55 | 56 | [sub_resource type="CircleShape2D" id="CircleShape2D_2ukk2"] 57 | 58 | [node name="LevelTransition" type="Area2D"] 59 | script = ExtResource("1_lo77e") 60 | 61 | [node name="CanvasLayer" type="CanvasLayer" parent="."] 62 | 63 | [node name="ColorRect" type="ColorRect" parent="CanvasLayer"] 64 | anchors_preset = 15 65 | anchor_right = 1.0 66 | anchor_bottom = 1.0 67 | grow_horizontal = 2 68 | grow_vertical = 2 69 | mouse_filter = 2 70 | color = Color(0, 0, 0, 0) 71 | 72 | [node name="AnimationPlayer" type="AnimationPlayer" parent="."] 73 | libraries = { 74 | "": SubResource("AnimationLibrary_rl3xk") 75 | } 76 | 77 | [node name="CollisionShape2D" type="CollisionShape2D" parent="."] 78 | shape = SubResource("CircleShape2D_2ukk2") 79 | 80 | [node name="Sprite2D" type="Sprite2D" parent="."] 81 | texture = ExtResource("2_60wfm") 82 | -------------------------------------------------------------------------------- /Objects/Scripts/Enemy/enemy.gd: -------------------------------------------------------------------------------- 1 | class_name Enemy 2 | extends CharacterBody2D 3 | 4 | ######################################################### 5 | # I tend to keep the top level node's functionality 6 | # small. Here, this node is responsible for common state 7 | # variables, passing the damaged signal around, and 8 | # picking a random texture on spawn. 9 | # 10 | # For the most part, other functionality that controls 11 | # the enemy is handled by specific states. 12 | # 13 | # ex. Movement is handled by states setting velocity 14 | # and calling move_and_slide() 15 | ######################################################## 16 | 17 | 18 | signal damaged(attack: Attack) 19 | 20 | 21 | 22 | @export var stats: EnemyStats 23 | 24 | var max_speed : float 25 | var variation_range : float 26 | var acceleration_time : float 27 | var friction : float 28 | 29 | @onready var sprite : Sprite2D = $Sprite2D 30 | @onready var health: EnemyHealth = $Health 31 | 32 | var alive := true 33 | var stunned := false 34 | 35 | var current_speed := 0.0 36 | 37 | var item_drop : PackedScene = preload("res://Objects/Scenes/item_drop.tscn") 38 | 39 | 40 | func _ready(): 41 | randomize() 42 | 43 | # Distribute stats where they need to be 44 | health.max_health = stats.max_health 45 | 46 | max_speed = stats.max_speed 47 | variation_range = stats.variation_range 48 | acceleration_time = stats.acceleration_time 49 | friction = stats.friction 50 | 51 | sprite.texture = stats.texture 52 | 53 | max_speed += randf_range(-variation_range, variation_range) 54 | 55 | 56 | func on_damaged(attack: Attack) -> void: 57 | damaged.emit(attack) 58 | 59 | 60 | func on_death() -> void: 61 | if stats.loot_table: 62 | for stack: ItemStack in stats.loot_table.roll_loot(): 63 | var spawned_item : ItemDrop = item_drop.instantiate() 64 | spawned_item.stack = stack 65 | spawned_item.global_position = global_position 66 | get_tree().current_scene.add_child.call_deferred(spawned_item) 67 | -------------------------------------------------------------------------------- /Objects/Scripts/Enemy/enemy_animation.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | 4 | ################################################### 5 | # This controls all animations for the enemy. 6 | # You totally could use an AnimationTree for this, 7 | # but this is an example of how you could control 8 | # it through code. 9 | ################################################### 10 | 11 | 12 | @export var animation_player : AnimationPlayer 13 | @export var sprite : Sprite2D 14 | @onready var enemy : Enemy = get_owner() 15 | 16 | var player : Player 17 | 18 | 19 | func _ready(): 20 | player = get_tree().get_first_node_in_group("player") 21 | 22 | 23 | func _physics_process(delta: float) -> void: 24 | if !enemy.alive: 25 | return 26 | 27 | if enemy.stunned: 28 | animation_player.play("stunned") 29 | return 30 | 31 | if !enemy.velocity: 32 | animation_player.play("idle") 33 | return 34 | 35 | var direction = player.global_position - enemy.global_position 36 | sprite.flip_h = direction.x < 0 37 | 38 | var animation_name = "walk" 39 | 40 | if enemy.velocity.length() > 50: 41 | animation_name = "run" 42 | 43 | 44 | if sprite.flip_h: 45 | animation_name += "_left" 46 | else: 47 | animation_name += "_right" 48 | 49 | animation_player.play(animation_name) 50 | -------------------------------------------------------------------------------- /Objects/Scripts/Enemy/enemy_chase.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | @onready var enemy : Enemy = get_owner() 4 | 5 | var player : Player 6 | var direction : Vector2 7 | 8 | func _ready(): 9 | player = get_tree().get_first_node_in_group("player") 10 | 11 | 12 | func _physics_process(delta: float) -> void: 13 | if !enemy.alive: 14 | return 15 | 16 | if !direction || enemy.current_speed >= 0: 17 | direction = player.global_position - enemy.global_position 18 | 19 | var acceleration_step := enemy.stats.max_speed * (1.0 / enemy.acceleration_time) * delta 20 | 21 | if enemy.current_speed < 0: 22 | acceleration_step *= enemy.friction 23 | 24 | var target_speed := enemy.stats.max_speed 25 | 26 | if !player.alive: 27 | target_speed = 0 28 | 29 | enemy.current_speed = move_toward(enemy.current_speed, target_speed, acceleration_step) 30 | 31 | enemy.velocity = direction.normalized()*enemy.current_speed 32 | enemy.move_and_slide() 33 | -------------------------------------------------------------------------------- /Objects/Scripts/Enemy/enemy_health.gd: -------------------------------------------------------------------------------- 1 | class_name EnemyHealth 2 | extends Health 3 | 4 | @onready var enemy : Enemy = get_owner() 5 | 6 | func _ready(): 7 | health = max_health 8 | super() 9 | 10 | 11 | func on_damaged(attack: Attack) -> void: 12 | if !enemy.alive: 13 | return 14 | 15 | super(attack) 16 | 17 | if health <= 0: 18 | died.emit() 19 | enemy.alive = false 20 | -------------------------------------------------------------------------------- /Objects/Scripts/Enemy/enemy_health_bar.gd: -------------------------------------------------------------------------------- 1 | extends ProgressBar 2 | 3 | var max_health := 0.0 4 | 5 | 6 | func on_health_changed(new_health): 7 | value = new_health / max_health 8 | 9 | 10 | func on_max_health_changed(new_max_health: float): 11 | self.max_health = new_max_health 12 | -------------------------------------------------------------------------------- /Objects/Scripts/Enemy/health_label.gd: -------------------------------------------------------------------------------- 1 | extends Label 2 | 3 | 4 | func on_health_changed(new_health: float): 5 | var health_str = "%.2f" % new_health 6 | 7 | text = "Health: " + health_str 8 | -------------------------------------------------------------------------------- /Objects/Scripts/bullet.gd: -------------------------------------------------------------------------------- 1 | class_name Bullet 2 | extends CharacterBody2D 3 | 4 | @export var hurtbox : Hurtbox 5 | 6 | var speed := 200.0 7 | var damage := 5.0 8 | var max_pierce := 1 9 | var knockback_force := 1.0 10 | 11 | @export var dampening : float = 50.0 12 | @export var dampening_ratio : float = 0.05 13 | 14 | @export var lifetime : float = 1.0 15 | var current_lifetime := 0.0 16 | 17 | var current_pierce_count := 0 18 | 19 | @onready var sprite: Sprite2D = $Sprite2D 20 | 21 | 22 | func _ready(): 23 | if hurtbox: 24 | hurtbox.hit_enemy.connect(on_enemy_hit) 25 | 26 | 27 | func _process(delta: float) -> void: 28 | current_lifetime += delta 29 | 30 | if current_lifetime >= lifetime: 31 | queue_free() 32 | 33 | var lifetime_ratio = (current_lifetime / lifetime) 34 | 35 | sprite.modulate.a = 1 - lifetime_ratio**3 36 | 37 | 38 | 39 | func _physics_process(delta: float) -> void: 40 | var direction = Vector2.RIGHT.rotated(rotation) 41 | 42 | var flat_dampen = dampening*delta 43 | var scaled_dampen = dampening_ratio * speed 44 | 45 | if flat_dampen > scaled_dampen: 46 | scaled_dampen = flat_dampen 47 | 48 | speed = move_toward(speed, 0, scaled_dampen) 49 | velocity = direction*speed 50 | 51 | var collision := move_and_collide(velocity*delta) 52 | 53 | if collision: 54 | queue_free() 55 | 56 | if speed <= 0: 57 | queue_free() 58 | 59 | 60 | func on_enemy_hit(): 61 | current_pierce_count += 1 62 | HitPause.slow_down_timer(0.75, 0.05) 63 | 64 | if current_pierce_count >= max_pierce: 65 | queue_free() 66 | -------------------------------------------------------------------------------- /Objects/Scripts/bullet_particles.gd: -------------------------------------------------------------------------------- 1 | extends GPUParticles2D 2 | 3 | 4 | var target : Node2D 5 | 6 | 7 | func _ready(): 8 | # Here, we reparent the node to the root but store the parent as our follow target 9 | # We do this because if the parent gets freed, all of the particles disappear immediately. 10 | target = get_parent() 11 | finished.connect(on_finished) 12 | reparent(get_tree().root) 13 | 14 | 15 | func _physics_process(delta: float) -> void: 16 | if target && is_instance_valid(target): 17 | global_position = target.global_position 18 | else: 19 | emitting = false 20 | 21 | 22 | # Finished is called when all particles have disappeared 23 | func on_finished(): 24 | queue_free() 25 | -------------------------------------------------------------------------------- /Objects/Scripts/item_drop.gd: -------------------------------------------------------------------------------- 1 | class_name ItemDrop 2 | extends Node2D 3 | 4 | 5 | @onready var item_sprite: Sprite2D = $ItemSprite 6 | @onready var hitbox: Area2D = $Hitbox 7 | @onready var count_label: Label = $CountLabel 8 | 9 | var stack : ItemStack 10 | var velocity : Vector2 11 | 12 | var velocity_tween : Tween 13 | 14 | 15 | func _ready(): 16 | hitbox.body_entered.connect(on_body_entered) 17 | item_sprite.texture = stack.item.sprite 18 | count_label.text = str(stack.count) 19 | 20 | var speed = randf_range(75, 100) 21 | velocity = Vector2.RIGHT.rotated(deg_to_rad(randf_range(0.0, 360.0))) * speed 22 | 23 | velocity_tween = create_tween() 24 | 25 | velocity_tween.tween_property(self, "velocity", Vector2.ZERO, 0.75) 26 | velocity_tween.set_trans(Tween.TRANS_BOUNCE) 27 | velocity_tween.set_ease(Tween.EASE_OUT) 28 | 29 | 30 | func update_display(): 31 | item_sprite.texture = stack.item.sprite 32 | count_label.text = str(stack.count) 33 | 34 | 35 | func on_body_entered(body: Node2D) -> void: 36 | if body is Player: 37 | stack = body.inventory.add_item(stack) 38 | 39 | if stack.is_empty(): 40 | queue_free() 41 | else: 42 | update_display() 43 | 44 | 45 | func _physics_process(delta: float) -> void: 46 | global_position += velocity * delta 47 | -------------------------------------------------------------------------------- /Objects/Scripts/level_transition.gd: -------------------------------------------------------------------------------- 1 | extends Area2D 2 | 3 | @export var next_level : PackedScene 4 | 5 | @onready var animation_player: AnimationPlayer = $AnimationPlayer 6 | 7 | 8 | func _ready(): 9 | body_entered.connect(on_player_entered) 10 | 11 | 12 | func on_player_entered(body: CharacterBody2D): 13 | if body is Player: 14 | animation_player.play("fade_out") 15 | 16 | 17 | func switch_to_level(): 18 | get_tree().change_scene_to_packed(next_level) 19 | -------------------------------------------------------------------------------- /Objects/Scripts/stun_handler.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | 4 | ## Curve that represents how much the unit should be affected by knockback when 5 | ## the player gets hit 6 | @export var distance_curve : Curve 7 | ## Scale of distance curve, 1 in distance curve is equal to this many units 8 | @export var distance_range := 50.0 9 | @export var player_knockback_power := 50.0 10 | 11 | @onready var enemy : Enemy = get_owner() 12 | 13 | var player : Player 14 | 15 | func _ready(): 16 | player = get_tree().get_first_node_in_group("player") 17 | 18 | enemy.damaged.connect(on_damaged) 19 | player.damaged.connect(on_player_damaged) 20 | 21 | 22 | func on_damaged(attack: Attack): 23 | enemy.current_speed -= attack.knockback 24 | 25 | 26 | func on_player_damaged(_attack: Attack): 27 | var distance = enemy.global_position.distance_to(player.global_position) 28 | 29 | var impact_scale = distance_curve.sample(distance / distance_range) 30 | var scaled_knockback = -player_knockback_power*impact_scale 31 | 32 | if abs(scaled_knockback) > 0: 33 | enemy.current_speed = scaled_knockback 34 | -------------------------------------------------------------------------------- /Player/Animations/player.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Player/Animations/player.res -------------------------------------------------------------------------------- /Player/Scripts/aoe_damage.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | 4 | @export var area_radius := 25.0 5 | @export var attack_damage := 0.1 6 | @export var cooldown_time := 0.1 7 | @export var knockback_value := 0.0 8 | 9 | @onready var proc_timer: Timer = $ProcTimer 10 | @onready var effect_area: Area2D = $EffectArea 11 | @onready var effect_shape: CollisionShape2D = $EffectArea/CollisionShape2D 12 | 13 | 14 | func _ready() -> void: 15 | proc_timer.wait_time = cooldown_time 16 | proc_timer.timeout.connect(on_proc_timer) 17 | 18 | var circle_shape = effect_shape.shape as CircleShape2D 19 | 20 | circle_shape.radius = area_radius 21 | 22 | 23 | func on_proc_timer(): 24 | var areas := effect_area.get_overlapping_areas() 25 | 26 | var attack := Attack.new() 27 | attack.damage = attack_damage 28 | attack.knockback = knockback_value 29 | 30 | for area in areas: 31 | if area is Hitbox: 32 | area.damage(attack) 33 | -------------------------------------------------------------------------------- /Player/Scripts/player.gd: -------------------------------------------------------------------------------- 1 | class_name Player 2 | extends CharacterBody2D 3 | 4 | 5 | signal damaged 6 | 7 | signal test_signal 8 | 9 | @export var c: Color 10 | 11 | @export var inventory_ui : Control 12 | 13 | var aim_position : Vector2 = Vector2(1, 0) 14 | 15 | var alive := true 16 | var invincible := false 17 | 18 | var inventory : Inventory = Inventory.new() 19 | 20 | @onready var player_sprite: Sprite2D = $PlayerSprite 21 | @onready var crafting_menu: Control = $CanvasLayer/CraftingMenu 22 | 23 | var crafting : 24 | get(): 25 | return crafting_menu.crafting 26 | 27 | 28 | func _ready(): 29 | inventory_ui.display_inventory(inventory) 30 | 31 | 32 | func _process(_delta: float) -> void: 33 | 34 | if Input.is_action_just_pressed("ui_focus_next"): 35 | if crafting_menu.crafting: 36 | crafting_menu.hide_crafting() 37 | else: 38 | crafting_menu.show_crafting() 39 | 40 | 41 | func _unhandled_input(event: InputEvent) -> void: 42 | if event is InputEventMouseMotion: 43 | var half_viewport = get_viewport_rect().size / 2.0 44 | aim_position = (event.position - half_viewport) 45 | 46 | 47 | func on_hitbox_damaged(attack: Attack) -> void: 48 | damaged.emit(attack) 49 | 50 | 51 | func on_health_changed(health: float): 52 | print("Health changed to " + str(health) + "!") 53 | -------------------------------------------------------------------------------- /Player/Scripts/player_animation.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | ################################################## 4 | # Similar to the movement component. The actual 5 | # animations are handled through an AnimationTree 6 | # for the player, but parameters are updated here. 7 | ################################################## 8 | 9 | @export var animation_tree : AnimationTree 10 | @export var sprite : Sprite2D 11 | 12 | @onready var player : Player = get_owner() 13 | 14 | 15 | func _ready(): 16 | # The animation tree is inactive while outside of gameplay. 17 | # This makes it easier to edit animations in the editor. 18 | animation_tree.active = true 19 | 20 | 21 | func _physics_process(delta: float) -> void: 22 | if !player.alive: 23 | animation_tree.active = false 24 | return 25 | 26 | var velocity = player.velocity 27 | 28 | #TODO: Replace this with a nested AnimationTree/AnimationStateMachine 29 | 30 | if velocity: 31 | var time_scale = 1 32 | 33 | if sign(player.aim_position.x) != sign(player.velocity.x): 34 | time_scale = -1 35 | 36 | animation_tree.set("parameters/TimeScale/scale", time_scale) 37 | animation_tree.set("parameters/WalkDirection/blend_position", sign(player.aim_position.x)) 38 | else: 39 | animation_tree.set("parameters/TimeScale/scale", 1) 40 | animation_tree.set("parameters/WalkDirection/blend_position", 0) 41 | 42 | -------------------------------------------------------------------------------- /Player/Scripts/player_camera.gd: -------------------------------------------------------------------------------- 1 | extends Camera2D 2 | 3 | 4 | @export var target : Player 5 | @export var sensitivity := 0.1 6 | 7 | 8 | func _physics_process(_delta: float) -> void: 9 | apply_movement() 10 | 11 | offset = CameraShake.get_offset() 12 | 13 | 14 | func apply_movement(): 15 | var target_position = target.aim_position * sensitivity 16 | 17 | position = position.lerp(target_position, 0.25) 18 | -------------------------------------------------------------------------------- /Player/Scripts/player_movement.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | ########################################################## 4 | # This is the player's movement controller. 5 | # Instead of placing all of the movement stuff inside 6 | # of the player, we move the code to a separate component 7 | ########################################################## 8 | 9 | @export_group("Speed Values") 10 | @export var max_speed := 100.0 11 | @export var acceleration_time := 0.1 12 | 13 | @export var function : Callable 14 | 15 | @onready var player : Player = get_owner() 16 | 17 | 18 | func _ready(): 19 | player.test_signal.connect(on_test_signal) 20 | 21 | 22 | func on_test_signal(): 23 | print("Guy listening to signal says hi!") 24 | 25 | 26 | func _physics_process(delta): 27 | if !player.alive: 28 | return 29 | 30 | # Read the player's current velocity 31 | var velocity = player.velocity 32 | 33 | var input_direction = Input.get_vector("move_left", "move_right", "move_up", "move_down") 34 | 35 | var target_speed := max_speed 36 | 37 | if Input.is_action_pressed("primary_fire"): 38 | target_speed *= 0.5 39 | 40 | # Apply any changes to velocity 41 | velocity = velocity.move_toward(input_direction*target_speed, (1.0 / acceleration_time) * delta * target_speed) 42 | 43 | if input_direction.y && sign(input_direction.y) != sign(velocity.y): 44 | velocity.y *= 0.75 45 | 46 | if input_direction.x && sign(input_direction.x) != sign(velocity.x): 47 | velocity.x *= 0.75 48 | 49 | # Reassign velocity and move the player 50 | player.velocity = velocity 51 | player.move_and_slide() 52 | -------------------------------------------------------------------------------- /Player/Scripts/player_weapon.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | 4 | @export var stats : WeaponStats 5 | 6 | @export var camera_shake_amount : float = 15.0 7 | 8 | ## Random variation, in degrees 9 | @export var inaccuracy : float = 10.0 10 | 11 | @export var debug_disable := false 12 | 13 | @onready var player : Player = get_owner() 14 | 15 | var bullet_scene : PackedScene = preload("res://Objects/Scenes/bullet.tscn") 16 | var shoot_sound : AudioStream = preload("res://Sound/hitHurt.wav") 17 | 18 | var is_cooldown := false 19 | var cooldown_timer : Timer 20 | 21 | func _ready(): 22 | cooldown_timer = Timer.new() 23 | cooldown_timer.name = "Cooldown Timer" 24 | cooldown_timer.wait_time = stats.firing_cooldown 25 | cooldown_timer.timeout.connect(on_cooldown_timer_finished) 26 | add_child(cooldown_timer) 27 | 28 | 29 | func _physics_process(delta: float) -> void: 30 | if debug_disable: 31 | return 32 | if !player.alive || player.crafting: 33 | return 34 | 35 | if Input.is_action_pressed("primary_fire") && !is_cooldown: 36 | 37 | # Spawn a bullet and give it a rotation based on the angle between the firing position and 38 | # the cursor's position. 39 | # The bullet will use this rotation to decide its direction. 40 | var spawned_bullet : Bullet = bullet_scene.instantiate() 41 | var mouse_angle := (get_global_mouse_position() - global_position).angle() + deg_to_rad(randf_range(-inaccuracy, inaccuracy)) 42 | 43 | # Assign attack information to bullet 44 | spawned_bullet.speed = stats.speed 45 | spawned_bullet.damage = stats.damage 46 | spawned_bullet.max_pierce = stats.max_pierce 47 | spawned_bullet.knockback_force = stats.knockback_force 48 | 49 | spawned_bullet.global_position = global_position + Vector2(15, 0).rotated(mouse_angle) 50 | spawned_bullet.rotation = mouse_angle 51 | 52 | get_tree().root.add_child(spawned_bullet) 53 | 54 | is_cooldown = true 55 | cooldown_timer.wait_time = stats.firing_cooldown 56 | cooldown_timer.start() 57 | 58 | SoundManager.play_sound_pitched(shoot_sound, 0.1, 0.1) 59 | 60 | CameraShake.add_trauma(camera_shake_amount) 61 | 62 | 63 | func on_cooldown_timer_finished(): 64 | is_cooldown = false 65 | -------------------------------------------------------------------------------- /Player/pla2974.tmp: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=18 format=3 uid="uid://dl7eyk012o1hp"] 2 | 3 | [ext_resource type="Script" path="res://Player/Scripts/player.gd" id="1_8rogi"] 4 | [ext_resource type="Texture2D" uid="uid://b8qo5sm247axm" path="res://Art/Bitlytic/B0-Z0.png" id="2_5ht7k"] 5 | [ext_resource type="Script" path="res://Player/Scripts/player_movement.gd" id="3_cjxe3"] 6 | [ext_resource type="Script" path="res://Player/Scripts/player_animation.gd" id="4_of2ax"] 7 | [ext_resource type="Script" path="res://Player/Scripts/player_weapon.gd" id="4_rntaj"] 8 | [ext_resource type="Script" path="res://Player/Scripts/player_camera.gd" id="5_dq44d"] 9 | [ext_resource type="AnimationLibrary" uid="uid://c8n45di3aj1ys" path="res://Player/Animations/player.res" id="7_qwi34"] 10 | [ext_resource type="Script" path="res://Util/Components/hitbox.gd" id="8_pcl1g"] 11 | [ext_resource type="Script" path="res://Player/player_health.gd" id="9_l0lo5"] 12 | 13 | [sub_resource type="CircleShape2D" id="CircleShape2D_5xbb6"] 14 | radius = 6.0 15 | 16 | [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_2ix7w"] 17 | radius = 4.0 18 | height = 14.0 19 | 20 | [sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_p4448"] 21 | 22 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_xldp4"] 23 | animation = &"idle" 24 | 25 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_fbrvf"] 26 | animation = &"run_left" 27 | 28 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_cvija"] 29 | animation = &"run_right" 30 | 31 | [sub_resource type="AnimationNodeBlendSpace1D" id="AnimationNodeBlendSpace1D_pvejd"] 32 | blend_point_0/node = SubResource("AnimationNodeAnimation_xldp4") 33 | blend_point_0/pos = 0.0 34 | blend_point_1/node = SubResource("AnimationNodeAnimation_fbrvf") 35 | blend_point_1/pos = -0.1 36 | blend_point_2/node = SubResource("AnimationNodeAnimation_cvija") 37 | blend_point_2/pos = 0.1 38 | blend_mode = 1 39 | 40 | [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_6djsc"] 41 | nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_p4448") 42 | nodes/TimeScale/position = Vector2(0, 80) 43 | nodes/WalkDirection/node = SubResource("AnimationNodeBlendSpace1D_pvejd") 44 | nodes/WalkDirection/position = Vector2(-540, 60) 45 | node_connections = [&"TimeScale", 0, &"WalkDirection", &"output", 0, &"TimeScale"] 46 | 47 | [node name="Player" type="CharacterBody2D" groups=["player"]] 48 | collision_mask = 128 49 | script = ExtResource("1_8rogi") 50 | 51 | [node name="PlayerHealth" type="Node" parent="." node_paths=PackedStringArray("hitbox", "animation_player")] 52 | script = ExtResource("9_l0lo5") 53 | hitbox = NodePath("../Hitbox") 54 | animation_player = NodePath("../AnimationPlayer") 55 | max_health = 3.0 56 | 57 | [node name="Hitbox" type="Area2D" parent="."] 58 | collision_mask = 0 59 | script = ExtResource("8_pcl1g") 60 | 61 | [node name="Hit Collision" type="CollisionShape2D" parent="Hitbox"] 62 | shape = SubResource("CircleShape2D_5xbb6") 63 | 64 | [node name="FloorCollision" type="CollisionShape2D" parent="."] 65 | position = Vector2(0, 3) 66 | rotation = 1.57079 67 | shape = SubResource("CapsuleShape2D_2ix7w") 68 | 69 | [node name="PlayerSprite" type="Sprite2D" parent="."] 70 | position = Vector2(0, -12) 71 | texture = ExtResource("2_5ht7k") 72 | hframes = 8 73 | vframes = 3 74 | frame = 16 75 | 76 | [node name="PlayerMovement" type="Node" parent="."] 77 | script = ExtResource("3_cjxe3") 78 | 79 | [node name="PlayerAnimation" type="Node" parent="." node_paths=PackedStringArray("animation_tree", "sprite")] 80 | script = ExtResource("4_of2ax") 81 | animation_tree = NodePath("../AnimationTree") 82 | sprite = NodePath("../PlayerSprite") 83 | 84 | [node name="PlayerWeapon" type="Node2D" parent="." node_paths=PackedStringArray("firing_position")] 85 | script = ExtResource("4_rntaj") 86 | firing_position = NodePath("../FiringPosition") 87 | 88 | [node name="FiringPosition" type="Marker2D" parent="."] 89 | position = Vector2(6, -3) 90 | 91 | [node name="PlayerCamera" type="Camera2D" parent="." node_paths=PackedStringArray("target")] 92 | zoom = Vector2(2, 2) 93 | script = ExtResource("5_dq44d") 94 | target = NodePath("..") 95 | 96 | [node name="AnimationPlayer" type="AnimationPlayer" parent="."] 97 | libraries = { 98 | "": ExtResource("7_qwi34") 99 | } 100 | 101 | [node name="AnimationTree" type="AnimationTree" parent="."] 102 | active = false 103 | libraries = { 104 | "": ExtResource("7_qwi34") 105 | } 106 | tree_root = SubResource("AnimationNodeBlendTree_6djsc") 107 | anim_player = NodePath("../AnimationPlayer") 108 | parameters/TimeScale/scale = 1.0 109 | parameters/WalkDirection/blend_position = -0.415554 110 | 111 | [connection signal="health_changed" from="PlayerHealth" to="." method="on_health_changed"] 112 | [connection signal="damaged" from="Hitbox" to="." method="on_hitbox_damaged"] 113 | -------------------------------------------------------------------------------- /Player/pla46D.tmp: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=19 format=3 uid="uid://dl7eyk012o1hp"] 2 | 3 | [ext_resource type="Script" path="res://Player/Scripts/player.gd" id="1_8rogi"] 4 | [ext_resource type="Texture2D" uid="uid://b8qo5sm247axm" path="res://Art/Bitlytic/B0-Z0.png" id="2_5ht7k"] 5 | [ext_resource type="Script" path="res://Scenes/player_movement.gd" id="3_cjxe3"] 6 | [ext_resource type="Script" path="res://Player/Scripts/PlayerAnimation.gd" id="4_of2ax"] 7 | [ext_resource type="Script" path="res://Player/Scripts/player_weapon.gd" id="4_rntaj"] 8 | [ext_resource type="Script" path="res://Objects/Scripts/player_camera.gd" id="5_dq44d"] 9 | 10 | [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_2ix7w"] 11 | radius = 4.0 12 | height = 14.0 13 | 14 | [sub_resource type="Animation" id="Animation_tcl75"] 15 | resource_name = "run_right" 16 | length = 0.8 17 | loop_mode = 1 18 | tracks/0/type = "value" 19 | tracks/0/imported = false 20 | tracks/0/enabled = true 21 | tracks/0/path = NodePath("PlayerSprite:frame") 22 | tracks/0/interp = 1 23 | tracks/0/loop_wrap = true 24 | tracks/0/keys = { 25 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7), 26 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1), 27 | "update": 1, 28 | "values": [16, 17, 18, 19, 20, 21, 22, 23] 29 | } 30 | tracks/1/type = "value" 31 | tracks/1/imported = false 32 | tracks/1/enabled = true 33 | tracks/1/path = NodePath("PlayerSprite:flip_h") 34 | tracks/1/interp = 1 35 | tracks/1/loop_wrap = true 36 | tracks/1/keys = { 37 | "times": PackedFloat32Array(0), 38 | "transitions": PackedFloat32Array(1), 39 | "update": 1, 40 | "values": [false] 41 | } 42 | 43 | [sub_resource type="Animation" id="Animation_5yh3q"] 44 | length = 0.001 45 | tracks/0/type = "value" 46 | tracks/0/imported = false 47 | tracks/0/enabled = true 48 | tracks/0/path = NodePath("PlayerSprite:frame") 49 | tracks/0/interp = 1 50 | tracks/0/loop_wrap = true 51 | tracks/0/keys = { 52 | "times": PackedFloat32Array(0), 53 | "transitions": PackedFloat32Array(1), 54 | "update": 1, 55 | "values": [16] 56 | } 57 | tracks/1/type = "value" 58 | tracks/1/imported = false 59 | tracks/1/enabled = true 60 | tracks/1/path = NodePath("PlayerSprite:flip_h") 61 | tracks/1/interp = 1 62 | tracks/1/loop_wrap = true 63 | tracks/1/keys = { 64 | "times": PackedFloat32Array(0), 65 | "transitions": PackedFloat32Array(1), 66 | "update": 1, 67 | "values": [false] 68 | } 69 | 70 | [sub_resource type="Animation" id="Animation_1uhdu"] 71 | resource_name = "run_left" 72 | length = 0.8 73 | loop_mode = 1 74 | tracks/0/type = "value" 75 | tracks/0/imported = false 76 | tracks/0/enabled = true 77 | tracks/0/path = NodePath("PlayerSprite:frame") 78 | tracks/0/interp = 1 79 | tracks/0/loop_wrap = true 80 | tracks/0/keys = { 81 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7), 82 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1), 83 | "update": 1, 84 | "values": [16, 17, 18, 19, 20, 21, 22, 23] 85 | } 86 | tracks/1/type = "value" 87 | tracks/1/imported = false 88 | tracks/1/enabled = true 89 | tracks/1/path = NodePath("PlayerSprite:flip_h") 90 | tracks/1/interp = 1 91 | tracks/1/loop_wrap = true 92 | tracks/1/keys = { 93 | "times": PackedFloat32Array(0), 94 | "transitions": PackedFloat32Array(1), 95 | "update": 1, 96 | "values": [true] 97 | } 98 | 99 | [sub_resource type="Animation" id="Animation_fh717"] 100 | resource_name = "idle" 101 | length = 0.1 102 | tracks/0/type = "value" 103 | tracks/0/imported = false 104 | tracks/0/enabled = true 105 | tracks/0/path = NodePath("PlayerSprite:frame") 106 | tracks/0/interp = 1 107 | tracks/0/loop_wrap = true 108 | tracks/0/keys = { 109 | "times": PackedFloat32Array(0), 110 | "transitions": PackedFloat32Array(1), 111 | "update": 1, 112 | "values": [0] 113 | } 114 | 115 | [sub_resource type="AnimationLibrary" id="AnimationLibrary_ffsxo"] 116 | _data = { 117 | "RESET": SubResource("Animation_5yh3q"), 118 | "idle": SubResource("Animation_fh717"), 119 | "run_left": SubResource("Animation_1uhdu"), 120 | "run_right": SubResource("Animation_tcl75") 121 | } 122 | 123 | [sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_p4448"] 124 | 125 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_xldp4"] 126 | animation = &"idle" 127 | 128 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_yr4kv"] 129 | animation = &"run_right" 130 | 131 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_fbrvf"] 132 | animation = &"run_left" 133 | 134 | [sub_resource type="AnimationNodeBlendSpace1D" id="AnimationNodeBlendSpace1D_pvejd"] 135 | blend_point_0/node = SubResource("AnimationNodeAnimation_xldp4") 136 | blend_point_0/pos = 0.0 137 | blend_point_1/node = SubResource("AnimationNodeAnimation_yr4kv") 138 | blend_point_1/pos = 0.1 139 | blend_point_2/node = SubResource("AnimationNodeAnimation_fbrvf") 140 | blend_point_2/pos = -0.1 141 | blend_mode = 1 142 | 143 | [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_6djsc"] 144 | graph_offset = Vector2(-571.646, -172.827) 145 | nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_p4448") 146 | nodes/TimeScale/position = Vector2(40, 100) 147 | nodes/WalkDirection/node = SubResource("AnimationNodeBlendSpace1D_pvejd") 148 | nodes/WalkDirection/position = Vector2(-200, 80) 149 | node_connections = [&"TimeScale", 0, &"WalkDirection", &"output", 0, &"TimeScale"] 150 | 151 | [node name="Player" type="CharacterBody2D"] 152 | collision_mask = 128 153 | script = ExtResource("1_8rogi") 154 | 155 | [node name="FloorCollision" type="CollisionShape2D" parent="."] 156 | position = Vector2(0, 3) 157 | rotation = 1.57079 158 | shape = SubResource("CapsuleShape2D_2ix7w") 159 | 160 | [node name="PlayerSprite" type="Sprite2D" parent="."] 161 | position = Vector2(0, -12) 162 | texture = ExtResource("2_5ht7k") 163 | hframes = 8 164 | vframes = 3 165 | frame = 16 166 | 167 | [node name="PlayerMovement" type="Node" parent="."] 168 | script = ExtResource("3_cjxe3") 169 | 170 | [node name="PlayerAnimation" type="Node" parent="." node_paths=PackedStringArray("animation_tree")] 171 | script = ExtResource("4_of2ax") 172 | animation_tree = NodePath("../AnimationTree") 173 | 174 | [node name="PlayerWeapon" type="Node2D" parent="." node_paths=PackedStringArray("firing_position")] 175 | script = ExtResource("4_rntaj") 176 | firing_position = NodePath("../FiringPosition") 177 | 178 | [node name="FiringPosition" type="Marker2D" parent="."] 179 | position = Vector2(2, -4) 180 | 181 | [node name="PlayerCamera" type="Camera2D" parent="." node_paths=PackedStringArray("target")] 182 | position = Vector2(-571, -337) 183 | zoom = Vector2(2, 2) 184 | script = ExtResource("5_dq44d") 185 | target = NodePath("..") 186 | 187 | [node name="AnimationPlayer" type="AnimationPlayer" parent="."] 188 | libraries = { 189 | "": SubResource("AnimationLibrary_ffsxo") 190 | } 191 | 192 | [node name="AnimationTree" type="AnimationTree" parent="."] 193 | libraries = { 194 | "": SubResource("AnimationLibrary_ffsxo") 195 | } 196 | tree_root = SubResource("AnimationNodeBlendTree_6djsc") 197 | anim_player = NodePath("../AnimationPlayer") 198 | parameters/TimeScale/scale = 1.0 199 | parameters/WalkDirection/blend_position = 0.00235665 200 | -------------------------------------------------------------------------------- /Player/player.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=25 format=3 uid="uid://dl7eyk012o1hp"] 2 | 3 | [ext_resource type="Script" path="res://Player/Scripts/player.gd" id="1_8rogi"] 4 | [ext_resource type="Texture2D" uid="uid://b8qo5sm247axm" path="res://Art/Bitlytic/B0-Z0.png" id="2_5ht7k"] 5 | [ext_resource type="Script" path="res://Player/Scripts/player_movement.gd" id="3_cjxe3"] 6 | [ext_resource type="Script" path="res://Player/Scripts/player_animation.gd" id="4_of2ax"] 7 | [ext_resource type="Script" path="res://Player/Scripts/player_weapon.gd" id="4_rntaj"] 8 | [ext_resource type="Script" path="res://Player/Scripts/player_camera.gd" id="5_dq44d"] 9 | [ext_resource type="Script" path="res://Player/player_sprite.gd" id="5_jr47p"] 10 | [ext_resource type="AnimationLibrary" uid="uid://c8n45di3aj1ys" path="res://Player/Animations/player.res" id="7_qwi34"] 11 | [ext_resource type="Script" path="res://Util/Components/hitbox.gd" id="8_pcl1g"] 12 | [ext_resource type="Resource" uid="uid://cve0rukfuwve0" path="res://Resources/WeaponStats/machine_gun.tres" id="9_dj0eo"] 13 | [ext_resource type="Script" path="res://Player/player_health.gd" id="9_l0lo5"] 14 | [ext_resource type="Theme" uid="uid://d1eibj6u66lma" path="res://UI/Theme/main_theme.tres" id="12_ixdkl"] 15 | [ext_resource type="Script" path="res://UI/Scripts/inventory_display.gd" id="12_pqah6"] 16 | [ext_resource type="PackedScene" uid="uid://xieyefjkh2a1" path="res://UI/Scenes/item_slot.tscn" id="13_3osdq"] 17 | [ext_resource type="Script" path="res://UI/item_bar.gd" id="14_oxda4"] 18 | [ext_resource type="PackedScene" uid="uid://drlfovyb0gbep" path="res://UI/Scenes/crafting_menu.tscn" id="15_u7xu4"] 19 | 20 | [sub_resource type="CircleShape2D" id="CircleShape2D_5xbb6"] 21 | radius = 6.0 22 | 23 | [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_2ix7w"] 24 | radius = 4.0 25 | height = 14.0 26 | 27 | [sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_p4448"] 28 | 29 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_xldp4"] 30 | animation = &"idle" 31 | 32 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_fbrvf"] 33 | animation = &"run_left" 34 | 35 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_cvija"] 36 | animation = &"run_right" 37 | 38 | [sub_resource type="AnimationNodeBlendSpace1D" id="AnimationNodeBlendSpace1D_pvejd"] 39 | blend_point_0/node = SubResource("AnimationNodeAnimation_xldp4") 40 | blend_point_0/pos = 0.0 41 | blend_point_1/node = SubResource("AnimationNodeAnimation_fbrvf") 42 | blend_point_1/pos = -0.1 43 | blend_point_2/node = SubResource("AnimationNodeAnimation_cvija") 44 | blend_point_2/pos = 0.1 45 | blend_mode = 1 46 | 47 | [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_6djsc"] 48 | nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_p4448") 49 | nodes/TimeScale/position = Vector2(0, 80) 50 | nodes/WalkDirection/node = SubResource("AnimationNodeBlendSpace1D_pvejd") 51 | nodes/WalkDirection/position = Vector2(-540, 60) 52 | node_connections = [&"TimeScale", 0, &"WalkDirection", &"output", 0, &"TimeScale"] 53 | 54 | [node name="Player" type="CharacterBody2D" node_paths=PackedStringArray("inventory_ui") groups=["player"]] 55 | collision_mask = 128 56 | script = ExtResource("1_8rogi") 57 | inventory_ui = NodePath("CanvasLayer/FullScreenWidth/Control/InventoryDisplay") 58 | 59 | [node name="PlayerHealth" type="Node" parent="." node_paths=PackedStringArray("collision_shape", "hitbox", "animation_player")] 60 | script = ExtResource("9_l0lo5") 61 | collision_shape = NodePath("../Hitbox/Hit Collision") 62 | hitbox = NodePath("../Hitbox") 63 | animation_player = NodePath("../AnimationPlayer") 64 | max_health = 3.0 65 | 66 | [node name="Hitbox" type="Area2D" parent="."] 67 | collision_mask = 0 68 | script = ExtResource("8_pcl1g") 69 | 70 | [node name="Hit Collision" type="CollisionShape2D" parent="Hitbox"] 71 | shape = SubResource("CircleShape2D_5xbb6") 72 | 73 | [node name="FloorCollision" type="CollisionShape2D" parent="."] 74 | position = Vector2(0, 3) 75 | rotation = 1.57079 76 | shape = SubResource("CapsuleShape2D_2ix7w") 77 | 78 | [node name="PlayerSprite" type="Sprite2D" parent="."] 79 | position = Vector2(0, -12) 80 | texture = ExtResource("2_5ht7k") 81 | hframes = 8 82 | vframes = 3 83 | frame = 16 84 | region_enabled = true 85 | region_rect = Rect2(0.1, 0.1, 192, 96) 86 | script = ExtResource("5_jr47p") 87 | 88 | [node name="PlayerMovement" type="Node" parent="."] 89 | script = ExtResource("3_cjxe3") 90 | 91 | [node name="PlayerAnimation" type="Node" parent="." node_paths=PackedStringArray("animation_tree", "sprite")] 92 | script = ExtResource("4_of2ax") 93 | animation_tree = NodePath("../AnimationTree") 94 | sprite = NodePath("../PlayerSprite") 95 | 96 | [node name="PlayerWeapon" type="Node2D" parent="."] 97 | position = Vector2(0, -4) 98 | script = ExtResource("4_rntaj") 99 | stats = ExtResource("9_dj0eo") 100 | camera_shake_amount = 1.0 101 | 102 | [node name="PlayerCamera" type="Camera2D" parent="." node_paths=PackedStringArray("target")] 103 | zoom = Vector2(2, 2) 104 | process_callback = 0 105 | script = ExtResource("5_dq44d") 106 | target = NodePath("..") 107 | 108 | [node name="AnimationPlayer" type="AnimationPlayer" parent="."] 109 | libraries = { 110 | "": ExtResource("7_qwi34") 111 | } 112 | 113 | [node name="AnimationTree" type="AnimationTree" parent="."] 114 | active = false 115 | tree_root = SubResource("AnimationNodeBlendTree_6djsc") 116 | anim_player = NodePath("../AnimationPlayer") 117 | parameters/TimeScale/scale = 1.0 118 | parameters/WalkDirection/blend_position = 0.00076282 119 | 120 | [node name="CanvasLayer" type="CanvasLayer" parent="."] 121 | 122 | [node name="FullScreenWidth" type="Control" parent="CanvasLayer"] 123 | layout_mode = 3 124 | anchors_preset = 15 125 | anchor_right = 1.0 126 | anchor_bottom = 1.0 127 | offset_right = -640.0 128 | offset_bottom = -360.0 129 | grow_horizontal = 2 130 | grow_vertical = 2 131 | mouse_filter = 2 132 | 133 | [node name="Control" type="Control" parent="CanvasLayer/FullScreenWidth"] 134 | layout_mode = 1 135 | anchors_preset = 7 136 | anchor_left = 0.5 137 | anchor_top = 1.0 138 | anchor_right = 0.5 139 | anchor_bottom = 1.0 140 | offset_left = 320.0 141 | offset_top = 232.0 142 | offset_right = 320.0 143 | offset_bottom = 232.0 144 | grow_horizontal = 2 145 | grow_vertical = 0 146 | mouse_filter = 2 147 | theme = ExtResource("12_ixdkl") 148 | 149 | [node name="InventoryDisplay" type="Control" parent="CanvasLayer/FullScreenWidth/Control" node_paths=PackedStringArray("slot_parent")] 150 | layout_mode = 1 151 | anchors_preset = 8 152 | anchor_left = 0.5 153 | anchor_top = 0.5 154 | anchor_right = 0.5 155 | anchor_bottom = 0.5 156 | offset_top = 59.0 157 | offset_bottom = 59.0 158 | grow_horizontal = 2 159 | grow_vertical = 2 160 | mouse_filter = 2 161 | script = ExtResource("12_pqah6") 162 | slot_parent = NodePath("HBoxContainer") 163 | 164 | [node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/FullScreenWidth/Control/InventoryDisplay"] 165 | layout_direction = 1 166 | layout_mode = 0 167 | offset_left = -254.0 168 | offset_right = 254.0 169 | offset_bottom = 60.0 170 | theme_override_constants/separation = 4 171 | alignment = 1 172 | script = ExtResource("14_oxda4") 173 | 174 | [node name="ItemSlot" parent="CanvasLayer/FullScreenWidth/Control/InventoryDisplay/HBoxContainer" instance=ExtResource("13_3osdq")] 175 | layout_mode = 2 176 | size_flags_horizontal = 0 177 | 178 | [node name="ItemSlot2" parent="CanvasLayer/FullScreenWidth/Control/InventoryDisplay/HBoxContainer" instance=ExtResource("13_3osdq")] 179 | layout_mode = 2 180 | size_flags_horizontal = 0 181 | 182 | [node name="ItemSlot3" parent="CanvasLayer/FullScreenWidth/Control/InventoryDisplay/HBoxContainer" instance=ExtResource("13_3osdq")] 183 | layout_mode = 2 184 | size_flags_horizontal = 0 185 | 186 | [node name="ItemSlot4" parent="CanvasLayer/FullScreenWidth/Control/InventoryDisplay/HBoxContainer" instance=ExtResource("13_3osdq")] 187 | layout_mode = 2 188 | size_flags_horizontal = 0 189 | 190 | [node name="ItemSlot5" parent="CanvasLayer/FullScreenWidth/Control/InventoryDisplay/HBoxContainer" instance=ExtResource("13_3osdq")] 191 | layout_mode = 2 192 | size_flags_horizontal = 0 193 | 194 | [node name="ItemSlot6" parent="CanvasLayer/FullScreenWidth/Control/InventoryDisplay/HBoxContainer" instance=ExtResource("13_3osdq")] 195 | layout_mode = 2 196 | size_flags_horizontal = 0 197 | 198 | [node name="ItemSlot7" parent="CanvasLayer/FullScreenWidth/Control/InventoryDisplay/HBoxContainer" instance=ExtResource("13_3osdq")] 199 | layout_mode = 2 200 | size_flags_horizontal = 0 201 | 202 | [node name="ItemSlot8" parent="CanvasLayer/FullScreenWidth/Control/InventoryDisplay/HBoxContainer" instance=ExtResource("13_3osdq")] 203 | layout_mode = 2 204 | size_flags_horizontal = 0 205 | 206 | [node name="CraftingMenu" parent="CanvasLayer" instance=ExtResource("15_u7xu4")] 207 | 208 | [connection signal="health_changed" from="PlayerHealth" to="." method="on_health_changed"] 209 | [connection signal="damaged" from="Hitbox" to="." method="on_hitbox_damaged"] 210 | -------------------------------------------------------------------------------- /Player/player_health.gd: -------------------------------------------------------------------------------- 1 | class_name PlayerHealth 2 | extends Health 3 | 4 | 5 | @export var invincibility_time := 1.5 6 | @export var collision_shape : CollisionShape2D 7 | 8 | @onready var player : Player = get_owner() 9 | 10 | var inv_timer : Timer 11 | 12 | func _ready(): 13 | super() 14 | 15 | inv_timer = Timer.new() 16 | inv_timer.wait_time = invincibility_time 17 | inv_timer.timeout.connect(on_inv_timer_timeout) 18 | add_child(inv_timer) 19 | 20 | 21 | func on_damaged(attack: Attack) -> void: 22 | if !player.alive: 23 | return 24 | 25 | super(attack) 26 | 27 | if health <= 0: 28 | player.alive = false 29 | else: 30 | inv_timer.start() 31 | player.invincible = false 32 | collision_shape.set_deferred("disabled", true) 33 | 34 | 35 | func on_inv_timer_timeout(): 36 | player.invincible = false 37 | collision_shape.set_deferred("disabled", false) 38 | -------------------------------------------------------------------------------- /Player/player_sprite.gd: -------------------------------------------------------------------------------- 1 | extends Sprite2D 2 | 3 | 4 | @onready var player : Player = get_owner() 5 | 6 | var start_offset : Vector2 7 | 8 | func _ready() -> void: 9 | start_offset = position 10 | 11 | 12 | func _process(delta: float) -> void: 13 | if !player.velocity: 14 | self.global_position = floor(player.global_position + start_offset) + Vector2(0.1, 0.1) 15 | -------------------------------------------------------------------------------- /Player/sword.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | 4 | @export var projectile_scene : PackedScene = preload("res://Objects/Scenes/bullet.tscn") 5 | 6 | @onready var weapon_animation: AnimationPlayer = $WeaponAnimation 7 | @onready var fire_position: Marker2D = $FirePosition 8 | 9 | @export var debug_disable := false 10 | 11 | func _physics_process(delta: float) -> void: 12 | if debug_disable: 13 | return 14 | 15 | look_at(get_global_mouse_position()) 16 | 17 | if Input.is_action_just_pressed("primary_fire"): 18 | weapon_animation.play("swing") 19 | 20 | 21 | func fire_projectile(): 22 | var spawned_bullet : Bullet = projectile_scene.instantiate() 23 | add_child(spawned_bullet) 24 | spawned_bullet.rotation = (get_global_mouse_position() - global_position).angle() 25 | spawned_bullet.global_position = fire_position.global_position 26 | CameraShake.add_trauma(1.0) 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # What is this? 2 | 3 | This uses the [Strategy Pattern repo](https://github.com/Bitlytic/Strategy-GDScript) as a base and modifies it to be centered around the use of resources in Godot 4. 4 | 5 | ### Template Project 6 | This is a top down arena shooter that uses Composition and Resources. It is designed in such a way that you can clone this github repo and use it as a template with a few things ready to go. The assets in this project have also been chosen so that you can use them for quick prototyping and if you decide to go commercial, there is no licensing other than giving credit due. 7 | 8 | 9 | ### GDScript 10 | There is currently no C# version, but it may be ported in the future. Porting GDScript to C# is a little annoying, sorry :P 11 | 12 | ### Resources Tutorial 13 | This project was made mainly for use in my basic tutorial on Resources on [YouTube](https://www.youtube.com/watch?v=h5vpjCDNa-w) 14 | 15 | 16 | ### Using this Project 17 | 18 | Using this project should be as simple as cloning it via git or downloading as a zip file. From there, you can point Godot to the project.godot file, and it _should_ just run. 19 | 20 | I do not require credit, you can use this as a template or a learning resource or any way you want to. If you do, you're welcome to share it and tag me on Twitter [@Bitlytic](https://www.twitter.com/bitlytic), or better Twitter [@bitlytic.dev](https://bsky.app/profile/bitlytic.dev), I would love to see what you make! 21 | 22 | 23 | ## Assets 24 | 25 | This project uses the following Creative Commons assets: 26 | - [Arks Dinos](https://arks.itch.io/dino-characters) 27 | - [Kenney 1-Bit Pack](https://kenney.nl/assets/1-bit-pack) 28 | - [RGS_Dev's Tileset](https://rgsdev.itch.io/free-cc0-top-down-tileset-template-pixel-art) 29 | 30 | These assets specify that they can be used in commercial or non-commercial projects, just give credit. 31 | -------------------------------------------------------------------------------- /Resources/Enemy/blue_dino.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="EnemyStats" load_steps=4 format=3 uid="uid://b3bi4us3hrfw8"] 2 | 3 | [ext_resource type="Resource" uid="uid://tpxkaa0ercoj" path="res://Resources/LootTables/blue_dino_loot.tres" id="1_ruu1y"] 4 | [ext_resource type="Script" path="res://Util/Enemy/enemy_stats.gd" id="1_s12a1"] 5 | [ext_resource type="Texture2D" uid="uid://drfyuy8w6p057" path="res://Art/Arks/DinoSprites - doux.png" id="2_binn3"] 6 | 7 | [resource] 8 | script = ExtResource("1_s12a1") 9 | texture = ExtResource("2_binn3") 10 | max_health = 25.0 11 | max_speed = 90.0 12 | variation_range = 10.0 13 | acceleration_time = 2.5 14 | friction = 1.0 15 | loot_table = ExtResource("1_ruu1y") 16 | -------------------------------------------------------------------------------- /Resources/Enemy/green_dino.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="EnemyStats" load_steps=3 format=3 uid="uid://kj6u0tgjjfkx"] 2 | 3 | [ext_resource type="Script" path="res://Util/Enemy/enemy_stats.gd" id="1_7rk43"] 4 | [ext_resource type="Texture2D" uid="uid://eb28cx5toii3" path="res://Art/Arks/DinoSprites - vita.png" id="2_t7fky"] 5 | 6 | [resource] 7 | script = ExtResource("1_7rk43") 8 | texture = ExtResource("2_t7fky") 9 | max_health = 150.0 10 | max_speed = 20.0 11 | variation_range = 10.0 12 | acceleration_time = 2.5 13 | friction = 1.0 14 | -------------------------------------------------------------------------------- /Resources/Enemy/red_dino.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="EnemyStats" load_steps=4 format=3 uid="uid://tj0ote0rmh7d"] 2 | 3 | [ext_resource type="Script" path="res://Util/Enemy/enemy_stats.gd" id="1_aj1hj"] 4 | [ext_resource type="Resource" uid="uid://c0dfkrne28b5n" path="res://Resources/LootTables/red_dino_loot.tres" id="1_u7fct"] 5 | [ext_resource type="Texture2D" uid="uid://c5cbe07dk5lyn" path="res://Art/Arks/DinoSprites - mort.png" id="2_el33b"] 6 | 7 | [resource] 8 | script = ExtResource("1_aj1hj") 9 | texture = ExtResource("2_el33b") 10 | max_health = 10.0 11 | max_speed = 100.0 12 | variation_range = 10.0 13 | acceleration_time = 2.5 14 | friction = 1.0 15 | loot_table = ExtResource("1_u7fct") 16 | -------------------------------------------------------------------------------- /Resources/Enemy/yellow_dino.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="EnemyStats" load_steps=4 format=3 uid="uid://d0vpr4kgckjx6"] 2 | 3 | [ext_resource type="Script" path="res://Util/Enemy/enemy_stats.gd" id="1_k8twp"] 4 | [ext_resource type="Resource" uid="uid://b26obx3gbym7r" path="res://Resources/LootTables/yellow_dino_loot.tres" id="1_rgl1g"] 5 | [ext_resource type="Texture2D" uid="uid://cqcr6ctruxfn5" path="res://Art/Arks/DinoSprites - tard.png" id="2_vvh3a"] 6 | 7 | [resource] 8 | script = ExtResource("1_k8twp") 9 | texture = ExtResource("2_vvh3a") 10 | max_health = 5.0 11 | max_speed = 120.0 12 | variation_range = 10.0 13 | acceleration_time = 1.5 14 | friction = 1.0 15 | loot_table = ExtResource("1_rgl1g") 16 | -------------------------------------------------------------------------------- /Resources/Items/Materials/bone.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="Item" load_steps=4 format=3 uid="uid://bi74twc4r5grv"] 2 | 3 | [ext_resource type="Script" path="res://Util/Items/item.gd" id="1_22cej"] 4 | [ext_resource type="Texture2D" uid="uid://dnfmimtdyt0r0" path="res://Art/Kenney/1_bit_pack.png" id="2_icgw5"] 5 | 6 | [sub_resource type="AtlasTexture" id="AtlasTexture_ynq4w"] 7 | atlas = ExtResource("2_icgw5") 8 | region = Rect2(512, 192, 16, 16) 9 | 10 | [resource] 11 | script = ExtResource("1_22cej") 12 | item_name = "Bone" 13 | sprite = SubResource("AtlasTexture_ynq4w") 14 | -------------------------------------------------------------------------------- /Resources/Items/Materials/fish.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="Item" load_steps=4 format=3 uid="uid://dh5d7qp354vxq"] 2 | 3 | [ext_resource type="Script" path="res://Util/Items/item.gd" id="1_ykl4h"] 4 | [ext_resource type="Texture2D" uid="uid://dnfmimtdyt0r0" path="res://Art/Kenney/1_bit_pack.png" id="2_u1om3"] 5 | 6 | [sub_resource type="AtlasTexture" id="AtlasTexture_jf174"] 7 | atlas = ExtResource("2_u1om3") 8 | region = Rect2(528, 272, 16, 16) 9 | 10 | [resource] 11 | script = ExtResource("1_ykl4h") 12 | item_name = "Fish" 13 | sprite = SubResource("AtlasTexture_jf174") 14 | -------------------------------------------------------------------------------- /Resources/Items/Materials/rock.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="Item" load_steps=4 format=3 uid="uid://br1e6826mf6w2"] 2 | 3 | [ext_resource type="Script" path="res://Util/Items/item.gd" id="1_ehx7d"] 4 | [ext_resource type="Texture2D" uid="uid://dnfmimtdyt0r0" path="res://Art/Kenney/1_bit_pack.png" id="2_bn0dd"] 5 | 6 | [sub_resource type="AtlasTexture" id="AtlasTexture_4qyqh"] 7 | atlas = ExtResource("2_bn0dd") 8 | region = Rect2(80, 32, 16, 16) 9 | 10 | [resource] 11 | script = ExtResource("1_ehx7d") 12 | item_name = "Rock" 13 | sprite = SubResource("AtlasTexture_4qyqh") 14 | -------------------------------------------------------------------------------- /Resources/Items/Materials/stick.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="Item" load_steps=4 format=3 uid="uid://mxe3slsxjm58"] 2 | 3 | [ext_resource type="Script" path="res://Util/Items/item.gd" id="1_x31qh"] 4 | [ext_resource type="Texture2D" uid="uid://dnfmimtdyt0r0" path="res://Art/Kenney/1_bit_pack.png" id="2_5a5xl"] 5 | 6 | [sub_resource type="AtlasTexture" id="AtlasTexture_4j0xk"] 7 | atlas = ExtResource("2_5a5xl") 8 | region = Rect2(528, 320, 16, 16) 9 | 10 | [resource] 11 | script = ExtResource("1_x31qh") 12 | item_name = "Stick" 13 | sprite = SubResource("AtlasTexture_4j0xk") 14 | -------------------------------------------------------------------------------- /Resources/Items/Weapons/bone_sword.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="Item" load_steps=4 format=3 uid="uid://d2msg3gyi40qb"] 2 | 3 | [ext_resource type="Script" path="res://Util/Items/item.gd" id="1_tuo68"] 4 | [ext_resource type="Texture2D" uid="uid://dnfmimtdyt0r0" path="res://Art/Kenney/1_bit_pack.png" id="2_ok0ku"] 5 | 6 | [sub_resource type="AtlasTexture" id="AtlasTexture_ib7ax"] 7 | atlas = ExtResource("2_ok0ku") 8 | region = Rect2(544, 128, 16, 16) 9 | 10 | [resource] 11 | script = ExtResource("1_tuo68") 12 | item_name = "Bone Sword" 13 | sprite = SubResource("AtlasTexture_ib7ax") 14 | -------------------------------------------------------------------------------- /Resources/Items/Weapons/stone_axe.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="Item" load_steps=4 format=3 uid="uid://lndyvwcekt5m"] 2 | 3 | [ext_resource type="Script" path="res://Util/Items/item.gd" id="1_e7ej7"] 4 | [ext_resource type="Texture2D" uid="uid://dnfmimtdyt0r0" path="res://Art/Kenney/1_bit_pack.png" id="2_aa118"] 5 | 6 | [sub_resource type="AtlasTexture" id="AtlasTexture_b67cq"] 7 | atlas = ExtResource("2_aa118") 8 | region = Rect2(640, 112, 16, 16) 9 | 10 | [resource] 11 | script = ExtResource("1_e7ej7") 12 | item_name = "Stone Axe" 13 | sprite = SubResource("AtlasTexture_b67cq") 14 | -------------------------------------------------------------------------------- /Resources/Items/Weapons/stone_pickaxe.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="Item" load_steps=4 format=3 uid="uid://df7xgc2v4p61p"] 2 | 3 | [ext_resource type="Script" path="res://Util/Items/item.gd" id="1_dudwa"] 4 | [ext_resource type="Texture2D" uid="uid://dnfmimtdyt0r0" path="res://Art/Kenney/1_bit_pack.png" id="2_u45c1"] 5 | 6 | [sub_resource type="AtlasTexture" id="AtlasTexture_hbtjg"] 7 | atlas = ExtResource("2_u45c1") 8 | region = Rect2(688, 80, 16, 16) 9 | 10 | [resource] 11 | script = ExtResource("1_dudwa") 12 | item_name = "Stone Pickaxe" 13 | sprite = SubResource("AtlasTexture_hbtjg") 14 | -------------------------------------------------------------------------------- /Resources/Items/Weapons/stone_shovel.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="Item" load_steps=4 format=3 uid="uid://ct5oncxj1qalo"] 2 | 3 | [ext_resource type="Script" path="res://Util/Items/item.gd" id="1_arsl6"] 4 | [ext_resource type="Texture2D" uid="uid://dnfmimtdyt0r0" path="res://Art/Kenney/1_bit_pack.png" id="2_0tdqn"] 5 | 6 | [sub_resource type="AtlasTexture" id="AtlasTexture_lp176"] 7 | atlas = ExtResource("2_0tdqn") 8 | region = Rect2(672, 80, 16, 16) 9 | 10 | [resource] 11 | script = ExtResource("1_arsl6") 12 | item_name = "Stone Shovel" 13 | sprite = SubResource("AtlasTexture_lp176") 14 | -------------------------------------------------------------------------------- /Resources/LootTables/blue_dino_loot.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="LootTable" load_steps=5 format=3 uid="uid://tpxkaa0ercoj"] 2 | 3 | [ext_resource type="Script" path="res://Util/Enemy/loot_table.gd" id="1_hkqn0"] 4 | [ext_resource type="Script" path="res://Util/Items/item_roll.gd" id="1_n5mm6"] 5 | [ext_resource type="Resource" uid="uid://bi74twc4r5grv" path="res://Resources/Items/Materials/bone.tres" id="2_t4v1f"] 6 | 7 | [sub_resource type="Resource" id="Resource_ywf0s"] 8 | script = ExtResource("1_n5mm6") 9 | item = ExtResource("2_t4v1f") 10 | count = 25 11 | weight = 0.5 12 | 13 | [resource] 14 | script = ExtResource("1_hkqn0") 15 | item_rolls = Array[ExtResource("1_n5mm6")]([SubResource("Resource_ywf0s")]) 16 | roll_times = 1 17 | -------------------------------------------------------------------------------- /Resources/LootTables/red_dino_loot.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="LootTable" load_steps=7 format=3 uid="uid://c0dfkrne28b5n"] 2 | 3 | [ext_resource type="Script" path="res://Util/Items/item_roll.gd" id="1_vvps4"] 4 | [ext_resource type="Resource" uid="uid://br1e6826mf6w2" path="res://Resources/Items/Materials/rock.tres" id="2_ikg4l"] 5 | [ext_resource type="Resource" uid="uid://mxe3slsxjm58" path="res://Resources/Items/Materials/stick.tres" id="3_idw1w"] 6 | [ext_resource type="Script" path="res://Util/Enemy/loot_table.gd" id="4_ly4uj"] 7 | 8 | [sub_resource type="Resource" id="Resource_fko8t"] 9 | script = ExtResource("1_vvps4") 10 | item = ExtResource("2_ikg4l") 11 | count = 25 12 | weight = 0.5 13 | 14 | [sub_resource type="Resource" id="Resource_d43gw"] 15 | script = ExtResource("1_vvps4") 16 | item = ExtResource("3_idw1w") 17 | count = 25 18 | weight = 0.5 19 | 20 | [resource] 21 | script = ExtResource("4_ly4uj") 22 | item_rolls = Array[ExtResource("1_vvps4")]([SubResource("Resource_fko8t"), SubResource("Resource_d43gw")]) 23 | roll_times = 3 24 | -------------------------------------------------------------------------------- /Resources/LootTables/yellow_dino_loot.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="LootTable" load_steps=5 format=3 uid="uid://b26obx3gbym7r"] 2 | 3 | [ext_resource type="Script" path="res://Util/Items/item_roll.gd" id="1_xpip0"] 4 | [ext_resource type="Resource" uid="uid://mxe3slsxjm58" path="res://Resources/Items/Materials/stick.tres" id="2_ba7fw"] 5 | [ext_resource type="Script" path="res://Util/Enemy/loot_table.gd" id="2_f4ek6"] 6 | 7 | [sub_resource type="Resource" id="Resource_3ur43"] 8 | script = ExtResource("1_xpip0") 9 | item = ExtResource("2_ba7fw") 10 | count = 25 11 | weight = 0.5 12 | 13 | [resource] 14 | script = ExtResource("2_f4ek6") 15 | item_rolls = Array[ExtResource("1_xpip0")]([SubResource("Resource_3ur43")]) 16 | roll_times = 2 17 | -------------------------------------------------------------------------------- /Resources/Recipes/bone_sword_recipe.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="CraftingRecipe" load_steps=9 format=3 uid="uid://boejtqjedxkpl"] 2 | 3 | [ext_resource type="Script" path="res://Util/Items/crafting_ingredient.gd" id="1_t1asq"] 4 | [ext_resource type="Resource" uid="uid://bi74twc4r5grv" path="res://Resources/Items/Materials/bone.tres" id="2_2flar"] 5 | [ext_resource type="Script" path="res://Util/Items/crafting_recipe.gd" id="2_wu5b3"] 6 | [ext_resource type="Resource" uid="uid://br1e6826mf6w2" path="res://Resources/Items/Materials/rock.tres" id="3_j3nuh"] 7 | [ext_resource type="Resource" uid="uid://d2msg3gyi40qb" path="res://Resources/Items/Weapons/bone_sword.tres" id="4_ri1r7"] 8 | 9 | [sub_resource type="Resource" id="Resource_h14f7"] 10 | script = ExtResource("1_t1asq") 11 | item = ExtResource("2_2flar") 12 | count = 150 13 | 14 | [sub_resource type="Resource" id="Resource_h7e5m"] 15 | script = ExtResource("1_t1asq") 16 | item = ExtResource("3_j3nuh") 17 | count = 1 18 | 19 | [sub_resource type="Resource" id="Resource_geawa"] 20 | script = ExtResource("1_t1asq") 21 | item = ExtResource("4_ri1r7") 22 | count = 1 23 | 24 | [resource] 25 | script = ExtResource("2_wu5b3") 26 | ingredients = Array[ExtResource("1_t1asq")]([SubResource("Resource_h14f7"), SubResource("Resource_h7e5m")]) 27 | output = SubResource("Resource_geawa") 28 | -------------------------------------------------------------------------------- /Resources/Recipes/stone_axe_recipe.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="CraftingRecipe" load_steps=9 format=3 uid="uid://bsb4f4l7ujc7g"] 2 | 3 | [ext_resource type="Script" path="res://Util/Items/crafting_ingredient.gd" id="1_7202a"] 4 | [ext_resource type="Resource" uid="uid://br1e6826mf6w2" path="res://Resources/Items/Materials/rock.tres" id="2_s7dm3"] 5 | [ext_resource type="Resource" uid="uid://mxe3slsxjm58" path="res://Resources/Items/Materials/stick.tres" id="3_im87k"] 6 | [ext_resource type="Resource" uid="uid://lndyvwcekt5m" path="res://Resources/Items/Weapons/stone_axe.tres" id="4_jpjgy"] 7 | [ext_resource type="Script" path="res://Util/Items/crafting_recipe.gd" id="5_xrapj"] 8 | 9 | [sub_resource type="Resource" id="Resource_0sp4d"] 10 | script = ExtResource("1_7202a") 11 | item = ExtResource("2_s7dm3") 12 | count = 25 13 | 14 | [sub_resource type="Resource" id="Resource_6bp1p"] 15 | script = ExtResource("1_7202a") 16 | item = ExtResource("3_im87k") 17 | count = 30 18 | 19 | [sub_resource type="Resource" id="Resource_s7c8b"] 20 | script = ExtResource("1_7202a") 21 | item = ExtResource("4_jpjgy") 22 | count = 1 23 | 24 | [resource] 25 | script = ExtResource("5_xrapj") 26 | ingredients = Array[ExtResource("1_7202a")]([SubResource("Resource_0sp4d"), SubResource("Resource_6bp1p")]) 27 | output = SubResource("Resource_s7c8b") 28 | -------------------------------------------------------------------------------- /Resources/Recipes/stone_pickaxe_recipe.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="CraftingRecipe" load_steps=9 format=3 uid="uid://duwxk8u1avxov"] 2 | 3 | [ext_resource type="Script" path="res://Util/Items/crafting_ingredient.gd" id="1_e6l77"] 4 | [ext_resource type="Script" path="res://Util/Items/crafting_recipe.gd" id="2_jpdg1"] 5 | [ext_resource type="Resource" uid="uid://mxe3slsxjm58" path="res://Resources/Items/Materials/stick.tres" id="2_p8iyy"] 6 | [ext_resource type="Resource" uid="uid://dh5d7qp354vxq" path="res://Resources/Items/Materials/fish.tres" id="3_0b6fp"] 7 | [ext_resource type="Resource" uid="uid://df7xgc2v4p61p" path="res://Resources/Items/Weapons/stone_pickaxe.tres" id="4_ygjlo"] 8 | 9 | [sub_resource type="Resource" id="Resource_tadrt"] 10 | script = ExtResource("1_e6l77") 11 | item = ExtResource("2_p8iyy") 12 | count = 25 13 | 14 | [sub_resource type="Resource" id="Resource_v0ss6"] 15 | script = ExtResource("1_e6l77") 16 | item = ExtResource("3_0b6fp") 17 | count = 30 18 | 19 | [sub_resource type="Resource" id="Resource_bdawa"] 20 | script = ExtResource("1_e6l77") 21 | item = ExtResource("4_ygjlo") 22 | count = 1 23 | 24 | [resource] 25 | script = ExtResource("2_jpdg1") 26 | ingredients = Array[ExtResource("1_e6l77")]([SubResource("Resource_tadrt"), SubResource("Resource_v0ss6")]) 27 | output = SubResource("Resource_bdawa") 28 | -------------------------------------------------------------------------------- /Resources/Recipes/stone_shovel_recipe.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="CraftingRecipe" load_steps=9 format=3 uid="uid://bka4ew20mrmf2"] 2 | 3 | [ext_resource type="Script" path="res://Util/Items/crafting_ingredient.gd" id="1_usuf2"] 4 | [ext_resource type="Script" path="res://Util/Items/crafting_recipe.gd" id="2_1x4ch"] 5 | [ext_resource type="Resource" uid="uid://mxe3slsxjm58" path="res://Resources/Items/Materials/stick.tres" id="2_x5uv7"] 6 | [ext_resource type="Resource" uid="uid://br1e6826mf6w2" path="res://Resources/Items/Materials/rock.tres" id="3_khfy2"] 7 | [ext_resource type="Resource" uid="uid://ct5oncxj1qalo" path="res://Resources/Items/Weapons/stone_shovel.tres" id="4_ukw3q"] 8 | 9 | [sub_resource type="Resource" id="Resource_r5vl7"] 10 | script = ExtResource("1_usuf2") 11 | item = ExtResource("2_x5uv7") 12 | count = 50 13 | 14 | [sub_resource type="Resource" id="Resource_jnxfh"] 15 | script = ExtResource("1_usuf2") 16 | item = ExtResource("3_khfy2") 17 | count = 50 18 | 19 | [sub_resource type="Resource" id="Resource_umytv"] 20 | script = ExtResource("1_usuf2") 21 | item = ExtResource("4_ukw3q") 22 | count = 1 23 | 24 | [resource] 25 | script = ExtResource("2_1x4ch") 26 | ingredients = Array[ExtResource("1_usuf2")]([SubResource("Resource_r5vl7"), SubResource("Resource_jnxfh")]) 27 | output = SubResource("Resource_umytv") 28 | -------------------------------------------------------------------------------- /Resources/Tileset/blue_tiles.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="TileSet" load_steps=3 format=3 uid="uid://b85qnllu1g4bs"] 2 | 3 | [ext_resource type="Texture2D" uid="uid://bdlnxydf3kem5" path="res://Art/RGS_Dev/tileset_blue.png" id="1_ww0uc"] 4 | 5 | [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_dxfh7"] 6 | texture = ExtResource("1_ww0uc") 7 | 0:0/0 = 0 8 | 0:0/0/terrain_set = 0 9 | 0:0/0/terrain = 0 10 | 0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 11 | 0:0/0/terrains_peering_bit/right_side = 0 12 | 0:0/0/terrains_peering_bit/bottom_side = 0 13 | 1:0/0 = 0 14 | 1:0/0/terrain_set = 0 15 | 1:0/0/terrain = 0 16 | 1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 17 | 1:0/0/terrains_peering_bit/right_side = 0 18 | 1:0/0/terrains_peering_bit/bottom_side = 0 19 | 1:0/0/terrains_peering_bit/left_side = 0 20 | 2:0/0 = 0 21 | 2:0/0/terrain_set = 0 22 | 2:0/0/terrain = 0 23 | 2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 24 | 2:0/0/terrains_peering_bit/right_side = 0 25 | 2:0/0/terrains_peering_bit/bottom_side = 0 26 | 2:0/0/terrains_peering_bit/left_side = 0 27 | 3:0/0 = 0 28 | 3:0/0/terrain_set = 0 29 | 3:0/0/terrain = 0 30 | 3:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 31 | 3:0/0/terrains_peering_bit/bottom_side = 0 32 | 3:0/0/terrains_peering_bit/left_side = 0 33 | 4:0/0 = 0 34 | 4:0/0/terrain_set = 0 35 | 4:0/0/terrain = 0 36 | 4:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 37 | 4:0/0/terrains_peering_bit/right_side = 0 38 | 4:0/0/terrains_peering_bit/bottom_side = 0 39 | 4:0/0/terrains_peering_bit/left_side = 0 40 | 5:0/0 = 0 41 | 5:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 42 | 6:0/0 = 0 43 | 6:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 44 | 7:0/0 = 0 45 | 8:0/0 = 0 46 | 9:0/0 = 0 47 | 10:0/0 = 0 48 | 11:0/0 = 0 49 | 12:0/0 = 0 50 | 13:0/0 = 0 51 | 14:0/0 = 0 52 | 15:0/0 = 0 53 | 0:1/0 = 0 54 | 0:1/0/terrain_set = 0 55 | 0:1/0/terrain = 0 56 | 0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 0, -8, 0, 8, -8, 8) 57 | 0:1/0/terrains_peering_bit/right_side = 0 58 | 0:1/0/terrains_peering_bit/bottom_side = 0 59 | 0:1/0/terrains_peering_bit/top_side = 0 60 | 1:1/0 = 0 61 | 1:1/0/terrain_set = 0 62 | 1:1/0/terrain = 0 63 | 1:1/0/terrains_peering_bit/right_side = 0 64 | 1:1/0/terrains_peering_bit/bottom_side = 0 65 | 1:1/0/terrains_peering_bit/left_side = 0 66 | 1:1/0/terrains_peering_bit/top_side = 0 67 | 2:1/0 = 0 68 | 2:1/0/terrain_set = 0 69 | 2:1/0/terrain = 0 70 | 2:1/0/probability = 0.1 71 | 2:1/0/terrains_peering_bit/right_side = 0 72 | 2:1/0/terrains_peering_bit/bottom_side = 0 73 | 2:1/0/terrains_peering_bit/left_side = 0 74 | 2:1/0/terrains_peering_bit/top_side = 0 75 | 3:1/0 = 0 76 | 3:1/0/terrain_set = 0 77 | 4:1/0 = 0 78 | 4:1/0/terrain_set = 0 79 | 4:1/0/terrain = 0 80 | 4:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 81 | 4:1/0/terrains_peering_bit/right_side = 0 82 | 4:1/0/terrains_peering_bit/bottom_side = 0 83 | 4:1/0/terrains_peering_bit/left_side = 0 84 | 5:1/0 = 0 85 | 6:1/0 = 0 86 | 7:1/0 = 0 87 | 8:1/0 = 0 88 | 9:1/0 = 0 89 | 10:1/0 = 0 90 | 11:1/0 = 0 91 | 12:1/0 = 0 92 | 13:1/0 = 0 93 | 0:2/0 = 0 94 | 0:2/0/terrain_set = 0 95 | 0:2/0/terrain = 0 96 | 0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 0, -8, 0, 8, -8, 8) 97 | 0:2/0/terrains_peering_bit/right_side = 0 98 | 0:2/0/terrains_peering_bit/bottom_side = 0 99 | 0:2/0/terrains_peering_bit/top_side = 0 100 | 1:2/0 = 0 101 | 1:2/0/terrain_set = 0 102 | 1:2/0/terrain = 0 103 | 1:2/0/probability = 0.1 104 | 1:2/0/terrains_peering_bit/right_side = 0 105 | 1:2/0/terrains_peering_bit/bottom_side = 0 106 | 1:2/0/terrains_peering_bit/left_side = 0 107 | 1:2/0/terrains_peering_bit/top_side = 0 108 | 2:2/0 = 0 109 | 2:2/0/terrain_set = 0 110 | 2:2/0/terrain = 0 111 | 2:2/0/probability = 0.1 112 | 2:2/0/terrains_peering_bit/right_side = 0 113 | 2:2/0/terrains_peering_bit/bottom_side = 0 114 | 2:2/0/terrains_peering_bit/left_side = 0 115 | 2:2/0/terrains_peering_bit/top_side = 0 116 | 3:2/0 = 0 117 | 4:2/0 = 0 118 | 5:2/0 = 0 119 | 6:2/0 = 0 120 | 6:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(8, 8, 0, 8, 0, -8, 8, -8) 121 | 7:2/0 = 0 122 | 8:2/0 = 0 123 | 9:2/0 = 0 124 | 10:2/0 = 0 125 | 11:2/0 = 0 126 | 12:2/0 = 0 127 | 13:2/0 = 0 128 | 0:3/0 = 0 129 | 0:3/0/terrain_set = 0 130 | 0:3/0/terrain = 0 131 | 0:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 0, -8, 0, 8, -8, 8) 132 | 0:3/0/terrains_peering_bit/right_side = 0 133 | 0:3/0/terrains_peering_bit/bottom_side = 0 134 | 0:3/0/terrains_peering_bit/top_side = 0 135 | 1:3/0 = 0 136 | 1:3/0/terrain_set = 0 137 | 1:3/0/terrain = 0 138 | 1:3/0/probability = 0.1 139 | 1:3/0/terrains_peering_bit/right_side = 0 140 | 1:3/0/terrains_peering_bit/bottom_side = 0 141 | 1:3/0/terrains_peering_bit/left_side = 0 142 | 1:3/0/terrains_peering_bit/top_side = 0 143 | 2:3/0 = 0 144 | 3:3/0 = 0 145 | 3:3/0/terrain_set = 0 146 | 3:3/0/terrain = 0 147 | 3:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(8, 8, 0, 8, 0, -8, 8, -8) 148 | 3:3/0/terrains_peering_bit/bottom_side = 0 149 | 3:3/0/terrains_peering_bit/left_side = 0 150 | 3:3/0/terrains_peering_bit/top_side = 0 151 | 4:3/0 = 0 152 | 4:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 153 | 5:3/0 = 0 154 | 5:3/0/terrain_set = 0 155 | 6:3/0 = 0 156 | 7:3/0 = 0 157 | 8:3/0 = 0 158 | 9:3/0 = 0 159 | 10:3/0 = 0 160 | 11:3/0 = 0 161 | 12:3/0 = 0 162 | 13:3/0 = 0 163 | 0:4/0 = 0 164 | 0:4/0/terrain_set = 0 165 | 0:4/0/terrain = 0 166 | 0:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 167 | 0:4/0/terrains_peering_bit/right_side = 0 168 | 0:4/0/terrains_peering_bit/top_side = 0 169 | 1:4/0 = 0 170 | 1:4/0/terrain_set = 0 171 | 1:4/0/terrain = 0 172 | 1:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 173 | 1:4/0/terrains_peering_bit/right_side = 0 174 | 1:4/0/terrains_peering_bit/left_side = 0 175 | 1:4/0/terrains_peering_bit/top_side = 0 176 | 2:4/0 = 0 177 | 2:4/0/terrain_set = 0 178 | 2:4/0/terrain = 0 179 | 2:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 180 | 2:4/0/terrains_peering_bit/right_side = 0 181 | 2:4/0/terrains_peering_bit/left_side = 0 182 | 2:4/0/terrains_peering_bit/top_side = 0 183 | 3:4/0 = 0 184 | 3:4/0/terrain_set = 0 185 | 3:4/0/terrain = 0 186 | 3:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 187 | 3:4/0/terrains_peering_bit/left_side = 0 188 | 3:4/0/terrains_peering_bit/top_side = 0 189 | 4:4/0 = 0 190 | 4:4/0/terrain_set = 0 191 | 4:4/0/terrain = 0 192 | 4:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 193 | 4:4/0/terrains_peering_bit/right_side = 0 194 | 4:4/0/terrains_peering_bit/left_side = 0 195 | 4:4/0/terrains_peering_bit/top_side = 0 196 | 5:4/0 = 0 197 | 5:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 198 | 6:4/0 = 0 199 | 6:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 200 | 7:4/0 = 0 201 | 8:4/0 = 0 202 | 9:4/0 = 0 203 | 10:4/0 = 0 204 | 11:4/0 = 0 205 | 12:4/0 = 0 206 | 13:4/0 = 0 207 | 208 | [resource] 209 | physics_layer_0/collision_layer = 128 210 | physics_layer_0/collision_mask = 0 211 | terrain_set_0/mode = 2 212 | terrain_set_0/terrain_0/name = "Ground Tiles" 213 | terrain_set_0/terrain_0/color = Color(0.380392, 0.556863, 0.988235, 1) 214 | sources/0 = SubResource("TileSetAtlasSource_dxfh7") 215 | -------------------------------------------------------------------------------- /Resources/Tileset/brown_tiles.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="TileSet" load_steps=3 format=3 uid="uid://c0i2yp8ep4a65"] 2 | 3 | [ext_resource type="Texture2D" uid="uid://cyr2m6q5pv84" path="res://Art/RGS_Dev/tileset_brown.png" id="1_cblhs"] 4 | 5 | [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_dxfh7"] 6 | texture = ExtResource("1_cblhs") 7 | 0:0/0 = 0 8 | 0:0/0/terrain_set = 0 9 | 0:0/0/terrain = 0 10 | 0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 11 | 0:0/0/terrains_peering_bit/right_side = 0 12 | 0:0/0/terrains_peering_bit/bottom_side = 0 13 | 1:0/0 = 0 14 | 1:0/0/terrain_set = 0 15 | 1:0/0/terrain = 0 16 | 1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 17 | 1:0/0/terrains_peering_bit/right_side = 0 18 | 1:0/0/terrains_peering_bit/bottom_side = 0 19 | 1:0/0/terrains_peering_bit/left_side = 0 20 | 2:0/0 = 0 21 | 2:0/0/terrain_set = 0 22 | 2:0/0/terrain = 0 23 | 2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 24 | 2:0/0/terrains_peering_bit/right_side = 0 25 | 2:0/0/terrains_peering_bit/bottom_side = 0 26 | 2:0/0/terrains_peering_bit/left_side = 0 27 | 3:0/0 = 0 28 | 3:0/0/terrain_set = 0 29 | 3:0/0/terrain = 0 30 | 3:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 31 | 3:0/0/terrains_peering_bit/bottom_side = 0 32 | 3:0/0/terrains_peering_bit/left_side = 0 33 | 4:0/0 = 0 34 | 4:0/0/terrain_set = 0 35 | 4:0/0/terrain = 0 36 | 4:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 37 | 4:0/0/terrains_peering_bit/right_side = 0 38 | 4:0/0/terrains_peering_bit/bottom_side = 0 39 | 4:0/0/terrains_peering_bit/left_side = 0 40 | 5:0/0 = 0 41 | 5:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 42 | 6:0/0 = 0 43 | 6:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 44 | 7:0/0 = 0 45 | 8:0/0 = 0 46 | 9:0/0 = 0 47 | 10:0/0 = 0 48 | 11:0/0 = 0 49 | 12:0/0 = 0 50 | 13:0/0 = 0 51 | 14:0/0 = 0 52 | 15:0/0 = 0 53 | 0:1/0 = 0 54 | 0:1/0/terrain_set = 0 55 | 0:1/0/terrain = 0 56 | 0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 0, -8, 0, 8, -8, 8) 57 | 0:1/0/terrains_peering_bit/right_side = 0 58 | 0:1/0/terrains_peering_bit/bottom_side = 0 59 | 0:1/0/terrains_peering_bit/top_side = 0 60 | 1:1/0 = 0 61 | 1:1/0/terrain_set = 0 62 | 1:1/0/terrain = 0 63 | 1:1/0/terrains_peering_bit/right_side = 0 64 | 1:1/0/terrains_peering_bit/bottom_side = 0 65 | 1:1/0/terrains_peering_bit/left_side = 0 66 | 1:1/0/terrains_peering_bit/top_side = 0 67 | 2:1/0 = 0 68 | 2:1/0/terrain_set = 0 69 | 2:1/0/terrain = 0 70 | 2:1/0/probability = 0.1 71 | 2:1/0/terrains_peering_bit/right_side = 0 72 | 2:1/0/terrains_peering_bit/bottom_side = 0 73 | 2:1/0/terrains_peering_bit/left_side = 0 74 | 2:1/0/terrains_peering_bit/top_side = 0 75 | 3:1/0 = 0 76 | 3:1/0/terrain_set = 0 77 | 4:1/0 = 0 78 | 4:1/0/terrain_set = 0 79 | 4:1/0/terrain = 0 80 | 4:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 81 | 4:1/0/terrains_peering_bit/right_side = 0 82 | 4:1/0/terrains_peering_bit/bottom_side = 0 83 | 4:1/0/terrains_peering_bit/left_side = 0 84 | 5:1/0 = 0 85 | 6:1/0 = 0 86 | 7:1/0 = 0 87 | 8:1/0 = 0 88 | 9:1/0 = 0 89 | 10:1/0 = 0 90 | 11:1/0 = 0 91 | 12:1/0 = 0 92 | 13:1/0 = 0 93 | 0:2/0 = 0 94 | 0:2/0/terrain_set = 0 95 | 0:2/0/terrain = 0 96 | 0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 0, -8, 0, 8, -8, 8) 97 | 0:2/0/terrains_peering_bit/right_side = 0 98 | 0:2/0/terrains_peering_bit/bottom_side = 0 99 | 0:2/0/terrains_peering_bit/top_side = 0 100 | 1:2/0 = 0 101 | 1:2/0/terrain_set = 0 102 | 1:2/0/terrain = 0 103 | 1:2/0/probability = 0.1 104 | 1:2/0/terrains_peering_bit/right_side = 0 105 | 1:2/0/terrains_peering_bit/bottom_side = 0 106 | 1:2/0/terrains_peering_bit/left_side = 0 107 | 1:2/0/terrains_peering_bit/top_side = 0 108 | 2:2/0 = 0 109 | 2:2/0/terrain_set = 0 110 | 2:2/0/terrain = 0 111 | 2:2/0/probability = 0.1 112 | 2:2/0/terrains_peering_bit/right_side = 0 113 | 2:2/0/terrains_peering_bit/bottom_side = 0 114 | 2:2/0/terrains_peering_bit/left_side = 0 115 | 2:2/0/terrains_peering_bit/top_side = 0 116 | 3:2/0 = 0 117 | 4:2/0 = 0 118 | 5:2/0 = 0 119 | 6:2/0 = 0 120 | 6:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(8, 8, 0, 8, 0, -8, 8, -8) 121 | 7:2/0 = 0 122 | 8:2/0 = 0 123 | 9:2/0 = 0 124 | 10:2/0 = 0 125 | 11:2/0 = 0 126 | 12:2/0 = 0 127 | 13:2/0 = 0 128 | 0:3/0 = 0 129 | 0:3/0/terrain_set = 0 130 | 0:3/0/terrain = 0 131 | 0:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 0, -8, 0, 8, -8, 8) 132 | 0:3/0/terrains_peering_bit/right_side = 0 133 | 0:3/0/terrains_peering_bit/bottom_side = 0 134 | 0:3/0/terrains_peering_bit/top_side = 0 135 | 1:3/0 = 0 136 | 1:3/0/terrain_set = 0 137 | 1:3/0/terrain = 0 138 | 1:3/0/probability = 0.1 139 | 1:3/0/terrains_peering_bit/right_side = 0 140 | 1:3/0/terrains_peering_bit/bottom_side = 0 141 | 1:3/0/terrains_peering_bit/left_side = 0 142 | 1:3/0/terrains_peering_bit/top_side = 0 143 | 2:3/0 = 0 144 | 3:3/0 = 0 145 | 3:3/0/terrain_set = 0 146 | 3:3/0/terrain = 0 147 | 3:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(8, 8, 0, 8, 0, -8, 8, -8) 148 | 3:3/0/terrains_peering_bit/bottom_side = 0 149 | 3:3/0/terrains_peering_bit/left_side = 0 150 | 3:3/0/terrains_peering_bit/top_side = 0 151 | 4:3/0 = 0 152 | 4:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 153 | 5:3/0 = 0 154 | 5:3/0/terrain_set = 0 155 | 6:3/0 = 0 156 | 7:3/0 = 0 157 | 8:3/0 = 0 158 | 9:3/0 = 0 159 | 10:3/0 = 0 160 | 11:3/0 = 0 161 | 12:3/0 = 0 162 | 13:3/0 = 0 163 | 0:4/0 = 0 164 | 0:4/0/terrain_set = 0 165 | 0:4/0/terrain = 0 166 | 0:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 167 | 0:4/0/terrains_peering_bit/right_side = 0 168 | 0:4/0/terrains_peering_bit/top_side = 0 169 | 1:4/0 = 0 170 | 1:4/0/terrain_set = 0 171 | 1:4/0/terrain = 0 172 | 1:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 173 | 1:4/0/terrains_peering_bit/right_side = 0 174 | 1:4/0/terrains_peering_bit/left_side = 0 175 | 1:4/0/terrains_peering_bit/top_side = 0 176 | 2:4/0 = 0 177 | 2:4/0/terrain_set = 0 178 | 2:4/0/terrain = 0 179 | 2:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 180 | 2:4/0/terrains_peering_bit/right_side = 0 181 | 2:4/0/terrains_peering_bit/left_side = 0 182 | 2:4/0/terrains_peering_bit/top_side = 0 183 | 3:4/0 = 0 184 | 3:4/0/terrain_set = 0 185 | 3:4/0/terrain = 0 186 | 3:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 187 | 3:4/0/terrains_peering_bit/left_side = 0 188 | 3:4/0/terrains_peering_bit/top_side = 0 189 | 4:4/0 = 0 190 | 4:4/0/terrain_set = 0 191 | 4:4/0/terrain = 0 192 | 4:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 193 | 4:4/0/terrains_peering_bit/right_side = 0 194 | 4:4/0/terrains_peering_bit/left_side = 0 195 | 4:4/0/terrains_peering_bit/top_side = 0 196 | 5:4/0 = 0 197 | 5:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 198 | 6:4/0 = 0 199 | 6:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, 8, 8, 8, 8, -8) 200 | 7:4/0 = 0 201 | 8:4/0 = 0 202 | 9:4/0 = 0 203 | 10:4/0 = 0 204 | 11:4/0 = 0 205 | 12:4/0 = 0 206 | 13:4/0 = 0 207 | 208 | [resource] 209 | physics_layer_0/collision_layer = 128 210 | physics_layer_0/collision_mask = 0 211 | terrain_set_0/mode = 2 212 | terrain_set_0/terrain_0/name = "Ground Tiles" 213 | terrain_set_0/terrain_0/color = Color(0.380392, 0.556863, 0.988235, 1) 214 | sources/0 = SubResource("TileSetAtlasSource_dxfh7") 215 | -------------------------------------------------------------------------------- /Resources/WeaponStats/big_shot.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="WeaponStats" load_steps=2 format=3 uid="uid://di8qxum2o13ku"] 2 | 3 | [ext_resource type="Script" path="res://Util/Classes/weapon_stats.gd" id="1_qwq6q"] 4 | 5 | [resource] 6 | script = ExtResource("1_qwq6q") 7 | firing_cooldown = 1.5 8 | speed = 350.0 9 | damage = 25.0 10 | max_pierce = 5 11 | knockback_force = 1.0 12 | -------------------------------------------------------------------------------- /Resources/WeaponStats/machine_gun.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="WeaponStats" load_steps=2 format=3 uid="uid://cve0rukfuwve0"] 2 | 3 | [ext_resource type="Script" path="res://Util/Classes/weapon_stats.gd" id="1_yhiu8"] 4 | 5 | [resource] 6 | script = ExtResource("1_yhiu8") 7 | firing_cooldown = 0.05 8 | speed = 200.0 9 | damage = 5.0 10 | max_pierce = 1 11 | knockback_force = 1.0 12 | -------------------------------------------------------------------------------- /Resources/camera_noise.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="FastNoiseLite" format=3 uid="uid://c0ipas8frhirg"] 2 | 3 | [resource] 4 | seed = 1 5 | frequency = 0.3 6 | metadata/_preview_in_3d_space_ = true 7 | -------------------------------------------------------------------------------- /Sound/hitHurt.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/Sound/hitHurt.wav -------------------------------------------------------------------------------- /Sound/hitHurt.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamWAV" 5 | uid="uid://1vyhslc772x6" 6 | path="res://.godot/imported/hitHurt.wav-8e0d84465dcf45b46a3a9ee3e5428e81.sample" 7 | 8 | [deps] 9 | 10 | source_file="res://Sound/hitHurt.wav" 11 | dest_files=["res://.godot/imported/hitHurt.wav-8e0d84465dcf45b46a3a9ee3e5428e81.sample"] 12 | 13 | [params] 14 | 15 | force/8_bit=false 16 | force/mono=false 17 | force/max_rate=false 18 | force/max_rate_hz=44100 19 | edit/trim=false 20 | edit/normalize=false 21 | edit/loop_mode=0 22 | edit/loop_begin=0 23 | edit/loop_end=-1 24 | compress/mode=0 25 | -------------------------------------------------------------------------------- /UI/Font/Silkscreen-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/UI/Font/Silkscreen-Bold.ttf -------------------------------------------------------------------------------- /UI/Font/Silkscreen-Bold.ttf.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="font_data_dynamic" 4 | type="FontFile" 5 | uid="uid://bqwsa1p5dxurc" 6 | path="res://.godot/imported/Silkscreen-Bold.ttf-c6ba5cfcbb481782da349956476843f7.fontdata" 7 | 8 | [deps] 9 | 10 | source_file="res://UI/Font/Silkscreen-Bold.ttf" 11 | dest_files=["res://.godot/imported/Silkscreen-Bold.ttf-c6ba5cfcbb481782da349956476843f7.fontdata"] 12 | 13 | [params] 14 | 15 | Rendering=null 16 | antialiasing=1 17 | generate_mipmaps=false 18 | disable_embedded_bitmaps=true 19 | multichannel_signed_distance_field=false 20 | msdf_pixel_range=8 21 | msdf_size=48 22 | allow_system_fallback=true 23 | force_autohinter=false 24 | hinting=1 25 | subpixel_positioning=1 26 | oversampling=0.0 27 | Fallbacks=null 28 | fallbacks=[] 29 | Compress=null 30 | compress=true 31 | preload=[] 32 | language_support={} 33 | script_support={} 34 | opentype_features={} 35 | -------------------------------------------------------------------------------- /UI/Font/Silkscreen-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bitlytic/Resources-GDScript/47525a2e3d432f0f7c53c5de5654326c080b9a53/UI/Font/Silkscreen-Regular.ttf -------------------------------------------------------------------------------- /UI/Font/Silkscreen-Regular.ttf.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="font_data_dynamic" 4 | type="FontFile" 5 | uid="uid://b8pyg1ebld7au" 6 | path="res://.godot/imported/Silkscreen-Regular.ttf-bc5ac480535691be4653f690f823513e.fontdata" 7 | 8 | [deps] 9 | 10 | source_file="res://UI/Font/Silkscreen-Regular.ttf" 11 | dest_files=["res://.godot/imported/Silkscreen-Regular.ttf-bc5ac480535691be4653f690f823513e.fontdata"] 12 | 13 | [params] 14 | 15 | Rendering=null 16 | antialiasing=1 17 | generate_mipmaps=false 18 | disable_embedded_bitmaps=true 19 | multichannel_signed_distance_field=true 20 | msdf_pixel_range=8 21 | msdf_size=48 22 | allow_system_fallback=true 23 | force_autohinter=false 24 | hinting=1 25 | subpixel_positioning=1 26 | oversampling=0.0 27 | Fallbacks=null 28 | fallbacks=[] 29 | Compress=null 30 | compress=true 31 | preload=[] 32 | language_support={} 33 | script_support={} 34 | opentype_features={} 35 | -------------------------------------------------------------------------------- /UI/Scenes/craft_button.gd: -------------------------------------------------------------------------------- 1 | extends Button 2 | 3 | @onready var label: Label = $Label 4 | 5 | func set_craftable(d) -> void: 6 | disabled = !d 7 | 8 | var text_color := Color.WHITE 9 | 10 | if disabled: 11 | text_color = Color.RED 12 | 13 | label.add_theme_color_override("font_color", text_color) 14 | -------------------------------------------------------------------------------- /UI/Scenes/crafting_menu.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | 3 | 4 | @onready var ingredient_container: VBoxContainer = $PanelContainer/VBoxContainer/Ingredients/ScrollContainer/IngredientContainer 5 | @onready var recipe_container: HBoxContainer = $PanelContainer/VBoxContainer/Recipes/ScrollContainer/RecipeContainer 6 | @onready var output_container: MarginContainer = $PanelContainer/VBoxContainer/Output 7 | @onready var craft_button: Button = $PanelContainer/VBoxContainer/CraftContainer/CraftButton 8 | @onready var animation_player: AnimationPlayer = $AnimationPlayer 9 | @onready var input_label: Label = $PanelContainer/VBoxContainer/InputLabel 10 | @onready var output_label: Label = $PanelContainer/VBoxContainer/OutputLabel 11 | 12 | var ingredient_scene : PackedScene = preload("res://UI/Scenes/ingredient.tscn") 13 | 14 | var selected_recipe : CraftingRecipe 15 | 16 | var recipe_button_scene : PackedScene = preload("res://UI/Scenes/recipe_button.tscn") 17 | 18 | @onready var player : Player = get_tree().get_first_node_in_group("player") 19 | 20 | var crafting := false 21 | 22 | func _ready(): 23 | visibility_changed.connect(on_visibility_changed) 24 | 25 | for c in recipe_container.get_children(): 26 | c.queue_free() 27 | 28 | for r in CraftingRegistry.recipes: 29 | var spawned : RecipeButton = recipe_button_scene.instantiate() 30 | spawned.crafting_recipe = r 31 | spawned.selected.connect(on_recipe_selected) 32 | recipe_container.add_child(spawned) 33 | 34 | player.inventory.updated.connect(on_inventory_updated) 35 | 36 | 37 | func show_recipe(recipe: CraftingRecipe) -> void: 38 | selected_recipe = recipe 39 | 40 | input_label.show() 41 | output_label.show() 42 | 43 | for c in ingredient_container.get_children(): 44 | c.queue_free() 45 | 46 | for ingredient in recipe.ingredients: 47 | var spawned := ingredient_scene.instantiate() 48 | spawned.crafting_ingredient = ingredient 49 | 50 | ingredient_container.add_child(spawned) 51 | 52 | for c in output_container.get_children(): 53 | c.queue_free() 54 | 55 | var spawned := ingredient_scene.instantiate() 56 | spawned.crafting_ingredient = recipe.output 57 | 58 | output_container.add_child(spawned) 59 | 60 | craft_button.set_craftable(recipe.can_craft(player.inventory)) 61 | 62 | 63 | func on_visibility_changed() -> void: 64 | if !visible: 65 | clean_up() 66 | 67 | 68 | func clean_up() -> void: 69 | selected_recipe = null 70 | 71 | input_label.hide() 72 | output_label.hide() 73 | 74 | for c in ingredient_container.get_children(): 75 | c.queue_free() 76 | 77 | for c in output_container.get_children(): 78 | c.queue_free() 79 | 80 | craft_button.set_craftable(false) 81 | 82 | 83 | func on_recipe_selected(recipe: CraftingRecipe) -> void: 84 | show_recipe(recipe) 85 | 86 | 87 | func _on_craft_button_pressed() -> void: 88 | if !selected_recipe || !selected_recipe.can_craft(player.inventory): 89 | return 90 | 91 | selected_recipe.craft(player.inventory) 92 | 93 | 94 | func on_inventory_updated() -> void: 95 | if !selected_recipe: 96 | craft_button.set_craftable(false) 97 | return 98 | 99 | craft_button.set_craftable(selected_recipe.can_craft(player.inventory)) 100 | 101 | 102 | func show_crafting() -> void: 103 | crafting = true 104 | animation_player.play("show", -1, 1, false) 105 | 106 | 107 | func hide_crafting() -> void: 108 | crafting = false 109 | animation_player.play("show", -1, -1, true) 110 | -------------------------------------------------------------------------------- /UI/Scenes/crafting_menu.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=20 format=3 uid="uid://drlfovyb0gbep"] 2 | 3 | [ext_resource type="Theme" uid="uid://d1eibj6u66lma" path="res://UI/Theme/main_theme.tres" id="1_lq2wk"] 4 | [ext_resource type="Script" path="res://UI/Scenes/crafting_menu.gd" id="2_nrqbd"] 5 | [ext_resource type="Texture2D" uid="uid://c5xonqa2480cc" path="res://Art/Kenney/ui_packed.png" id="3_si50r"] 6 | [ext_resource type="PackedScene" uid="uid://dim3jrs64lx8s" path="res://UI/Scenes/ingredient.tscn" id="4_0oedh"] 7 | [ext_resource type="PackedScene" uid="uid://dv8thk8b64oa6" path="res://UI/Scenes/recipe_button.tscn" id="4_6om1k"] 8 | [ext_resource type="Script" path="res://UI/Scenes/craft_button.gd" id="6_2uunc"] 9 | 10 | [sub_resource type="Animation" id="Animation_f54tb"] 11 | length = 0.001 12 | tracks/0/type = "value" 13 | tracks/0/imported = false 14 | tracks/0/enabled = true 15 | tracks/0/path = NodePath("PanelContainer:position") 16 | tracks/0/interp = 1 17 | tracks/0/loop_wrap = true 18 | tracks/0/keys = { 19 | "times": PackedFloat32Array(0), 20 | "transitions": PackedFloat32Array(1), 21 | "update": 0, 22 | "values": [Vector2(1327, 120)] 23 | } 24 | tracks/1/type = "value" 25 | tracks/1/imported = false 26 | tracks/1/enabled = true 27 | tracks/1/path = NodePath("PanelContainer:modulate") 28 | tracks/1/interp = 1 29 | tracks/1/loop_wrap = true 30 | tracks/1/keys = { 31 | "times": PackedFloat32Array(0), 32 | "transitions": PackedFloat32Array(1), 33 | "update": 0, 34 | "values": [Color(1, 1, 1, 1)] 35 | } 36 | tracks/2/type = "value" 37 | tracks/2/imported = false 38 | tracks/2/enabled = true 39 | tracks/2/path = NodePath(".:visible") 40 | tracks/2/interp = 1 41 | tracks/2/loop_wrap = true 42 | tracks/2/keys = { 43 | "times": PackedFloat32Array(0), 44 | "transitions": PackedFloat32Array(1), 45 | "update": 1, 46 | "values": [true] 47 | } 48 | 49 | [sub_resource type="Animation" id="Animation_8ey04"] 50 | resource_name = "hide" 51 | tracks/0/type = "value" 52 | tracks/0/imported = false 53 | tracks/0/enabled = true 54 | tracks/0/path = NodePath("PanelContainer:position") 55 | tracks/0/interp = 1 56 | tracks/0/loop_wrap = true 57 | tracks/0/keys = { 58 | "times": PackedFloat32Array(0, 0.433333), 59 | "transitions": PackedFloat32Array(0.5, 1), 60 | "update": 0, 61 | "values": [Vector2(1298, 120), Vector2(832, 120)] 62 | } 63 | tracks/1/type = "value" 64 | tracks/1/imported = false 65 | tracks/1/enabled = true 66 | tracks/1/path = NodePath("PanelContainer:modulate") 67 | tracks/1/interp = 1 68 | tracks/1/loop_wrap = true 69 | tracks/1/keys = { 70 | "times": PackedFloat32Array(0, 0.433333), 71 | "transitions": PackedFloat32Array(1, 1), 72 | "update": 0, 73 | "values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)] 74 | } 75 | 76 | [sub_resource type="Animation" id="Animation_mwbu7"] 77 | resource_name = "show" 78 | length = 0.5 79 | tracks/0/type = "value" 80 | tracks/0/imported = false 81 | tracks/0/enabled = true 82 | tracks/0/path = NodePath("PanelContainer:position") 83 | tracks/0/interp = 1 84 | tracks/0/loop_wrap = true 85 | tracks/0/keys = { 86 | "times": PackedFloat32Array(0.0333333, 0.433333), 87 | "transitions": PackedFloat32Array(0.5, 1), 88 | "update": 0, 89 | "values": [Vector2(1298, 120), Vector2(832, 120)] 90 | } 91 | tracks/1/type = "value" 92 | tracks/1/imported = false 93 | tracks/1/enabled = true 94 | tracks/1/path = NodePath("PanelContainer:modulate") 95 | tracks/1/interp = 1 96 | tracks/1/loop_wrap = true 97 | tracks/1/keys = { 98 | "times": PackedFloat32Array(0.0333333, 0.433333), 99 | "transitions": PackedFloat32Array(1, 1), 100 | "update": 0, 101 | "values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)] 102 | } 103 | tracks/2/type = "value" 104 | tracks/2/imported = false 105 | tracks/2/enabled = true 106 | tracks/2/path = NodePath(".:visible") 107 | tracks/2/interp = 1 108 | tracks/2/loop_wrap = true 109 | tracks/2/keys = { 110 | "times": PackedFloat32Array(0, 0.0333333), 111 | "transitions": PackedFloat32Array(1, 1), 112 | "update": 1, 113 | "values": [false, true] 114 | } 115 | 116 | [sub_resource type="AnimationLibrary" id="AnimationLibrary_b4vsw"] 117 | _data = { 118 | "RESET": SubResource("Animation_f54tb"), 119 | "hide": SubResource("Animation_8ey04"), 120 | "show": SubResource("Animation_mwbu7") 121 | } 122 | 123 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8l3y2"] 124 | bg_color = Color(0.0962047, 0.0962048, 0.0962047, 1) 125 | 126 | [sub_resource type="AtlasTexture" id="AtlasTexture_8tt36"] 127 | atlas = ExtResource("3_si50r") 128 | region = Rect2(256, 0, 32, 32) 129 | 130 | [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_n0rib"] 131 | 132 | [sub_resource type="StyleBoxLine" id="StyleBoxLine_ffy6f"] 133 | color = Color(0.392157, 0.462745, 0.521569, 1) 134 | grow_begin = -3.0 135 | grow_end = -3.0 136 | 137 | [sub_resource type="StyleBoxLine" id="StyleBoxLine_5rgka"] 138 | color = Color(0.466667, 0.552941, 0.623529, 1) 139 | grow_begin = -3.0 140 | grow_end = -3.0 141 | thickness = 3 142 | 143 | [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_f5f4s"] 144 | 145 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_l1id6"] 146 | bg_color = Color(1, 1, 1, 0.117647) 147 | 148 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_fkuyj"] 149 | bg_color = Color(0, 0, 0, 0.286275) 150 | 151 | [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_nld3j"] 152 | 153 | [node name="CraftingMenu" type="Control"] 154 | layout_mode = 3 155 | anchors_preset = 15 156 | anchor_right = 1.0 157 | anchor_bottom = 1.0 158 | grow_horizontal = 2 159 | grow_vertical = 2 160 | mouse_filter = 2 161 | theme = ExtResource("1_lq2wk") 162 | script = ExtResource("2_nrqbd") 163 | 164 | [node name="AnimationPlayer" type="AnimationPlayer" parent="."] 165 | libraries = { 166 | "": SubResource("AnimationLibrary_b4vsw") 167 | } 168 | 169 | [node name="PanelContainer" type="PanelContainer" parent="."] 170 | layout_mode = 0 171 | offset_left = 1327.0 172 | offset_top = 120.0 173 | offset_right = 1711.0 174 | offset_bottom = 600.0 175 | mouse_filter = 2 176 | theme_override_styles/panel = SubResource("StyleBoxFlat_8l3y2") 177 | 178 | [node name="Panel" type="NinePatchRect" parent="PanelContainer"] 179 | layout_mode = 2 180 | texture = SubResource("AtlasTexture_8tt36") 181 | patch_margin_left = 5 182 | patch_margin_top = 5 183 | patch_margin_right = 5 184 | patch_margin_bottom = 5 185 | axis_stretch_horizontal = 1 186 | axis_stretch_vertical = 1 187 | 188 | [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] 189 | layout_mode = 2 190 | mouse_filter = 2 191 | theme_override_constants/separation = 1 192 | 193 | [node name="Label3" type="Label" parent="PanelContainer/VBoxContainer"] 194 | custom_minimum_size = Vector2(0, 32) 195 | layout_mode = 2 196 | text = " Recipes" 197 | vertical_alignment = 1 198 | 199 | [node name="Recipes" type="MarginContainer" parent="PanelContainer/VBoxContainer"] 200 | layout_mode = 2 201 | size_flags_vertical = 3 202 | mouse_filter = 2 203 | theme_override_constants/margin_left = 24 204 | theme_override_constants/margin_top = 4 205 | theme_override_constants/margin_right = 24 206 | theme_override_constants/margin_bottom = 4 207 | 208 | [node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/VBoxContainer/Recipes"] 209 | layout_mode = 2 210 | theme_override_styles/panel = SubResource("StyleBoxEmpty_n0rib") 211 | 212 | [node name="RecipeContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/Recipes/ScrollContainer"] 213 | layout_mode = 2 214 | size_flags_horizontal = 3 215 | 216 | [node name="RecipeButton" parent="PanelContainer/VBoxContainer/Recipes/ScrollContainer/RecipeContainer" instance=ExtResource("4_6om1k")] 217 | layout_mode = 2 218 | 219 | [node name="InputLabel" type="Label" parent="PanelContainer/VBoxContainer"] 220 | layout_mode = 2 221 | text = " Input:" 222 | 223 | [node name="Ingredients" type="MarginContainer" parent="PanelContainer/VBoxContainer"] 224 | layout_mode = 2 225 | size_flags_vertical = 3 226 | mouse_filter = 2 227 | theme_override_constants/margin_left = 24 228 | theme_override_constants/margin_top = 4 229 | theme_override_constants/margin_right = 24 230 | theme_override_constants/margin_bottom = 4 231 | 232 | [node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/VBoxContainer/Ingredients"] 233 | layout_mode = 2 234 | theme_override_styles/panel = SubResource("StyleBoxEmpty_n0rib") 235 | 236 | [node name="IngredientContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/Ingredients/ScrollContainer"] 237 | layout_mode = 2 238 | size_flags_horizontal = 3 239 | 240 | [node name="Ingredient" parent="PanelContainer/VBoxContainer/Ingredients/ScrollContainer/IngredientContainer" instance=ExtResource("4_0oedh")] 241 | layout_mode = 2 242 | size_flags_horizontal = 1 243 | 244 | [node name="OutputLabel" type="Label" parent="PanelContainer/VBoxContainer"] 245 | layout_mode = 2 246 | text = " Output:" 247 | 248 | [node name="Output" type="MarginContainer" parent="PanelContainer/VBoxContainer"] 249 | layout_mode = 2 250 | mouse_filter = 2 251 | theme_override_constants/margin_left = 24 252 | theme_override_constants/margin_top = 4 253 | theme_override_constants/margin_right = 24 254 | theme_override_constants/margin_bottom = 4 255 | 256 | [node name="OutputItem" parent="PanelContainer/VBoxContainer/Output" instance=ExtResource("4_0oedh")] 257 | custom_minimum_size = Vector2(0, 48) 258 | layout_mode = 2 259 | size_flags_horizontal = 1 260 | 261 | [node name="HSeparator3" type="HSeparator" parent="PanelContainer/VBoxContainer"] 262 | layout_mode = 2 263 | mouse_filter = 2 264 | theme_override_constants/separation = 1 265 | theme_override_styles/separator = SubResource("StyleBoxLine_ffy6f") 266 | 267 | [node name="HSeparator" type="HSeparator" parent="PanelContainer/VBoxContainer"] 268 | layout_mode = 2 269 | mouse_filter = 2 270 | theme_override_constants/separation = 1 271 | theme_override_styles/separator = SubResource("StyleBoxLine_5rgka") 272 | 273 | [node name="HSeparator2" type="HSeparator" parent="PanelContainer/VBoxContainer"] 274 | layout_mode = 2 275 | mouse_filter = 2 276 | theme_override_constants/separation = -1 277 | theme_override_styles/separator = SubResource("StyleBoxLine_ffy6f") 278 | 279 | [node name="CraftContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer"] 280 | custom_minimum_size = Vector2(0, 48) 281 | layout_mode = 2 282 | mouse_filter = 2 283 | theme_override_constants/margin_left = 6 284 | theme_override_constants/margin_top = 0 285 | theme_override_constants/margin_right = 6 286 | theme_override_constants/margin_bottom = 6 287 | 288 | [node name="CraftButton" type="Button" parent="PanelContainer/VBoxContainer/CraftContainer"] 289 | layout_mode = 2 290 | focus_mode = 0 291 | mouse_filter = 1 292 | theme = ExtResource("1_lq2wk") 293 | theme_override_colors/font_disabled_color = Color(0.835718, 3.22476e-06, 7.70092e-07, 1) 294 | theme_override_font_sizes/font_size = 32 295 | theme_override_styles/disabled = SubResource("StyleBoxEmpty_f5f4s") 296 | theme_override_styles/hover = SubResource("StyleBoxFlat_l1id6") 297 | theme_override_styles/pressed = SubResource("StyleBoxFlat_fkuyj") 298 | theme_override_styles/normal = SubResource("StyleBoxEmpty_nld3j") 299 | script = ExtResource("6_2uunc") 300 | 301 | [node name="Label" type="Label" parent="PanelContainer/VBoxContainer/CraftContainer/CraftButton"] 302 | layout_mode = 1 303 | anchors_preset = 15 304 | anchor_right = 1.0 305 | anchor_bottom = 1.0 306 | grow_horizontal = 2 307 | grow_vertical = 2 308 | theme_override_font_sizes/font_size = 32 309 | text = "CRAFT" 310 | horizontal_alignment = 1 311 | vertical_alignment = 1 312 | 313 | [connection signal="pressed" from="PanelContainer/VBoxContainer/CraftContainer/CraftButton" to="." method="_on_craft_button_pressed"] 314 | -------------------------------------------------------------------------------- /UI/Scenes/ingredient.gd: -------------------------------------------------------------------------------- 1 | extends HBoxContainer 2 | 3 | var crafting_ingredient : CraftingIngredient 4 | 5 | @onready var texture: TextureRect = $Texture 6 | @onready var label: Label = $Label 7 | 8 | 9 | func _ready() -> void: 10 | if !crafting_ingredient: 11 | queue_free() 12 | return 13 | 14 | var item : Item = crafting_ingredient.item 15 | 16 | texture.texture = item.sprite 17 | 18 | label.text = "%s x %d" % [item.item_name, crafting_ingredient.count] 19 | -------------------------------------------------------------------------------- /UI/Scenes/ingredient.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=3 uid="uid://dim3jrs64lx8s"] 2 | 3 | [ext_resource type="Texture2D" uid="uid://dnfmimtdyt0r0" path="res://Art/Kenney/1_bit_pack.png" id="1_7vsxu"] 4 | [ext_resource type="Script" path="res://UI/Scenes/ingredient.gd" id="1_w8xpa"] 5 | 6 | [sub_resource type="AtlasTexture" id="AtlasTexture_m36yp"] 7 | atlas = ExtResource("1_7vsxu") 8 | region = Rect2(560, 128, 16, 16) 9 | 10 | [node name="Ingredient" type="HBoxContainer"] 11 | size_flags_horizontal = 3 12 | mouse_filter = 2 13 | script = ExtResource("1_w8xpa") 14 | 15 | [node name="Texture" type="TextureRect" parent="."] 16 | custom_minimum_size = Vector2(48, 48) 17 | layout_mode = 2 18 | mouse_filter = 2 19 | texture = SubResource("AtlasTexture_m36yp") 20 | 21 | [node name="Label" type="Label" parent="."] 22 | layout_mode = 2 23 | text = "x12" 24 | -------------------------------------------------------------------------------- /UI/Scenes/item_slot.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=8 format=3 uid="uid://xieyefjkh2a1"] 2 | 3 | [ext_resource type="Script" path="res://UI/Scripts/item_slot.gd" id="1_0oiiu"] 4 | [ext_resource type="Theme" uid="uid://d1eibj6u66lma" path="res://UI/Theme/main_theme.tres" id="1_207lh"] 5 | [ext_resource type="Texture2D" uid="uid://c5xonqa2480cc" path="res://Art/Kenney/ui_packed.png" id="2_kcout"] 6 | [ext_resource type="Texture2D" uid="uid://dnfmimtdyt0r0" path="res://Art/Kenney/1_bit_pack.png" id="4_7b3ex"] 7 | 8 | [sub_resource type="AtlasTexture" id="AtlasTexture_bphbs"] 9 | atlas = ExtResource("2_kcout") 10 | region = Rect2(256, 0, 32, 32) 11 | 12 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_17sth"] 13 | bg_color = Color(0.392157, 0.462745, 0.521569, 1) 14 | 15 | [sub_resource type="AtlasTexture" id="AtlasTexture_4j0xk"] 16 | atlas = ExtResource("4_7b3ex") 17 | region = Rect2(528, 320, 16, 16) 18 | 19 | [node name="ItemSlot" type="TextureButton"] 20 | custom_minimum_size = Vector2(60, 60) 21 | offset_right = 60.0 22 | offset_bottom = 60.0 23 | size_flags_horizontal = 4 24 | size_flags_vertical = 4 25 | focus_mode = 0 26 | mouse_filter = 1 27 | theme = ExtResource("1_207lh") 28 | texture_normal = SubResource("AtlasTexture_bphbs") 29 | stretch_mode = 0 30 | script = ExtResource("1_0oiiu") 31 | 32 | [node name="Panel" type="Panel" parent="."] 33 | self_modulate = Color(1, 1, 1, 0.580392) 34 | show_behind_parent = true 35 | layout_mode = 1 36 | anchors_preset = -1 37 | anchor_right = 1.0 38 | anchor_bottom = 1.0 39 | offset_left = 2.0 40 | offset_top = 2.0 41 | offset_right = -2.0 42 | offset_bottom = -2.0 43 | grow_horizontal = 2 44 | grow_vertical = 2 45 | theme_override_styles/panel = SubResource("StyleBoxFlat_17sth") 46 | 47 | [node name="ItemSprite" type="Sprite2D" parent="."] 48 | position = Vector2(30, 30) 49 | scale = Vector2(3, 3) 50 | texture = SubResource("AtlasTexture_4j0xk") 51 | region_rect = Rect2(208, 96, 16, 16) 52 | 53 | [node name="Label" type="Label" parent="."] 54 | layout_mode = 0 55 | offset_left = 4.0 56 | offset_right = 76.0 57 | offset_bottom = 62.0 58 | scale = Vector2(0.28097, 0.28097) 59 | theme_override_colors/font_color = Color(1, 1, 1, 1) 60 | theme_override_colors/font_shadow_color = Color(0, 0, 0, 1) 61 | theme_override_constants/shadow_offset_x = 6 62 | theme_override_constants/shadow_offset_y = 6 63 | theme_override_font_sizes/font_size = 48 64 | text = "64" 65 | -------------------------------------------------------------------------------- /UI/Scenes/recipe_button.gd: -------------------------------------------------------------------------------- 1 | class_name RecipeButton 2 | extends HBoxContainer 3 | 4 | 5 | signal selected(recipe: CraftingRecipe) 6 | 7 | 8 | @onready var button: TextureButton = $Texture 9 | 10 | var crafting_recipe : CraftingRecipe 11 | 12 | 13 | func _ready() -> void: 14 | if !crafting_recipe: 15 | return 16 | 17 | button.texture_normal = crafting_recipe.output.item.sprite 18 | button.pressed.connect(on_button_pressed) 19 | 20 | 21 | func on_button_pressed(): 22 | selected.emit(crafting_recipe) 23 | -------------------------------------------------------------------------------- /UI/Scenes/recipe_button.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=3 uid="uid://dv8thk8b64oa6"] 2 | 3 | [ext_resource type="Script" path="res://UI/Scenes/recipe_button.gd" id="1_60m1t"] 4 | [ext_resource type="Texture2D" uid="uid://dnfmimtdyt0r0" path="res://Art/Kenney/1_bit_pack.png" id="1_uu1fq"] 5 | 6 | [sub_resource type="AtlasTexture" id="AtlasTexture_85xq4"] 7 | atlas = ExtResource("1_uu1fq") 8 | region = Rect2(512, 128, 16, 16) 9 | 10 | [node name="RecipeButton" type="HBoxContainer"] 11 | mouse_filter = 2 12 | script = ExtResource("1_60m1t") 13 | 14 | [node name="Texture" type="TextureButton" parent="."] 15 | custom_minimum_size = Vector2(48, 48) 16 | layout_mode = 2 17 | mouse_filter = 1 18 | texture_normal = SubResource("AtlasTexture_85xq4") 19 | stretch_mode = 0 20 | -------------------------------------------------------------------------------- /UI/Scripts/inventory_display.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | 3 | 4 | @export var slot_parent : Control 5 | 6 | var item_slots : Array[ItemSlot] = [] 7 | 8 | var _inventory : Inventory 9 | 10 | 11 | func _ready(): 12 | for child in slot_parent.get_children(): 13 | if child is ItemSlot: 14 | item_slots.append(child) 15 | 16 | 17 | func display_inventory(inventory: Inventory): 18 | if _inventory != inventory: 19 | if _inventory != null: 20 | inventory.updated.disconnect(on_inventory_update) 21 | inventory.updated.connect(on_inventory_update) 22 | _inventory = inventory 23 | on_inventory_update() 24 | 25 | 26 | func on_inventory_update(): 27 | for index in item_slots.size(): 28 | var stack : ItemStack = _inventory.items[index] 29 | item_slots[index].stack = stack 30 | -------------------------------------------------------------------------------- /UI/Scripts/item_slot.gd: -------------------------------------------------------------------------------- 1 | class_name ItemSlot 2 | extends Control 3 | 4 | @onready var sprite : Sprite2D = $ItemSprite 5 | @onready var label : Label = $Label 6 | 7 | var stack : ItemStack: 8 | set(val): 9 | stack = val 10 | sprite.texture = stack.item.sprite 11 | label.text = str(val.count) 12 | -------------------------------------------------------------------------------- /UI/Theme/main_theme.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Theme" load_steps=9 format=3 uid="uid://d1eibj6u66lma"] 2 | 3 | [ext_resource type="FontFile" uid="uid://b8pyg1ebld7au" path="res://UI/Font/Silkscreen-Regular.ttf" id="1_gjmb3"] 4 | 5 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_gevcx"] 6 | bg_color = Color(0.223529, 0.223529, 0.223529, 0.643137) 7 | 8 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_xe8r4"] 9 | bg_color = Color(0.412152, 0.412152, 0.412152, 0.529412) 10 | 11 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uvdk2"] 12 | bg_color = Color(0.352941, 0.352941, 0.352941, 0.643137) 13 | 14 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_740cv"] 15 | bg_color = Color(0.239216, 0.239216, 0.239216, 0.588235) 16 | 17 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_3sjn6"] 18 | bg_color = Color(0.847474, 0.847474, 0.847474, 1) 19 | corner_radius_top_left = 2 20 | corner_radius_top_right = 2 21 | corner_radius_bottom_right = 2 22 | corner_radius_bottom_left = 2 23 | anti_aliasing = false 24 | 25 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_jmve0"] 26 | bg_color = Color(0.581033, 0.581033, 0.581033, 1) 27 | corner_radius_top_left = 2 28 | corner_radius_top_right = 2 29 | corner_radius_bottom_right = 2 30 | corner_radius_bottom_left = 2 31 | anti_aliasing = false 32 | 33 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_t7uob"] 34 | bg_color = Color(0.920995, 0.920995, 0.920995, 1) 35 | corner_radius_top_left = 2 36 | corner_radius_top_right = 2 37 | corner_radius_bottom_right = 2 38 | corner_radius_bottom_left = 2 39 | anti_aliasing = false 40 | 41 | [resource] 42 | default_font = ExtResource("1_gjmb3") 43 | Button/styles/focus = SubResource("StyleBoxFlat_gevcx") 44 | Button/styles/hover = SubResource("StyleBoxFlat_xe8r4") 45 | Button/styles/normal = SubResource("StyleBoxFlat_uvdk2") 46 | Button/styles/pressed = SubResource("StyleBoxFlat_740cv") 47 | Label/colors/font_shadow_color = Color(0, 0, 0, 1) 48 | Label/constants/shadow_offset_x = 2 49 | Label/constants/shadow_offset_y = 2 50 | VScrollBar/styles/grabber = SubResource("StyleBoxFlat_3sjn6") 51 | VScrollBar/styles/grabber_highlight = SubResource("StyleBoxFlat_jmve0") 52 | VScrollBar/styles/grabber_pressed = SubResource("StyleBoxFlat_t7uob") 53 | -------------------------------------------------------------------------------- /UI/item_bar.gd: -------------------------------------------------------------------------------- 1 | @tool 2 | extends HBoxContainer 3 | 4 | @export var refresh : bool 5 | 6 | 7 | func _process(_delta: float) -> void: 8 | if Engine.is_editor_hint() && refresh: 9 | size.x = 0 10 | position.x = size.x / -2 11 | refresh = false 12 | -------------------------------------------------------------------------------- /Util/Autoload/camera_shake.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | 4 | var noise : FastNoiseLite = preload("res://Resources/camera_noise.tres") 5 | 6 | 7 | var shake_strength := 0.0 8 | var shake_speed := 30.0 9 | var noise_index := 0.0 10 | var decay_rate := 8.0 11 | 12 | 13 | func add_trauma(amount: float) -> void: 14 | shake_strength += amount 15 | 16 | 17 | func set_frequency(freq: float) -> void: 18 | noise.frequency = freq 19 | 20 | 21 | func _process(delta: float) -> void: 22 | shake_strength = lerp(shake_strength, 0.0, decay_rate * delta) 23 | noise_index += delta * shake_speed 24 | 25 | 26 | func get_offset() -> Vector2: 27 | return Vector2( 28 | noise.get_noise_2d(1, noise_index) * shake_strength, 29 | noise.get_noise_2d(100, noise_index) * shake_strength 30 | ) 31 | -------------------------------------------------------------------------------- /Util/Autoload/display_manager.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | 4 | func _physics_process(delta: float) -> void: 5 | if Input.is_action_just_pressed("toggle_fullscreen"): 6 | if DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_EXCLUSIVE_FULLSCREEN: 7 | DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED) 8 | else: 9 | DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_EXCLUSIVE_FULLSCREEN) 10 | -------------------------------------------------------------------------------- /Util/Autoload/enemy_spawner.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | ################################################ 4 | # This is an autoloaded node that allows you 5 | # to spawn an enemy when pressing "E" by default 6 | # or num keys for specific dinos 7 | ################################################ 8 | 9 | 10 | var enemy_scene : PackedScene = preload("res://Objects/Scenes/enemy.tscn") 11 | 12 | var enemy_stats: Array[EnemyStats] = [ 13 | preload("res://Resources/Enemy/yellow_dino.tres"), 14 | preload("res://Resources/Enemy/red_dino.tres"), 15 | preload("res://Resources/Enemy/blue_dino.tres"), 16 | preload("res://Resources/Enemy/green_dino.tres"), 17 | ] 18 | 19 | 20 | func _physics_process(delta: float) -> void: 21 | for i in enemy_stats.size(): 22 | if Input.is_action_just_pressed("spawn_" + str(i+1)): 23 | spawn_enemy(enemy_stats[i]) 24 | 25 | 26 | if Input.is_action_just_pressed("spawn_enemy"): 27 | spawn_enemy(enemy_stats.pick_random()) 28 | 29 | 30 | func spawn_enemy(stats: EnemyStats): 31 | var spawned_enemy : Enemy = enemy_scene.instantiate() 32 | spawned_enemy.stats = stats 33 | get_tree().root.add_child(spawned_enemy) 34 | spawned_enemy.global_position = get_global_mouse_position() 35 | -------------------------------------------------------------------------------- /Util/Autoload/hit_pause.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | 4 | var active_timers := [] 5 | 6 | # Mapped by [Node, float] 7 | var current_slow_sources : Dictionary = {} 8 | 9 | 10 | func add_slow_down(amount: float, source: Node) -> void: 11 | current_slow_sources[source] = amount 12 | 13 | calc_slowdown() 14 | 15 | 16 | func remove_slow_down(source: Node) -> void: 17 | current_slow_sources.erase(source) 18 | 19 | calc_slowdown() 20 | 21 | 22 | func slow_down_timer(amount: float, time: float = -1): 23 | var timer = SlowdownTimer.new(time, amount) 24 | timer.timeout.connect(on_slowdown_timeout) 25 | 26 | active_timers.append(timer) 27 | 28 | calc_slowdown() 29 | 30 | 31 | func _process(delta: float) -> void: 32 | for timer in active_timers: 33 | timer.tick(delta) 34 | 35 | calc_slowdown() 36 | 37 | 38 | func calc_slowdown(): 39 | var total := 1.0 40 | 41 | for timer in active_timers: 42 | total *= timer.amount 43 | 44 | for source: Node in current_slow_sources.keys(): 45 | if source && is_instance_valid(source): 46 | total *= current_slow_sources[source] 47 | else: 48 | current_slow_sources.erase(source) 49 | 50 | Engine.time_scale = total 51 | 52 | 53 | func on_slowdown_timeout(timer: SlowdownTimer): 54 | Engine.time_scale += timer.amount 55 | active_timers.erase(timer) 56 | 57 | 58 | class SlowdownTimer: 59 | 60 | signal timeout(timer: SlowdownTimer) 61 | 62 | var time : float 63 | var current_time : float 64 | 65 | var amount : float 66 | 67 | 68 | func _init(t: float, a: float): 69 | self.time = t 70 | self.amount = a 71 | 72 | 73 | func tick(delta: float): 74 | current_time += (delta / Engine.time_scale) 75 | 76 | if current_time >= time: 77 | timeout.emit(self) 78 | -------------------------------------------------------------------------------- /Util/Autoload/sound_manager.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | 4 | var channel_count : int = 10 5 | 6 | var audio_players : Array[AudioStreamPlayer] = [] 7 | var spatial_audio_players : Array[AudioStreamPlayer2D] = [] 8 | 9 | var current_channel : int = 0 10 | var current_spatial_channel : int = 0 11 | 12 | func _ready(): 13 | for i in channel_count: 14 | var new_player = AudioStreamPlayer.new() 15 | audio_players.append(new_player) 16 | add_child(new_player) 17 | var new_spatial_player = AudioStreamPlayer2D.new() 18 | spatial_audio_players.append(new_spatial_player) 19 | add_child(new_spatial_player) 20 | 21 | 22 | func play_sound(stream: AudioStream, vol: float = 1.0) -> void: 23 | var player : AudioStreamPlayer = get_audio_player(audio_players) 24 | 25 | player.volume_db = linear_to_db(vol) 26 | player.stream = stream 27 | player.play() 28 | 29 | 30 | func play_sound_pitched(stream: AudioStream, pitch_range: float = 0.1, vol: float = 1.0) -> void: 31 | var player : AudioStreamPlayer = get_audio_player(audio_players) 32 | 33 | player.volume_db = linear_to_db(vol) 34 | player.stream = stream 35 | player.pitch_scale = 1 + randf_range(-pitch_range, pitch_range) 36 | player.play() 37 | 38 | 39 | func play_spatial_sound(stream: AudioStream, pos: Vector2, vol: float = 1.0) -> void: 40 | var player : AudioStreamPlayer2D = get_audio_player(spatial_audio_players) 41 | 42 | player.volume_db = linear_to_db(vol) 43 | player.stream = stream 44 | player.global_position = pos 45 | player.play() 46 | 47 | 48 | func play_spatial_sound_pitched(stream: AudioStream, pos: Vector2, pitch_range: float = 0.1, vol: float = 1.0) -> void: 49 | var player : AudioStreamPlayer2D = get_audio_player(spatial_audio_players) 50 | 51 | player.volume_db = linear_to_db(vol) 52 | player.stream = stream 53 | player.global_position = pos 54 | player.pitch_scale * randf_range(-pitch_range, pitch_range) 55 | player.play() 56 | 57 | 58 | func get_audio_player(players: Array): 59 | var player = players[current_channel] 60 | current_channel += 1 61 | current_channel %= channel_count 62 | 63 | return player 64 | -------------------------------------------------------------------------------- /Util/Classes/attack.gd: -------------------------------------------------------------------------------- 1 | class_name Attack 2 | 3 | # Strictly a data class, used for passing attack information 4 | # between hurtboxes and hitboxes 5 | 6 | var damage := 10.0 7 | 8 | var knockback := 0.0 9 | -------------------------------------------------------------------------------- /Util/Classes/weapon_stats.gd: -------------------------------------------------------------------------------- 1 | class_name WeaponStats 2 | extends Resource 3 | 4 | 5 | @export_range(0, 5) var firing_cooldown := 0.5 6 | 7 | @export_group("Attack") 8 | @export var speed := 200.0 9 | @export var damage := 5.0 10 | @export var max_pierce := 1 11 | @export var knockback_force := 1.0 12 | -------------------------------------------------------------------------------- /Util/Components/health.gd: -------------------------------------------------------------------------------- 1 | class_name Health 2 | extends Node 3 | 4 | ############################## 5 | # Health Component for enemies 6 | ############################## 7 | 8 | signal health_changed(health: float) 9 | signal max_health_changed(max_health: float) 10 | signal died() 11 | 12 | @export var hitbox : Hitbox 13 | @export var animation_player : AnimationPlayer 14 | 15 | @export var max_health := 10.0 : 16 | set(val): 17 | max_health = val 18 | max_health_changed.emit(max_health) 19 | health = max_health 20 | @onready var health := max_health: 21 | set(val): 22 | health = val 23 | health_changed.emit(health) 24 | 25 | 26 | func _ready(): 27 | if hitbox: 28 | hitbox.damaged.connect(on_damaged) 29 | 30 | max_health_changed.emit(max_health) 31 | health_changed.emit(health) 32 | 33 | 34 | func on_damaged(attack: Attack): 35 | health -= attack.damage 36 | health = max(0, health) 37 | 38 | if health <= 0: 39 | if animation_player: 40 | animation_player.play("death") 41 | -------------------------------------------------------------------------------- /Util/Components/hitbox.gd: -------------------------------------------------------------------------------- 1 | class_name Hitbox 2 | extends Area2D 3 | 4 | ############################################################ 5 | # Hitbox component - this gets hit by the bullet's hurtbox. 6 | # Only used by enemies by default, but can be referenced by 7 | # health components to receive damage 8 | ############################################################ 9 | 10 | 11 | signal damaged(attack: Attack) 12 | 13 | 14 | func damage(attack: Attack): 15 | damaged.emit(attack) 16 | -------------------------------------------------------------------------------- /Util/Components/hurtbox.gd: -------------------------------------------------------------------------------- 1 | class_name Hurtbox 2 | extends Area2D 3 | 4 | signal hit_enemy 5 | 6 | 7 | var bullet : Bullet 8 | 9 | 10 | func _ready() -> void: 11 | if owner is Bullet: 12 | bullet = owner 13 | 14 | area_entered.connect(on_area_entered) 15 | 16 | 17 | func on_area_entered(area: Area2D): 18 | var valid := true 19 | if bullet && bullet.is_queued_for_deletion(): 20 | valid = false 21 | 22 | if area is Hitbox && valid: 23 | var attack := Attack.new() 24 | 25 | if bullet: 26 | attack.damage = bullet.damage 27 | attack.knockback = bullet.knockback_force 28 | else: 29 | attack.damage = 1 30 | 31 | area.damage(attack) 32 | 33 | hit_enemy.emit() 34 | -------------------------------------------------------------------------------- /Util/Enemy/enemy_stats.gd: -------------------------------------------------------------------------------- 1 | class_name EnemyStats 2 | extends Resource 3 | 4 | 5 | @export var texture: Texture2D 6 | 7 | @export var max_health := 10.0 8 | 9 | @export var max_speed := 70.0 10 | @export var variation_range := 10.0 11 | @export var acceleration_time := 2.5 12 | @export var friction := 1.0 13 | 14 | @export var loot_table : LootTable 15 | -------------------------------------------------------------------------------- /Util/Enemy/loot_table.gd: -------------------------------------------------------------------------------- 1 | class_name LootTable 2 | extends Resource 3 | 4 | 5 | ## Mapped by item, weight 6 | @export var item_rolls : Array[ItemRoll] 7 | 8 | @export var roll_times := 1 9 | 10 | var rng := RandomNumberGenerator.new() 11 | 12 | 13 | func roll_loot() -> Array[ItemStack]: 14 | var items : Array[ItemStack] 15 | var weights : Array = item_rolls.map(func(roll: ItemRoll): return roll.weight) 16 | 17 | for i in roll_times: 18 | var index := rng.rand_weighted(weights) 19 | var roll : ItemRoll = item_rolls[index] 20 | if roll.item: 21 | items.append(ItemStack.new(roll.item, roll.count)) 22 | 23 | return items 24 | -------------------------------------------------------------------------------- /Util/Inventory/inventory.gd: -------------------------------------------------------------------------------- 1 | class_name Inventory 2 | 3 | signal updated 4 | 5 | const SIZE := 8 6 | 7 | var items : Array[ItemStack] = [] 8 | 9 | 10 | func _init(): 11 | for slot in SIZE: 12 | items.append(ItemStack.new(Items.EMPTY, 0)) 13 | 14 | 15 | # Take in ItemStack, add in relevant slots, returns either adjusted ItemStack or Empty 16 | func add_item(new_stack: ItemStack) -> ItemStack: 17 | 18 | for stack in items: 19 | if new_stack.is_empty(): 20 | break 21 | 22 | # If the slot contains the item and had headroom, fill it as much as we can 23 | if stack.item == new_stack.item && stack.count < stack.max_count: 24 | stack.count += new_stack.count 25 | 26 | var overload = stack.count - stack.max_count 27 | 28 | stack.count = clamp(stack.count, 0, stack.max_count) 29 | 30 | if overload <= 0: 31 | new_stack = ItemStack.new(Items.EMPTY) 32 | else: 33 | new_stack.count = overload 34 | 35 | for stack in items: 36 | if new_stack.is_empty(): 37 | break 38 | 39 | # If the slot is empty, just take the stack wholesale 40 | if stack.is_empty(): 41 | stack.item = new_stack.item 42 | stack.count = new_stack.count 43 | new_stack = ItemStack.new(Items.EMPTY) 44 | 45 | updated.emit() 46 | 47 | # Return any remaining items 48 | return new_stack 49 | 50 | 51 | func remove_item(item: Item, count: int) -> void: 52 | 53 | for stack in items: 54 | 55 | if count <= 0: 56 | break 57 | 58 | # If this stack contains the item, remove as much as we can 59 | if stack.item == item: 60 | var diff = stack.count - count 61 | 62 | stack.count = max(stack.count - count, 0) 63 | 64 | if diff <= 0: 65 | stack.item = Items.EMPTY 66 | # Here's the leftover count we need to remove 67 | count = abs(diff) 68 | else: 69 | count = 0 70 | 71 | updated.emit() 72 | 73 | 74 | func has_count(item: Item, count: int) -> bool: 75 | 76 | var total := 0 77 | for stack in items: 78 | if stack.item == item: 79 | total += stack.count 80 | 81 | if total >= count: 82 | return true 83 | 84 | return false 85 | 86 | 87 | func _to_string() -> String: 88 | var s = "" 89 | 90 | for stack in items: 91 | s += str(stack) + "\n" 92 | 93 | return s 94 | -------------------------------------------------------------------------------- /Util/Items/crafting_ingredient.gd: -------------------------------------------------------------------------------- 1 | class_name CraftingIngredient 2 | extends Resource 3 | 4 | @export var item : Item 5 | @export var count : int 6 | -------------------------------------------------------------------------------- /Util/Items/crafting_recipe.gd: -------------------------------------------------------------------------------- 1 | class_name CraftingRecipe 2 | extends Resource 3 | 4 | 5 | @export var ingredients : Array[CraftingIngredient] 6 | 7 | @export var output : CraftingIngredient 8 | 9 | 10 | func craft(inventory: Inventory) -> void: 11 | 12 | for ingredient in ingredients: 13 | inventory.remove_item(ingredient.item, ingredient.count) 14 | 15 | inventory.add_item(ItemStack.new(output.item, output.count)) 16 | 17 | 18 | func can_craft(inventory: Inventory) -> bool: 19 | var valid = true 20 | 21 | for ingredient in ingredients: 22 | if !inventory.has_count(ingredient.item, ingredient.count): 23 | valid = false 24 | 25 | return valid 26 | -------------------------------------------------------------------------------- /Util/Items/crafting_registry.gd: -------------------------------------------------------------------------------- 1 | class_name CraftingRegistry 2 | 3 | 4 | static var recipes : Array[CraftingRecipe] 5 | 6 | 7 | static func _static_init() -> void: 8 | load_resources("res://Resources/Recipes") 9 | 10 | 11 | static func load_resources(path: String) -> void: 12 | if !path.ends_with("/"): 13 | path += "/" 14 | 15 | var dir = DirAccess.open(path) 16 | if dir: 17 | dir.list_dir_begin() 18 | var file_name = dir.get_next() 19 | while file_name != "": 20 | recipes.append(load(path + file_name)) 21 | file_name = dir.get_next() 22 | 23 | 24 | static func get_craftable(inventory: Inventory) -> Array[CraftingRecipe]: 25 | var valid_recipes : Array[CraftingRecipe] 26 | 27 | for r in recipes: 28 | if r.can_craft(inventory): 29 | valid_recipes.append(r) 30 | 31 | return valid_recipes 32 | -------------------------------------------------------------------------------- /Util/Items/item.gd: -------------------------------------------------------------------------------- 1 | class_name Item 2 | extends Resource 3 | 4 | 5 | @export var item_name : String = "" 6 | @export var sprite : Texture2D = AtlasTexture.new() 7 | 8 | 9 | func _to_string() -> String: 10 | return item_name 11 | -------------------------------------------------------------------------------- /Util/Items/item_roll.gd: -------------------------------------------------------------------------------- 1 | class_name ItemRoll 2 | extends Resource 3 | 4 | @export var item : Item 5 | @export var count : int 6 | @export var weight : float 7 | -------------------------------------------------------------------------------- /Util/Items/item_stack.gd: -------------------------------------------------------------------------------- 1 | class_name ItemStack 2 | 3 | # Yeah I'm using ItemStacks 4 | # My experience modding minecraft is showing 5 | 6 | signal item_changed(item: Item) 7 | 8 | static var max_count := 100 9 | 10 | var item : Item: 11 | set(val): 12 | item = val 13 | item_changed.emit(val) 14 | 15 | var count : int 16 | 17 | 18 | func _init(item: Item, count: int = 0): 19 | self.item = item 20 | self.count = count 21 | 22 | 23 | func is_empty() -> bool: 24 | return item == Items.EMPTY 25 | 26 | 27 | func _to_string() -> String: 28 | return "Item: " + str(item) + " - " + str(count) 29 | -------------------------------------------------------------------------------- /Util/Items/items.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | var EMPTY : Item = Item.new() 4 | const STICK : Item = preload("res://Resources/Items/Materials/stick.tres") 5 | const ROCK : Item = preload("res://Resources/Items/Materials/rock.tres") 6 | 7 | var all_items = [ 8 | EMPTY, 9 | STICK, 10 | ROCK 11 | ] 12 | 13 | var item_registry := {} 14 | 15 | 16 | func _ready() -> void: 17 | _register_items() 18 | Items.EMPTY.item_name = "EMPTY" 19 | 20 | 21 | func _register_items() -> void: 22 | for item in all_items: 23 | item_registry[item.item_name] = item 24 | 25 | 26 | func get_item(item_name: String) -> Item: 27 | return item_registry.get(item_name) 28 | -------------------------------------------------------------------------------- /default_bus_layout.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="AudioBusLayout" format=3 uid="uid://b7ehfcop5k33e"] 2 | 3 | [resource] 4 | bus/0/send = &"Music" 5 | -------------------------------------------------------------------------------- /export_presets.cfg: -------------------------------------------------------------------------------- 1 | [preset.0] 2 | 3 | name="Windows Desktop" 4 | platform="Windows Desktop" 5 | runnable=true 6 | dedicated_server=false 7 | custom_features="" 8 | export_filter="all_resources" 9 | include_filter="" 10 | exclude_filter="" 11 | export_path="" 12 | encryption_include_filters="" 13 | encryption_exclude_filters="" 14 | encrypt_pck=false 15 | encrypt_directory=false 16 | 17 | [preset.0.options] 18 | 19 | custom_template/debug="" 20 | custom_template/release="" 21 | debug/export_console_wrapper=1 22 | binary_format/embed_pck=false 23 | texture_format/bptc=true 24 | texture_format/s3tc=true 25 | texture_format/etc=false 26 | texture_format/etc2=false 27 | binary_format/architecture="x86_64" 28 | codesign/enable=false 29 | codesign/timestamp=true 30 | codesign/timestamp_server_url="" 31 | codesign/digest_algorithm=1 32 | codesign/description="" 33 | codesign/custom_options=PackedStringArray() 34 | application/modify_resources=true 35 | application/icon="" 36 | application/console_wrapper_icon="" 37 | application/icon_interpolation=4 38 | application/file_version="" 39 | application/product_version="" 40 | application/company_name="" 41 | application/product_name="" 42 | application/file_description="" 43 | application/copyright="" 44 | application/trademarks="" 45 | application/export_angle=0 46 | ssh_remote_deploy/enabled=false 47 | ssh_remote_deploy/host="user@host_ip" 48 | ssh_remote_deploy/port="22" 49 | ssh_remote_deploy/extra_args_ssh="" 50 | ssh_remote_deploy/extra_args_scp="" 51 | ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}' 52 | $action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}' 53 | $trigger = New-ScheduledTaskTrigger -Once -At 00:00 54 | $settings = New-ScheduledTaskSettingsSet 55 | $task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings 56 | Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true 57 | Start-ScheduledTask -TaskName godot_remote_debug 58 | while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 } 59 | Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue" 60 | ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue 61 | Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue 62 | Remove-Item -Recurse -Force '{temp_dir}'" 63 | -------------------------------------------------------------------------------- /icon.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /icon.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://d1nlg3gl7r2fq" 6 | path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://icon.svg" 14 | dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=1.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=5 10 | 11 | [application] 12 | 13 | config/name="Resources :3" 14 | run/main_scene="res://Scenes/main.tscn" 15 | config/features=PackedStringArray("4.3", "Forward Plus") 16 | config/icon="res://icon.svg" 17 | 18 | [autoload] 19 | 20 | EnemySpawner="*res://Util/Autoload/enemy_spawner.gd" 21 | CameraShake="*res://Util/Autoload/camera_shake.gd" 22 | Items="*res://Util/Items/items.gd" 23 | SoundManager="*res://Util/Autoload/sound_manager.gd" 24 | HitPause="*res://Util/Autoload/hit_pause.gd" 25 | DisplayManager="*res://Util/Autoload/display_manager.gd" 26 | 27 | [display] 28 | 29 | window/size/viewport_width=1280 30 | window/size/viewport_height=720 31 | window/size/window_width_override=1920 32 | window/size/window_height_override=1080 33 | window/stretch/mode="canvas_items" 34 | mouse_cursor/custom_image="res://Art/Bitlytic/crosshair.png" 35 | mouse_cursor/custom_image_hotspot=Vector2(13, 13) 36 | 37 | [editor] 38 | 39 | movie_writer/mjpeg_quality=1.0 40 | movie_writer/movie_file="D:/Godot/Godot Survivors/Video/output.avi" 41 | 42 | [file_customization] 43 | 44 | folder_colors={ 45 | "res://Art/": "purple", 46 | "res://Objects/": "orange", 47 | "res://Player/": "red", 48 | "res://Resources/": "teal", 49 | "res://Scenes/": "green", 50 | "res://Sound/": "blue", 51 | "res://UI/": "pink", 52 | "res://Util/": "gray" 53 | } 54 | 55 | [input] 56 | 57 | move_left={ 58 | "deadzone": 0.5, 59 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null) 60 | ] 61 | } 62 | move_up={ 63 | "deadzone": 0.5, 64 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null) 65 | ] 66 | } 67 | move_right={ 68 | "deadzone": 0.5, 69 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null) 70 | ] 71 | } 72 | move_down={ 73 | "deadzone": 0.5, 74 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null) 75 | ] 76 | } 77 | primary_fire={ 78 | "deadzone": 0.5, 79 | "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"canceled":false,"pressed":false,"double_click":false,"script":null) 80 | ] 81 | } 82 | spawn_enemy={ 83 | "deadzone": 0.5, 84 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null) 85 | ] 86 | } 87 | toggle_fullscreen={ 88 | "deadzone": 0.5, 89 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194342,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) 90 | ] 91 | } 92 | debug_button={ 93 | "deadzone": 0.5, 94 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":102,"location":0,"echo":false,"script":null) 95 | ] 96 | } 97 | spawn_1={ 98 | "deadzone": 0.5, 99 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":49,"key_label":0,"unicode":49,"location":0,"echo":false,"script":null) 100 | ] 101 | } 102 | spawn_2={ 103 | "deadzone": 0.5, 104 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":50,"key_label":0,"unicode":50,"location":0,"echo":false,"script":null) 105 | ] 106 | } 107 | spawn_3={ 108 | "deadzone": 0.5, 109 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":51,"key_label":0,"unicode":51,"location":0,"echo":false,"script":null) 110 | ] 111 | } 112 | spawn_4={ 113 | "deadzone": 0.5, 114 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":52,"key_label":0,"unicode":52,"location":0,"echo":false,"script":null) 115 | ] 116 | } 117 | 118 | [layer_names] 119 | 120 | 2d_physics/layer_1="Player" 121 | 2d_physics/layer_2="Player Projectile" 122 | 2d_physics/layer_3="Enemy" 123 | 2d_physics/layer_4="Enemy Projectile" 124 | 2d_physics/layer_7="Object" 125 | 2d_physics/layer_8="Walls" 126 | 127 | [rendering] 128 | 129 | textures/canvas_textures/default_texture_filter=0 130 | --------------------------------------------------------------------------------