├── .gitattributes ├── .gitignore ├── .gitmodules ├── LICENSE.txt ├── LICENSE_ASSETS.txt ├── README.md ├── icon.png ├── project.godot └── tiny_wizard ├── assets ├── art │ ├── arrow.png │ ├── bomb_explode.png │ ├── hat.png │ ├── hole_tileset.png │ ├── playerbody.png │ ├── playerface.png │ ├── room.png │ └── violet_arrow.png └── placeholder_art │ ├── chests │ ├── gold_chest_closed.png │ ├── gold_chest_open.png │ ├── normal_chest_closed.png │ └── normal_chest_open.png │ ├── cirle_particle.png │ ├── doors │ ├── down_door.png │ ├── down_door_closed.png │ ├── left_door.png │ ├── left_door_closed.png │ ├── right_door.png │ ├── right_door_closed.png │ ├── up_door.png │ └── up_door_closed.png │ ├── fly.png │ ├── ground_bomb_trace.png │ ├── gui │ ├── bomb_icon.png │ ├── box.png │ ├── coin.png │ ├── cross.png │ ├── empty_heart.png │ ├── half_heart.png │ ├── half_shield.png │ ├── heart.png │ ├── key.png │ ├── room_dark.png │ ├── room_light.png │ ├── shield.png │ ├── step_indicator.png │ └── ui_background.png │ ├── hole_tileset.png │ ├── icon.png │ ├── icon_mini.png │ ├── items │ ├── bomb.png │ ├── coin.png │ ├── heart_full.png │ ├── heart_half.png │ ├── key.png │ ├── shield_full.png │ └── shield_half.png │ ├── red_fly.png │ └── shadow.png ├── enemies ├── black_fly │ ├── Visual.gd │ ├── black_fly.tscn │ ├── black_fly_behavior.gd │ └── black_fly_weapon.tscn └── red_fly │ ├── red_fly.tscn │ ├── red_fly_behavior.gd │ └── red_fly_weapon.tscn ├── gui ├── gui.tscn ├── inventory_ui │ ├── inventory_ui.gd │ └── inventory_ui.tscn ├── life_ui │ ├── heart │ │ ├── heart.gd │ │ └── heart.tscn │ ├── hearts_ui.gd │ └── hearts_ui.tscn └── ui_manager.gd ├── interactable_objects ├── bump_animation.tres ├── chests │ ├── chest.gd │ ├── chest.tscn │ ├── chest_sprite.gd │ ├── locked_chest.tscn │ └── open_chest.gd ├── default_interactable_object │ └── interact_on_collide.tscn └── objects_anim_lib.tres ├── items ├── coin │ ├── coin.tres │ └── coin.tscn ├── default_items │ ├── default_add_to_inventory_item.tscn │ ├── default_health_item.tscn │ ├── default_item.tscn │ └── heart.tres ├── hearts │ ├── full_heart.tres │ ├── full_heart.tscn │ ├── full_shield.tres │ ├── full_shield.tscn │ ├── half_heart.tres │ ├── half_heart.tscn │ ├── half_shield.tres │ └── half_shield.tscn ├── key │ ├── key.tres │ └── key.tscn ├── pickable_bomb │ ├── bomb.tres │ ├── exploding_bomb │ │ ├── exploding_bomb.gd │ │ └── exploding_bomb.tscn │ └── pickable_bomb.tscn └── violet_arrow │ ├── equip_bullet.gd │ ├── violet_arrow.tres │ └── violet_arrow.tscn ├── main.tscn ├── player ├── character_visual.gd ├── inventory │ └── inventory.tres ├── player_character.gd ├── player_character.tscn ├── player_input.gd ├── player_stats.gd ├── player_stats.tres └── weapon │ ├── arrow_shooter.tscn │ └── bullet │ ├── arrow.gd │ ├── arrow.tscn │ └── violet_arrow.tscn ├── room ├── room.gd ├── room.tscn └── room_types │ ├── room_1.tscn │ ├── room_2.tscn │ ├── room_3.tscn │ ├── room_4.tscn │ ├── room_5.tscn │ ├── room_6.tscn │ ├── room_7.tscn │ ├── room_8.tscn │ └── room_9.tscn └── tiny_wizard_main.gd /.gitattributes: -------------------------------------------------------------------------------- 1 | # Normalize EOL for all files that Git considers text files. 2 | * text=auto eol=lf 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Godot-specific ignores 3 | .import/ 4 | *.import 5 | export.cfg 6 | export_presets.cfg 7 | .godot/ 8 | 9 | # Mono-specific ignores 10 | .mono/ 11 | data_*/ 12 | 13 | # vs code 14 | .vscode/ 15 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "top-down-shooter-core"] 2 | path = top-down-shooter-core 3 | url = git@github.com:quiver-dev/top-down-shooter-core.git 4 | branch = main 5 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Quiver 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LICENSE_ASSETS.txt: -------------------------------------------------------------------------------- 1 | All art, music, and sound assets are licensed under the Creative Commons Attribution 4.0 International license. 2 | 3 | Full license: https://creativecommons.org/licenses/by/4.0/legalcode 4 | More information: https://creativecommons.org/licenses/by/4.0/ 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tiny Wizard: Room-Based Top-Down Shooter 2 | An open source 2D Godot 4 game template in the style of *The Binding of Isaac*. 3 | Created by [Quiver](https://quiver.dev). 4 | 5 | ## Trailer 6 | [![Tiny Wizard Trailer](https://image.mux.com/cCIN6Sj1SURW00zjcZwTFjixhoChIrCMqaxzJwJDTFXY/animated.gif?start=19&end=26)](https://quiver.dev/assets/game-templates/tiny-wizard-top-down-shooter-binding-of-isaac-godot-4/#lg=1&slide=0) 7 | 8 | (click to watch the full trailer!) 9 | 10 | ## Features 11 | - Built on Quiver's [top-down shooter template](https://github.com/quiver-dev/top-down-shooter-godot4) 12 | - 4-way character movement 13 | - Room-based system with unlocking doors 14 | - Multiple projectile weapons and bombs 15 | - Multiple enemy types 16 | - Customizable enemy behaviors 17 | - Collectibles like weapon upgrades and keys 18 | - Destructible environments 19 | 20 | ## Topics covered 21 | - Tilemaps 22 | - Inventory UI 23 | 24 | ## Requirements 25 | * Godot 4.0 RC 6 or higher 26 | 27 | ## Installation Instructions 28 | * Clone this repository from Github 29 | * Run ```git submodule update --init``` to initialize the top-down shooter submodule 30 | * Open the Godot project file and run it to play the *Tiny Wizard* demo! 31 | 32 | ## Questions/Bugs/Suggestions 33 | For bugs and feature requests, feel free to file an issue here or comment on this template's [project page](https://quiver.dev/assets/game-templates/tiny-wizard-top-down-shooter-binding-of-isaac-godot-4/). 34 | 35 | ## Share with the community! 36 | If you manage to incorporate this template into your next project, please share with the [Quiver community](https://quiver.dev/)! 37 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/icon.png -------------------------------------------------------------------------------- /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="tiny-wizard-demo" 14 | run/main_scene="res://tiny_wizard/main.tscn" 15 | config/features=PackedStringArray("4.0") 16 | config/icon="res://icon.png" 17 | 18 | [display] 19 | 20 | window/size/viewport_width=1024 21 | window/size/viewport_height=800 22 | window/stretch/mode="canvas_items" 23 | 24 | [input] 25 | 26 | player_up={ 27 | "deadzone": 0.5, 28 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"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":0,"echo":false,"script":null) 29 | ] 30 | } 31 | player_down={ 32 | "deadzone": 0.5, 33 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"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,"echo":false,"script":null) 34 | ] 35 | } 36 | player_left={ 37 | "deadzone": 0.5, 38 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"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":0,"echo":false,"script":null) 39 | ] 40 | } 41 | player_right={ 42 | "deadzone": 0.5, 43 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"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":0,"echo":false,"script":null) 44 | ] 45 | } 46 | fire={ 47 | "deadzone": 0.5, 48 | "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"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,"pressed":false,"double_click":false,"script":null) 49 | ] 50 | } 51 | player_shoot_up={ 52 | "deadzone": 0.5, 53 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194320,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) 54 | ] 55 | } 56 | player_shoot_down={ 57 | "deadzone": 0.5, 58 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194322,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) 59 | ] 60 | } 61 | player_shoot_left={ 62 | "deadzone": 0.5, 63 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194319,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) 64 | ] 65 | } 66 | player_shoot_right={ 67 | "deadzone": 0.5, 68 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194321,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) 69 | ] 70 | } 71 | drop_bomb={ 72 | "deadzone": 0.5, 73 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"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":0,"echo":false,"script":null) 74 | ] 75 | } 76 | 77 | [layer_names] 78 | 79 | 2d_physics/layer_1="World" 80 | 2d_physics/layer_2="Player" 81 | 2d_physics/layer_3="Bullets" 82 | 2d_physics/layer_4="Enemies" 83 | 2d_physics/layer_5="Items" 84 | 2d_physics/layer_6="Hole" 85 | 2d_physics/layer_7="Walls" 86 | -------------------------------------------------------------------------------- /tiny_wizard/assets/art/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/art/arrow.png -------------------------------------------------------------------------------- /tiny_wizard/assets/art/bomb_explode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/art/bomb_explode.png -------------------------------------------------------------------------------- /tiny_wizard/assets/art/hat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/art/hat.png -------------------------------------------------------------------------------- /tiny_wizard/assets/art/hole_tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/art/hole_tileset.png -------------------------------------------------------------------------------- /tiny_wizard/assets/art/playerbody.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/art/playerbody.png -------------------------------------------------------------------------------- /tiny_wizard/assets/art/playerface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/art/playerface.png -------------------------------------------------------------------------------- /tiny_wizard/assets/art/room.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/art/room.png -------------------------------------------------------------------------------- /tiny_wizard/assets/art/violet_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/art/violet_arrow.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/chests/gold_chest_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/chests/gold_chest_closed.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/chests/gold_chest_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/chests/gold_chest_open.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/chests/normal_chest_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/chests/normal_chest_closed.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/chests/normal_chest_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/chests/normal_chest_open.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/cirle_particle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/cirle_particle.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/doors/down_door.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/doors/down_door.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/doors/down_door_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/doors/down_door_closed.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/doors/left_door.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/doors/left_door.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/doors/left_door_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/doors/left_door_closed.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/doors/right_door.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/doors/right_door.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/doors/right_door_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/doors/right_door_closed.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/doors/up_door.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/doors/up_door.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/doors/up_door_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/doors/up_door_closed.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/fly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/fly.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/ground_bomb_trace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/ground_bomb_trace.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/gui/bomb_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/gui/bomb_icon.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/gui/box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/gui/box.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/gui/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/gui/coin.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/gui/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/gui/cross.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/gui/empty_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/gui/empty_heart.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/gui/half_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/gui/half_heart.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/gui/half_shield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/gui/half_shield.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/gui/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/gui/heart.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/gui/key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/gui/key.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/gui/room_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/gui/room_dark.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/gui/room_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/gui/room_light.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/gui/shield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/gui/shield.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/gui/step_indicator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/gui/step_indicator.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/gui/ui_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/gui/ui_background.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/hole_tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/hole_tileset.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/icon.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/icon_mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/icon_mini.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/items/bomb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/items/bomb.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/items/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/items/coin.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/items/heart_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/items/heart_full.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/items/heart_half.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/items/heart_half.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/items/key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/items/key.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/items/shield_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/items/shield_full.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/items/shield_half.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/items/shield_half.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/red_fly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/red_fly.png -------------------------------------------------------------------------------- /tiny_wizard/assets/placeholder_art/shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quiver-dev/tiny-wizard-demo/a3a75489e8b4e1e43b5a03b9bf954642fe216862/tiny_wizard/assets/placeholder_art/shadow.png -------------------------------------------------------------------------------- /tiny_wizard/enemies/black_fly/Visual.gd: -------------------------------------------------------------------------------- 1 | extends QuiverCharacterVisual 2 | 3 | 4 | var _t := 0.0 5 | 6 | 7 | func _process(delta): 8 | _t+=delta 9 | $AnimatedSprite2D.position.y = -52+1.2*sin(8*_t) 10 | 11 | -------------------------------------------------------------------------------- /tiny_wizard/enemies/black_fly/black_fly.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=16 format=3 uid="uid://cnoc26x8qgyyw"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://ckan5lwiqvq2a" path="res://top-down-shooter-core/character/character.tscn" id="1_5wxj1"] 4 | [ext_resource type="Script" path="res://top-down-shooter-core/character/character_stats/character_stats.gd" id="2_72r4n"] 5 | [ext_resource type="Texture2D" uid="uid://b407xmjgfwcb6" path="res://tiny_wizard/assets/placeholder_art/fly.png" id="2_blmnv"] 6 | [ext_resource type="Script" path="res://tiny_wizard/enemies/black_fly/Visual.gd" id="2_w4t8f"] 7 | [ext_resource type="Texture2D" uid="uid://cjjugml0purnn" path="res://tiny_wizard/assets/placeholder_art/shadow.png" id="3_m8u5l"] 8 | [ext_resource type="Script" path="res://top-down-shooter-core/character/character_stats/physics_stats.gd" id="3_x7s4q"] 9 | [ext_resource type="Script" path="res://tiny_wizard/enemies/black_fly/black_fly_behavior.gd" id="7_g1frr"] 10 | [ext_resource type="PackedScene" uid="uid://c81dr52jie1dv" path="res://tiny_wizard/enemies/red_fly/red_fly_weapon.tscn" id="7_g7bvv"] 11 | 12 | [sub_resource type="Resource" id="Resource_xpmbt"] 13 | resource_local_to_scene = true 14 | script = ExtResource("2_72r4n") 15 | max_life = 5 16 | 17 | [sub_resource type="Resource" id="Resource_a0bdi"] 18 | resource_local_to_scene = true 19 | script = ExtResource("3_x7s4q") 20 | max_speed = 75.0 21 | acceleration = 0.4 22 | friction = 0.1 23 | impulse_force = 500.0 24 | 25 | [sub_resource type="AtlasTexture" id="AtlasTexture_68rp0"] 26 | atlas = ExtResource("2_blmnv") 27 | region = Rect2(0, 0, 60, 60) 28 | 29 | [sub_resource type="AtlasTexture" id="AtlasTexture_hpw2m"] 30 | atlas = ExtResource("2_blmnv") 31 | region = Rect2(60, 0, 60, 60) 32 | 33 | [sub_resource type="SpriteFrames" id="SpriteFrames_xrf4e"] 34 | animations = [{ 35 | "frames": [{ 36 | "duration": 1.0, 37 | "texture": SubResource("AtlasTexture_68rp0") 38 | }, { 39 | "duration": 1.0, 40 | "texture": SubResource("AtlasTexture_hpw2m") 41 | }], 42 | "loop": true, 43 | "name": &"default", 44 | "speed": 15.0 45 | }] 46 | 47 | [sub_resource type="CircleShape2D" id="CircleShape2D_bk4cl"] 48 | radius = 15.0923 49 | 50 | [sub_resource type="CircleShape2D" id="CircleShape2D_6gp4s"] 51 | radius = 7.0 52 | 53 | [node name="BlackFly" instance=ExtResource("1_5wxj1")] 54 | process_mode = 4 55 | y_sort_enabled = true 56 | scale = Vector2(0.6, 0.6) 57 | collision_layer = 8 58 | character_stats = SubResource("Resource_xpmbt") 59 | physics_stats = SubResource("Resource_a0bdi") 60 | 61 | [node name="Visual" parent="." index="0"] 62 | script = ExtResource("2_w4t8f") 63 | 64 | [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Visual" index="0"] 65 | position = Vector2(0, -52) 66 | sprite_frames = SubResource("SpriteFrames_xrf4e") 67 | autoplay = "default" 68 | 69 | [node name="Shadow" type="Sprite2D" parent="Visual" index="1"] 70 | modulate = Color(1, 1, 1, 0.384314) 71 | scale = Vector2(0.298658, 0.3) 72 | texture = ExtResource("3_m8u5l") 73 | 74 | [node name="MeleeWeapon" parent="Visual" index="2" instance=ExtResource("7_g7bvv")] 75 | 76 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Visual/MeleeWeapon" index="0"] 77 | shape = SubResource("CircleShape2D_bk4cl") 78 | 79 | [node name="Behavior" parent="." index="1"] 80 | script = ExtResource("7_g1frr") 81 | 82 | [node name="CollisionShape2D" type="CollisionShape2D" parent="." index="2"] 83 | shape = SubResource("CircleShape2D_6gp4s") 84 | -------------------------------------------------------------------------------- /tiny_wizard/enemies/black_fly/black_fly_behavior.gd: -------------------------------------------------------------------------------- 1 | extends QuiverCharacterBehavior 2 | 3 | 4 | const SPEED = .6 5 | const CHANGE_DIRECTION_TIME = 1.0 6 | var _t := randf()*CHANGE_DIRECTION_TIME 7 | 8 | 9 | func _process(delta): 10 | _t -= delta 11 | if _t <= 0: 12 | action.moving_direction = Vector2.RIGHT.rotated(randf()*2*PI) 13 | _t = CHANGE_DIRECTION_TIME 14 | 15 | func on_wall_collision(collision: KinematicCollision2D)->void: 16 | action.moving_direction = collision.get_normal() 17 | -------------------------------------------------------------------------------- /tiny_wizard/enemies/black_fly/black_fly_weapon.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=3 uid="uid://beoi1j37lxqnc"] 2 | 3 | [ext_resource type="PackedScene" path="res://top-down-shooter-core/weapons/melee_weapon.tscn" id="1_n8l2s"] 4 | 5 | [node name="MeleeWeapon" instance=ExtResource("1_n8l2s")] 6 | collision_mask = 2 7 | damage = 1.0 8 | -------------------------------------------------------------------------------- /tiny_wizard/enemies/red_fly/red_fly.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=18 format=3 uid="uid://8gachgsj3jdx"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://ckan5lwiqvq2a" path="res://top-down-shooter-core/character/character.tscn" id="1_5wxj1"] 4 | [ext_resource type="Script" path="res://top-down-shooter-core/character/character_stats/character_stats.gd" id="2_72r4n"] 5 | [ext_resource type="Script" path="res://tiny_wizard/enemies/black_fly/Visual.gd" id="2_w4t8f"] 6 | [ext_resource type="Script" path="res://top-down-shooter-core/character/character_stats/physics_stats.gd" id="3_acbgk"] 7 | [ext_resource type="Texture2D" uid="uid://cjjugml0purnn" path="res://tiny_wizard/assets/placeholder_art/shadow.png" id="3_m8u5l"] 8 | [ext_resource type="Texture2D" uid="uid://c20wpkdou740u" path="res://tiny_wizard/assets/placeholder_art/red_fly.png" id="5_sbtwb"] 9 | [ext_resource type="Script" path="res://tiny_wizard/enemies/red_fly/red_fly_behavior.gd" id="7_a27uj"] 10 | [ext_resource type="PackedScene" uid="uid://c81dr52jie1dv" path="res://tiny_wizard/enemies/red_fly/red_fly_weapon.tscn" id="7_g7bvv"] 11 | [ext_resource type="PackedScene" uid="uid://cbx5e1m0wvfyn" path="res://top-down-shooter-core/character/behavior/behavior_modules/player_detector.tscn" id="8_8aefy"] 12 | 13 | [sub_resource type="Resource" id="Resource_l4q4c"] 14 | resource_local_to_scene = true 15 | script = ExtResource("2_72r4n") 16 | max_life = 3 17 | 18 | [sub_resource type="Resource" id="Resource_d044m"] 19 | resource_local_to_scene = true 20 | script = ExtResource("3_acbgk") 21 | max_speed = 90.0 22 | acceleration = 0.4 23 | friction = 0.1 24 | impulse_force = 500.0 25 | 26 | [sub_resource type="AtlasTexture" id="AtlasTexture_g200e"] 27 | atlas = ExtResource("5_sbtwb") 28 | region = Rect2(0, 0, 60, 60) 29 | 30 | [sub_resource type="AtlasTexture" id="AtlasTexture_qrmuw"] 31 | atlas = ExtResource("5_sbtwb") 32 | region = Rect2(60, 0, 60, 60) 33 | 34 | [sub_resource type="SpriteFrames" id="SpriteFrames_63q4l"] 35 | animations = [{ 36 | "frames": [{ 37 | "duration": 1.0, 38 | "texture": SubResource("AtlasTexture_g200e") 39 | }, { 40 | "duration": 1.0, 41 | "texture": SubResource("AtlasTexture_qrmuw") 42 | }], 43 | "loop": true, 44 | "name": &"default", 45 | "speed": 15.0 46 | }] 47 | 48 | [sub_resource type="CircleShape2D" id="CircleShape2D_bk4cl"] 49 | radius = 15.0923 50 | 51 | [sub_resource type="CircleShape2D" id="CircleShape2D_qgtul"] 52 | radius = 253.333 53 | 54 | [sub_resource type="CircleShape2D" id="CircleShape2D_6gp4s"] 55 | radius = 7.0 56 | 57 | [node name="RedFly" instance=ExtResource("1_5wxj1")] 58 | process_mode = 4 59 | y_sort_enabled = true 60 | scale = Vector2(0.6, 0.6) 61 | disable_mode = 1 62 | collision_layer = 8 63 | character_stats = SubResource("Resource_l4q4c") 64 | physics_stats = SubResource("Resource_d044m") 65 | 66 | [node name="Visual" parent="." index="0"] 67 | script = ExtResource("2_w4t8f") 68 | 69 | [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Visual" index="0"] 70 | position = Vector2(0, -52) 71 | sprite_frames = SubResource("SpriteFrames_63q4l") 72 | autoplay = "default" 73 | 74 | [node name="Shadow" type="Sprite2D" parent="Visual" index="1"] 75 | modulate = Color(1, 1, 1, 0.384314) 76 | scale = Vector2(0.298658, 0.3) 77 | texture = ExtResource("3_m8u5l") 78 | 79 | [node name="MeleeWeapon" parent="Visual" index="2" instance=ExtResource("7_g7bvv")] 80 | 81 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Visual/MeleeWeapon" index="0"] 82 | shape = SubResource("CircleShape2D_bk4cl") 83 | 84 | [node name="Behavior" parent="." index="1"] 85 | visible = false 86 | script = ExtResource("7_a27uj") 87 | 88 | [node name="PlayerDetector" parent="Behavior" index="0" instance=ExtResource("8_8aefy")] 89 | 90 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Behavior/PlayerDetector" index="0"] 91 | modulate = Color(0.52549, 1, 0.333333, 0.282353) 92 | z_index = -1 93 | shape = SubResource("CircleShape2D_qgtul") 94 | 95 | [node name="CollisionShape2D" type="CollisionShape2D" parent="." index="2"] 96 | shape = SubResource("CircleShape2D_6gp4s") 97 | -------------------------------------------------------------------------------- /tiny_wizard/enemies/red_fly/red_fly_behavior.gd: -------------------------------------------------------------------------------- 1 | extends QuiverCharacterBehavior 2 | 3 | 4 | const CHANGE_DIRECTION_TIME = 2.0 5 | 6 | var _t := randf()*CHANGE_DIRECTION_TIME 7 | 8 | var _random_movement := Vector2.ZERO 9 | var _player_movement := Vector2.ZERO 10 | 11 | @onready var player_detector := $PlayerDetector 12 | 13 | func _process(delta): 14 | _t -= delta 15 | if _t <= 0: 16 | _random_movement = Vector2.RIGHT.rotated(randf()*2*PI) 17 | _t = CHANGE_DIRECTION_TIME 18 | 19 | if player_detector.player_is_in_range(): 20 | _player_movement = 0.33*global_position.direction_to(player_detector.get_player_position()) 21 | else: 22 | _player_movement = Vector2.ZERO 23 | 24 | action.moving_direction = _random_movement + 5*_player_movement 25 | 26 | func on_wall_collision(collision: KinematicCollision2D)->void: 27 | action.moving_direction = collision.get_normal() 28 | -------------------------------------------------------------------------------- /tiny_wizard/enemies/red_fly/red_fly_weapon.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=3 uid="uid://c81dr52jie1dv"] 2 | 3 | [ext_resource type="PackedScene" path="res://top-down-shooter-core/weapons/melee_weapon.tscn" id="1_n8l2s"] 4 | 5 | [node name="MeleeWeapon" instance=ExtResource("1_n8l2s")] 6 | collision_mask = 2 7 | damage = 1.0 8 | -------------------------------------------------------------------------------- /tiny_wizard/gui/gui.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=10 format=3 uid="uid://c45gqa1w6c20d"] 2 | 3 | [ext_resource type="Script" path="res://tiny_wizard/gui/ui_manager.gd" id="1_56tem"] 4 | [ext_resource type="Texture2D" uid="uid://w04k0h8orxb6" path="res://tiny_wizard/assets/placeholder_art/gui/ui_background.png" id="2_2gyvq"] 5 | [ext_resource type="Texture2D" uid="uid://c33vhuxnggir3" path="res://tiny_wizard/assets/placeholder_art/icon_mini.png" id="3_hwuvp"] 6 | [ext_resource type="PackedScene" path="res://tiny_wizard/gui/inventory_ui/inventory_ui.tscn" id="4_80vvw"] 7 | [ext_resource type="PackedScene" path="res://tiny_wizard/gui/life_ui/hearts_ui.tscn" id="5_7glrf"] 8 | [ext_resource type="Resource" path="res://tiny_wizard/player/player_stats.tres" id="6_mshvq"] 9 | [ext_resource type="Texture2D" uid="uid://cuwusijx2588i" path="res://tiny_wizard/assets/art/arrow.png" id="7_8th4j"] 10 | 11 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_fe4ma"] 12 | 13 | [sub_resource type="AtlasTexture" id="AtlasTexture_sf2fl"] 14 | atlas = ExtResource("7_8th4j") 15 | region = Rect2(0, 0, 100, 100) 16 | 17 | [node name="GUI" type="CanvasLayer"] 18 | layer = 0 19 | script = ExtResource("1_56tem") 20 | 21 | [node name="TopUI" type="Control" parent="."] 22 | layout_mode = 3 23 | anchors_preset = 15 24 | anchor_right = 1.0 25 | anchor_bottom = 1.0 26 | offset_bottom = -800.0 27 | grow_horizontal = 2 28 | grow_vertical = 2 29 | 30 | [node name="TextureRect" type="TextureRect" parent="TopUI"] 31 | anchors_preset = 10 32 | anchor_right = 1.0 33 | offset_bottom = 203.0 34 | grow_horizontal = 2 35 | texture = ExtResource("2_2gyvq") 36 | stretch_mode = 2 37 | 38 | [node name="MarginContainer" type="MarginContainer" parent="TopUI/TextureRect"] 39 | anchors_preset = 15 40 | anchor_right = 1.0 41 | anchor_bottom = 1.0 42 | theme_override_constants/margin_bottom = 20 43 | 44 | [node name="HBoxContainer" type="HBoxContainer" parent="TopUI/TextureRect/MarginContainer"] 45 | offset_right = 1024.0 46 | offset_bottom = 183.0 47 | 48 | [node name="VSeparator2" type="VSeparator" parent="TopUI/TextureRect/MarginContainer/HBoxContainer"] 49 | offset_right = 50.0 50 | offset_bottom = 183.0 51 | theme_override_constants/separation = 50 52 | theme_override_styles/separator = SubResource("StyleBoxFlat_fe4ma") 53 | 54 | [node name="Icon" type="TextureRect" parent="TopUI/TextureRect/MarginContainer/HBoxContainer"] 55 | offset_left = 54.0 56 | offset_right = 354.0 57 | offset_bottom = 183.0 58 | size_flags_horizontal = 3 59 | texture = ExtResource("3_hwuvp") 60 | stretch_mode = 3 61 | 62 | [node name="InventoryUI" parent="TopUI/TextureRect/MarginContainer/HBoxContainer" instance=ExtResource("4_80vvw")] 63 | offset_left = 358.0 64 | offset_right = 400.0 65 | offset_bottom = 183.0 66 | 67 | [node name="VSeparator" type="VSeparator" parent="TopUI/TextureRect/MarginContainer/HBoxContainer"] 68 | offset_left = 404.0 69 | offset_right = 414.0 70 | offset_bottom = 183.0 71 | theme_override_constants/separation = 10 72 | theme_override_styles/separator = SubResource("StyleBoxFlat_fe4ma") 73 | 74 | [node name="MarginContainer" type="MarginContainer" parent="TopUI/TextureRect/MarginContainer/HBoxContainer"] 75 | offset_left = 418.0 76 | offset_right = 719.0 77 | offset_bottom = 183.0 78 | size_flags_horizontal = 3 79 | 80 | [node name="HeartsUI" parent="TopUI/TextureRect/MarginContainer/HBoxContainer" instance=ExtResource("5_7glrf")] 81 | anchor_right = 0.0 82 | anchor_bottom = 0.0 83 | offset_left = 871.0 84 | offset_right = 875.0 85 | offset_bottom = 183.0 86 | size_flags_horizontal = 6 87 | player_stats = ExtResource("6_mshvq") 88 | 89 | [node name="CenterContainer" type="CenterContainer" parent="TopUI/TextureRect"] 90 | anchors_preset = 15 91 | anchor_right = 1.0 92 | anchor_bottom = 1.0 93 | offset_bottom = -23.0 94 | 95 | [node name="ArrowUITexture" type="TextureRect" parent="TopUI/TextureRect/CenterContainer"] 96 | unique_name_in_owner = true 97 | offset_left = 462.0 98 | offset_top = 40.0 99 | offset_right = 562.0 100 | offset_bottom = 140.0 101 | grow_horizontal = 2 102 | grow_vertical = 2 103 | texture = SubResource("AtlasTexture_sf2fl") 104 | stretch_mode = 5 105 | metadata/_edit_layout_mode = 1 106 | -------------------------------------------------------------------------------- /tiny_wizard/gui/inventory_ui/inventory_ui.gd: -------------------------------------------------------------------------------- 1 | extends MarginContainer 2 | 3 | @export var inventory : QuiverInventory 4 | 5 | 6 | @onready var counters = { 7 | 'Bomb': $VBoxContainer/Bombs/BombsCount, 8 | 'Key': $VBoxContainer/Keys/KeysCount, 9 | 'Coin': $VBoxContainer/Coins/CoinsCount, 10 | } 11 | 12 | func _ready(): 13 | (inventory as QuiverInventory).item_changed.connect(self.item_changed) 14 | 15 | func item_changed(item:QuiverItem): 16 | if counters.has(item.name): 17 | counters[item.name].text = str(inventory.get_item_amount(item)) 18 | -------------------------------------------------------------------------------- /tiny_wizard/gui/inventory_ui/inventory_ui.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=3] 2 | 3 | [ext_resource type="Script" path="res://tiny_wizard/gui/inventory_ui/inventory_ui.gd" id="1_41nm0"] 4 | [ext_resource type="Resource" uid="uid://bpvgw7v25bbsx" path="res://tiny_wizard/player/inventory/inventory.tres" id="2_6tb0s"] 5 | [ext_resource type="Texture2D" uid="uid://b3dbadwmldu6u" path="res://tiny_wizard/assets/placeholder_art/gui/coin.png" id="3_x7efp"] 6 | [ext_resource type="Texture2D" path="res://tiny_wizard/assets/placeholder_art/gui/bomb_icon.png" id="4_ojjo4"] 7 | [ext_resource type="Texture2D" path="res://tiny_wizard/assets/placeholder_art/gui/key.png" id="5_skni8"] 8 | 9 | [node name="InventoryUI" type="MarginContainer"] 10 | offset_right = 40.0 11 | offset_bottom = 40.0 12 | script = ExtResource( "1_41nm0" ) 13 | inventory = ExtResource( "2_6tb0s" ) 14 | 15 | [node name="VBoxContainer" type="VBoxContainer" parent="."] 16 | offset_right = 42.0 17 | offset_bottom = 97.0 18 | theme_override_constants/separation = 6 19 | alignment = 1 20 | 21 | [node name="Coins" type="HBoxContainer" parent="VBoxContainer"] 22 | offset_right = 42.0 23 | offset_bottom = 26.0 24 | 25 | [node name="CoinsCount" type="Label" parent="VBoxContainer/Coins"] 26 | offset_right = 10.0 27 | offset_bottom = 26.0 28 | theme_override_colors/font_color = Color(0, 0, 0, 1) 29 | text = "0" 30 | 31 | [node name="CoinsIcon" type="TextureRect" parent="VBoxContainer/Coins"] 32 | offset_left = 14.0 33 | offset_right = 42.0 34 | offset_bottom = 26.0 35 | texture = ExtResource( "3_x7efp" ) 36 | stretch_mode = 3 37 | 38 | [node name="Bombs" type="HBoxContainer" parent="VBoxContainer"] 39 | offset_top = 32.0 40 | offset_right = 42.0 41 | offset_bottom = 65.0 42 | 43 | [node name="BombsCount" type="Label" parent="VBoxContainer/Bombs"] 44 | offset_top = 3.0 45 | offset_right = 10.0 46 | offset_bottom = 29.0 47 | theme_override_colors/font_color = Color(0, 0, 0, 1) 48 | text = "0" 49 | 50 | [node name="BombsIcon" type="TextureRect" parent="VBoxContainer/Bombs"] 51 | offset_left = 14.0 52 | offset_right = 40.0 53 | offset_bottom = 33.0 54 | texture = ExtResource( "4_ojjo4" ) 55 | stretch_mode = 3 56 | 57 | [node name="Keys" type="HBoxContainer" parent="VBoxContainer"] 58 | offset_top = 71.0 59 | offset_right = 42.0 60 | offset_bottom = 97.0 61 | 62 | [node name="KeysCount" type="Label" parent="VBoxContainer/Keys"] 63 | offset_right = 10.0 64 | offset_bottom = 26.0 65 | theme_override_colors/font_color = Color(0, 0, 0, 1) 66 | text = "0" 67 | 68 | [node name="KeysIcon" type="TextureRect" parent="VBoxContainer/Keys"] 69 | offset_left = 14.0 70 | offset_right = 40.0 71 | offset_bottom = 26.0 72 | texture = ExtResource( "5_skni8" ) 73 | stretch_mode = 3 74 | -------------------------------------------------------------------------------- /tiny_wizard/gui/life_ui/heart/heart.gd: -------------------------------------------------------------------------------- 1 | extends TextureRect 2 | 3 | enum {EMPTY, HALF, FULL, FULL_SHIELD, HALF_SHIELD} 4 | 5 | var textures = [ 6 | preload("res://tiny_wizard/assets/placeholder_art/gui/empty_heart.png"), 7 | preload("res://tiny_wizard/assets/placeholder_art/gui/half_heart.png"), 8 | preload("res://tiny_wizard/assets/placeholder_art/gui/heart.png"), 9 | preload("res://tiny_wizard/assets/placeholder_art/gui/shield.png"), 10 | preload("res://tiny_wizard/assets/placeholder_art/gui/half_shield.png"), 11 | ] 12 | 13 | func set_state(state): 14 | texture = textures[state] 15 | 16 | -------------------------------------------------------------------------------- /tiny_wizard/gui/life_ui/heart/heart.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=3] 2 | 3 | [ext_resource type="Texture2D" uid="uid://cg8la57q1t6iy" path="res://tiny_wizard/assets/placeholder_art/gui/Heart.png" id="1_ndnps"] 4 | [ext_resource type="Script" path="res://tiny_wizard/gui/life_ui/heart/heart.gd" id="2_ki61j"] 5 | 6 | [node name="Heart" type="TextureRect"] 7 | offset_right = 35.0 8 | offset_bottom = 226.0 9 | texture = ExtResource( "1_ndnps" ) 10 | stretch_mode = 3 11 | script = ExtResource( "2_ki61j" ) 12 | -------------------------------------------------------------------------------- /tiny_wizard/gui/life_ui/hearts_ui.gd: -------------------------------------------------------------------------------- 1 | extends "res://top-down-shooter-core/gui/player_ui/player_ui.gd" 2 | 3 | const HEART_SCENE = preload("res://tiny_wizard/gui/life_ui/heart/heart.tscn") 4 | 5 | var max_life := 0 6 | 7 | enum {EMPTY, HALF, FULL, FULL_SHIELD, HALF_SHIELD} 8 | 9 | @onready var heart_container = $HBoxContainer/HeartContainer 10 | @onready var shield_container = $HBoxContainer/ShieldContainer 11 | 12 | func _ready(): 13 | super._ready() 14 | update_ui() 15 | 16 | func update_ui(): 17 | # label.text = "%d/%d" % [player_stats.current_life, player_stats.max_life] 18 | 19 | if player_stats.max_life != max_life: 20 | var difference = (player_stats.max_life - max_life)/2 21 | 22 | if difference > 0: 23 | for i in range(difference): 24 | # Create Heart 25 | var heart = HEART_SCENE.instantiate() 26 | heart_container.add_child(heart) 27 | else: 28 | var to_remove = [] 29 | for i in range(-difference): 30 | to_remove.append(heart_container.get_child(i)) 31 | for h in to_remove: 32 | heart_container.remove_child(h) 33 | h.queue_free() 34 | 35 | max_life = player_stats.max_life 36 | 37 | var life = player_stats.current_life 38 | 39 | for heart in heart_container.get_children(): 40 | if life>=2: 41 | heart.set_state(FULL) 42 | life-=2 43 | elif life == 1: 44 | heart.set_state(HALF) 45 | life -= 1 46 | elif life <= 0: 47 | heart.set_state(EMPTY) 48 | 49 | var shield_count = player_stats.current_shield 50 | var difference = (shield_count+1) / 2 - shield_container.get_child_count() 51 | if difference > 0: 52 | for i in range(difference): 53 | var shield = HEART_SCENE.instantiate() 54 | shield_container.add_child(shield) 55 | else: 56 | var to_remove = [] 57 | for i in range(-difference): 58 | to_remove.append(shield_container.get_child(i)) 59 | for s in to_remove: 60 | shield_container.remove_child(s) 61 | s.queue_free() 62 | 63 | for shield in shield_container.get_children(): 64 | 65 | if shield_count>=2: 66 | shield.set_state(FULL_SHIELD) 67 | shield_count-=2 68 | elif shield_count == 1: 69 | shield.set_state(HALF_SHIELD) 70 | shield_count -= 1 71 | elif shield_count <= 0: 72 | shield.set_state(EMPTY) 73 | -------------------------------------------------------------------------------- /tiny_wizard/gui/life_ui/hearts_ui.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=3] 2 | 3 | [ext_resource type="Script" path="res://tiny_wizard/gui/life_ui/hearts_ui.gd" id="1_tvc6f"] 4 | 5 | [node name="HeartsUI" type="MarginContainer"] 6 | anchor_right = 1.0 7 | anchor_bottom = 1.0 8 | offset_right = -997.0 9 | offset_bottom = -574.0 10 | grow_horizontal = 2 11 | grow_vertical = 2 12 | script = ExtResource( "1_tvc6f" ) 13 | 14 | [node name="HBoxContainer" type="HBoxContainer" parent="."] 15 | offset_right = 27.0 16 | offset_bottom = 226.0 17 | 18 | [node name="HeartContainer" type="HBoxContainer" parent="HBoxContainer"] 19 | offset_bottom = 226.0 20 | 21 | [node name="ShieldContainer" type="HBoxContainer" parent="HBoxContainer"] 22 | offset_left = 4.0 23 | offset_right = 4.0 24 | offset_bottom = 226.0 25 | -------------------------------------------------------------------------------- /tiny_wizard/gui/ui_manager.gd: -------------------------------------------------------------------------------- 1 | extends CanvasLayer 2 | 3 | 4 | @export var inventory : QuiverInventory 5 | 6 | 7 | func change_arrow_texture(new_texture): 8 | %ArrowUITexture.texture = new_texture 9 | -------------------------------------------------------------------------------- /tiny_wizard/interactable_objects/bump_animation.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Animation" format=3 uid="uid://c3yupmoyqxfo2"] 2 | 3 | [resource] 4 | -------------------------------------------------------------------------------- /tiny_wizard/interactable_objects/chests/chest.gd: -------------------------------------------------------------------------------- 1 | extends QuiverInteractableObject 2 | 3 | @export var items := [] 4 | 5 | func _ready(): 6 | super._ready() 7 | action.items = items 8 | -------------------------------------------------------------------------------- /tiny_wizard/interactable_objects/chests/chest.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=8 format=3 uid="uid://bu83qkq8qqvg6"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://c3bp3q2valq35" path="res://tiny_wizard/interactable_objects/default_interactable_object/interact_on_collide.tscn" id="1_1y646"] 4 | [ext_resource type="Script" path="res://tiny_wizard/interactable_objects/chests/chest.gd" id="2_lsfc8"] 5 | [ext_resource type="Texture2D" uid="uid://cnp2uemdmxsd3" path="res://tiny_wizard/assets/placeholder_art/chests/normal_chest_closed.png" id="3_l3g5r"] 6 | [ext_resource type="Script" path="res://tiny_wizard/interactable_objects/chests/chest_sprite.gd" id="3_ne01s"] 7 | [ext_resource type="Script" path="res://tiny_wizard/interactable_objects/chests/open_chest.gd" id="4_3i1hb"] 8 | [ext_resource type="Texture2D" uid="uid://bmgtdcttnlmjl" path="res://tiny_wizard/assets/placeholder_art/chests/normal_chest_open.png" id="5_6k8xq"] 9 | 10 | [sub_resource type="CircleShape2D" id="CircleShape2D_yy5pk"] 11 | radius = 16.0 12 | 13 | [node name="Chest" instance=ExtResource("1_1y646")] 14 | script = ExtResource("2_lsfc8") 15 | items = null 16 | metadata/items = [] 17 | 18 | [node name="Object" parent="RigidBody2D" index="0"] 19 | position = Vector2(2, -21) 20 | z_index = -1 21 | y_sort_enabled = true 22 | texture = ExtResource("3_l3g5r") 23 | script = ExtResource("3_ne01s") 24 | open_texture = ExtResource("5_6k8xq") 25 | 26 | [node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D" index="1"] 27 | position = Vector2(1, -17) 28 | shape = SubResource("CircleShape2D_yy5pk") 29 | 30 | [node name="Action" parent="." index="1"] 31 | script = ExtResource("4_3i1hb") 32 | chest_sprite = NodePath("../RigidBody2D/Object") 33 | -------------------------------------------------------------------------------- /tiny_wizard/interactable_objects/chests/chest_sprite.gd: -------------------------------------------------------------------------------- 1 | extends Sprite2D 2 | 3 | @export var open_texture : Texture 4 | 5 | func open(): 6 | texture = open_texture 7 | -------------------------------------------------------------------------------- /tiny_wizard/interactable_objects/chests/locked_chest.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=9 format=3 uid="uid://o3yevur5onpt"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://c3bp3q2valq35" path="res://tiny_wizard/interactable_objects/default_interactable_object/interact_on_collide.tscn" id="1_1y646"] 4 | [ext_resource type="Texture2D" path="res://tiny_wizard/assets/placeholder_art/Chests/gold_chest_closed.png" id="2_jbyk4"] 5 | [ext_resource type="Script" path="res://tiny_wizard/interactable_objects/chests/chest.gd" id="2_rarlb"] 6 | [ext_resource type="Script" path="res://tiny_wizard/interactable_objects/chests/chest_sprite.gd" id="3_ne01s"] 7 | [ext_resource type="Script" path="res://tiny_wizard/interactable_objects/chests/open_chest.gd" id="4_3i1hb"] 8 | [ext_resource type="Texture2D" path="res://tiny_wizard/assets/placeholder_art/Chests/gold_chest_open.png" id="4_k3duw"] 9 | [ext_resource type="Texture2D" uid="uid://u2qrtjpgbv2k" path="res://tiny_wizard/assets/placeholder_art/shadow.png" id="5_7l7pb"] 10 | 11 | [sub_resource type="CircleShape2D" id="CircleShape2D_yy5pk"] 12 | radius = 16.0 13 | 14 | [node name="Chest" instance=ExtResource("1_1y646")] 15 | script = ExtResource("2_rarlb") 16 | items = null 17 | metadata/items = [] 18 | 19 | [node name="Object" parent="RigidBody2D" index="0"] 20 | position = Vector2(0, -1) 21 | y_sort_enabled = true 22 | texture = ExtResource("2_jbyk4") 23 | offset = Vector2(3, -20) 24 | script = ExtResource("3_ne01s") 25 | open_texture = ExtResource("4_k3duw") 26 | 27 | [node name="Shadow" type="Sprite2D" parent="RigidBody2D" index="1"] 28 | modulate = Color(1, 1, 1, 0.6) 29 | position = Vector2(3, -6) 30 | scale = Vector2(0.671053, 0.555556) 31 | z_index = -1 32 | texture = ExtResource("5_7l7pb") 33 | 34 | [node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D" index="2"] 35 | position = Vector2(1, -17) 36 | shape = SubResource("CircleShape2D_yy5pk") 37 | 38 | [node name="Action" parent="." index="1"] 39 | script = ExtResource("4_3i1hb") 40 | chest_sprite = NodePath("../RigidBody2D/Object") 41 | locked = true 42 | -------------------------------------------------------------------------------- /tiny_wizard/interactable_objects/chests/open_chest.gd: -------------------------------------------------------------------------------- 1 | extends QuiverInteractableObjectAction 2 | 3 | # The items to spawn (an array of QuiverPickableItem packed scenes) 4 | var items := [] 5 | # The path to the sprite to change it's texture to open 6 | @export var chest_sprite: NodePath 7 | # Enable this to create a locked chest that will consume a key to open 8 | @export var locked:= false 9 | 10 | @onready var chest = get_node(chest_sprite) 11 | 12 | func trigger(object: QuiverInteractableObject, character: QuiverCharacter): 13 | var next_action = get_node_or_null("OnFailure") 14 | 15 | if active: 16 | if character.can_grab_items: 17 | 18 | if locked: 19 | if (character.inventory as QuiverInventory).get_item_amount("Key") > 0: 20 | character.inventory.remove_item("Key") 21 | else: 22 | # We cannot open it so we stop here 23 | if next_action is QuiverInteractableObjectAction: 24 | # Trigger next action 25 | next_action.trigger(object, character) 26 | return 27 | 28 | # Opening the chest 29 | next_action = get_node_or_null("OnSuccess") 30 | # We don't want to open again after 31 | active = false 32 | # Visual opening 33 | chest.open() 34 | # Spawn items 35 | for item in items: 36 | if item is QuiverItem: 37 | var item_node = item.create_pickable_item() 38 | item_node.position = object.position + chest.get_parent().position 39 | object.call_deferred("add_sibling", item_node) 40 | 41 | if next_action is QuiverInteractableObjectAction: 42 | # Trigger next action 43 | next_action.trigger(object, character) 44 | -------------------------------------------------------------------------------- /tiny_wizard/interactable_objects/default_interactable_object/interact_on_collide.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=10 format=3 uid="uid://c3bp3q2valq35"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://bkc8i2tfohtub" path="res://top-down-shooter-core/interactable_objects/interactable_object.tscn" id="1_h53o5"] 4 | [ext_resource type="Script" path="res://top-down-shooter-core/interactable_objects/actions/play_animation.gd" id="2_1ayrx"] 5 | [ext_resource type="Script" path="res://top-down-shooter-core/interactable_objects/interact_mechanics/interact_on_collide.gd" id="2_ykpmf"] 6 | [ext_resource type="AnimationLibrary" uid="uid://04e7u2gpyy16" path="res://tiny_wizard/interactable_objects/objects_anim_lib.tres" id="3_nqbdb"] 7 | 8 | [sub_resource type="PhysicsMaterial" id="PhysicsMaterial_3dhe5"] 9 | friction = 0.0 10 | bounce = 0.65 11 | 12 | [sub_resource type="Animation" id="Animation_32cud"] 13 | length = 0.001 14 | tracks/0/type = "value" 15 | tracks/0/imported = false 16 | tracks/0/enabled = true 17 | tracks/0/path = NodePath("../RigidBody2D/Object:scale") 18 | tracks/0/interp = 1 19 | tracks/0/loop_wrap = true 20 | tracks/0/keys = { 21 | "times": PackedFloat32Array(0), 22 | "transitions": PackedFloat32Array(1), 23 | "update": 0, 24 | "values": [Vector2(1, 1)] 25 | } 26 | 27 | [sub_resource type="Animation" id="Animation_xtw0f"] 28 | resource_name = "bump" 29 | length = 0.2 30 | tracks/0/type = "value" 31 | tracks/0/imported = false 32 | tracks/0/enabled = true 33 | tracks/0/path = NodePath("../RigidBody2D/Object:scale") 34 | tracks/0/interp = 1 35 | tracks/0/loop_wrap = true 36 | tracks/0/keys = { 37 | "times": PackedFloat32Array(0, 0.1, 0.2), 38 | "transitions": PackedFloat32Array(1, 1, 1), 39 | "update": 0, 40 | "values": [Vector2(1, 1), Vector2(0.8, 0.8), Vector2(1, 1)] 41 | } 42 | 43 | [sub_resource type="AnimationLibrary" id="AnimationLibrary_d2gsa"] 44 | _data = { 45 | "RESET": SubResource("Animation_32cud"), 46 | "bump": SubResource("Animation_xtw0f") 47 | } 48 | 49 | [sub_resource type="AnimationLibrary" id="AnimationLibrary_cdgy0"] 50 | 51 | [node name="InteractableObject" instance=ExtResource("1_h53o5")] 52 | y_sort_enabled = true 53 | 54 | [node name="RigidBody2D" type="RigidBody2D" parent="." index="0"] 55 | y_sort_enabled = true 56 | collision_layer = 16 57 | collision_mask = 115 58 | inertia = 1.0 59 | physics_material_override = SubResource("PhysicsMaterial_3dhe5") 60 | gravity_scale = 0.0 61 | contact_monitor = true 62 | lock_rotation = true 63 | linear_damp = 54.058 64 | 65 | [node name="Object" type="Sprite2D" parent="RigidBody2D" index="0"] 66 | 67 | [node name="OnSuccess" type="Node2D" parent="Action" index="0"] 68 | 69 | [node name="OnFailure" type="Node2D" parent="Action" index="1"] 70 | script = ExtResource("2_1ayrx") 71 | animation_player_path = NodePath("../../AnimationPlayer") 72 | animation_name = "bump" 73 | 74 | [node name="InteractMechanic" parent="." index="2"] 75 | script = ExtResource("2_ykpmf") 76 | object_body_path = NodePath("../RigidBody2D") 77 | 78 | [node name="AnimationPlayer" type="AnimationPlayer" parent="." index="3"] 79 | root_node = NodePath("../Action") 80 | libraries = { 81 | "": SubResource("AnimationLibrary_d2gsa"), 82 | "Item": SubResource("AnimationLibrary_cdgy0"), 83 | "objects_anim_lib": ExtResource("3_nqbdb") 84 | } 85 | -------------------------------------------------------------------------------- /tiny_wizard/interactable_objects/objects_anim_lib.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="AnimationLibrary" format=3 uid="uid://04e7u2gpyy16"] 2 | 3 | [resource] 4 | -------------------------------------------------------------------------------- /tiny_wizard/items/coin/coin.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" load_steps=2 format=3 uid="uid://6d63alr8jx35"] 2 | 3 | [ext_resource type="Script" path="res://top-down-shooter-core/items/item.gd" id="1_isq16"] 4 | 5 | [resource] 6 | script = ExtResource( "1_isq16" ) 7 | name = "Coin" 8 | short_description = "A coin to get rich" 9 | long_description = null 10 | stackable = true 11 | stack_size = null 12 | pickable_item_scene = "res://tiny_wizard/items/coin/coin.tscn" 13 | -------------------------------------------------------------------------------- /tiny_wizard/items/coin/coin.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=10 format=3 uid="uid://buoxd7m1hsnru"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://23m7r5q686kd" path="res://tiny_wizard/items/default_items/default_add_to_inventory_item.tscn" id="1_cwhcf"] 4 | [ext_resource type="Resource" uid="uid://6d63alr8jx35" path="res://tiny_wizard/items/coin/coin.tres" id="2_7pv83"] 5 | [ext_resource type="Texture2D" uid="uid://b2r5s5tmvnlt2" path="res://tiny_wizard/assets/placeholder_art/items/coin.png" id="2_p00h8"] 6 | [ext_resource type="AnimationLibrary" uid="uid://04e7u2gpyy16" path="res://tiny_wizard/interactable_objects/objects_anim_lib.tres" id="4_0aogv"] 7 | 8 | [sub_resource type="CircleShape2D" id="CircleShape2D_7afo6"] 9 | radius = 10.0499 10 | 11 | [sub_resource type="Animation" id="Animation_32cud"] 12 | length = 0.001 13 | tracks/0/type = "value" 14 | tracks/0/imported = false 15 | tracks/0/enabled = true 16 | tracks/0/path = NodePath("../RigidBody2D/Item:scale") 17 | tracks/0/interp = 1 18 | tracks/0/loop_wrap = true 19 | tracks/0/keys = { 20 | "times": PackedFloat32Array(0), 21 | "transitions": PackedFloat32Array(1), 22 | "update": 0, 23 | "values": [Vector2(1, 1)] 24 | } 25 | 26 | [sub_resource type="Animation" id="Animation_xtw0f"] 27 | resource_name = "bump" 28 | length = 0.2 29 | tracks/0/type = "value" 30 | tracks/0/imported = false 31 | tracks/0/enabled = true 32 | tracks/0/path = NodePath("../RigidBody2D/Item:scale") 33 | tracks/0/interp = 1 34 | tracks/0/loop_wrap = true 35 | tracks/0/keys = { 36 | "times": PackedFloat32Array(0, 0.1, 0.2), 37 | "transitions": PackedFloat32Array(-2, -2, -2), 38 | "update": 0, 39 | "values": [Vector2(1, 1), Vector2(0.5, 0.5), Vector2(1, 1)] 40 | } 41 | 42 | [sub_resource type="AnimationLibrary" id="AnimationLibrary_d2gsa"] 43 | _data = { 44 | "RESET": SubResource( "Animation_32cud" ), 45 | "bump": SubResource( "Animation_xtw0f" ) 46 | } 47 | 48 | [sub_resource type="AnimationLibrary" id="AnimationLibrary_cdgy0"] 49 | 50 | [node name="Coin" instance=ExtResource( "1_cwhcf" )] 51 | item = ExtResource( "2_7pv83" ) 52 | 53 | [node name="CollisionShape2D" parent="RigidBody2D" index="0"] 54 | shape = SubResource( "CircleShape2D_7afo6" ) 55 | 56 | [node name="Item" parent="RigidBody2D" index="1"] 57 | position = Vector2(1, -1) 58 | texture = ExtResource( "2_p00h8" ) 59 | offset = Vector2(2, -5) 60 | 61 | [node name="OnFailure" parent="Action" index="1"] 62 | script = null 63 | 64 | [node name="AnimationPlayer" parent="." index="3"] 65 | libraries = { 66 | "": SubResource( "AnimationLibrary_d2gsa" ), 67 | "Item": SubResource( "AnimationLibrary_cdgy0" ), 68 | "objects_anim_lib": ExtResource( "4_0aogv" ) 69 | } 70 | -------------------------------------------------------------------------------- /tiny_wizard/items/default_items/default_add_to_inventory_item.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=3 uid="uid://23m7r5q686kd"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://djs45wxhgd1ma" path="res://tiny_wizard/items/default_items/default_item.tscn" id="1_t84cg"] 4 | [ext_resource type="Script" path="res://top-down-shooter-core/items/pickable_items/pick_item_actions/add_to_inventory.gd" id="2_cblrm"] 5 | 6 | [node name="DefaultAddToInventoryItem" instance=ExtResource( "1_t84cg" )] 7 | 8 | [node name="Action" parent="." index="1"] 9 | script = ExtResource( "2_cblrm" ) -------------------------------------------------------------------------------- /tiny_wizard/items/default_items/default_health_item.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=3 uid="uid://bv1ot60drqmx"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://djs45wxhgd1ma" path="res://tiny_wizard/items/default_items/default_item.tscn" id="1_ieg5c"] 4 | [ext_resource type="Resource" uid="uid://b6lwohkppiocx" path="res://tiny_wizard/items/default_items/heart.tres" id="2_ere8g"] 5 | [ext_resource type="Script" path="res://top-down-shooter-core/items/pickable_items/pick_item_actions/use_item.gd" id="3_7x3s4"] 6 | [ext_resource type="Texture2D" uid="uid://cmrwe7mljx85g" path="res://tiny_wizard/assets/placeholder_art/items/heart_full.png" id="3_q3oyd"] 7 | 8 | [node name="DefaultHealthItem" instance=ExtResource("1_ieg5c")] 9 | item = ExtResource("2_ere8g") 10 | 11 | [node name="Item" parent="RigidBody2D" index="1"] 12 | texture = ExtResource("3_q3oyd") 13 | 14 | [node name="Action" parent="." index="1"] 15 | script = ExtResource("3_7x3s4") 16 | -------------------------------------------------------------------------------- /tiny_wizard/items/default_items/default_item.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=13 format=3 uid="uid://djs45wxhgd1ma"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://d1wr7q5evnxmw" path="res://top-down-shooter-core/items/pickable_items/pickable_item.tscn" id="1_tuxjg"] 4 | [ext_resource type="Script" path="res://top-down-shooter-core/interactable_objects/interact_mechanics/interact_on_collide.gd" id="2_w8b4r"] 5 | [ext_resource type="Texture2D" uid="uid://cjjugml0purnn" path="res://tiny_wizard/assets/placeholder_art/shadow.png" id="2_wkavh"] 6 | [ext_resource type="AnimationLibrary" uid="uid://04e7u2gpyy16" path="res://tiny_wizard/interactable_objects/objects_anim_lib.tres" id="3_kwbxb"] 7 | [ext_resource type="Script" path="res://top-down-shooter-core/interactable_objects/actions/destroy_object.gd" id="3_x7lgx"] 8 | [ext_resource type="Script" path="res://top-down-shooter-core/interactable_objects/actions/play_animation.gd" id="4_qjjgh"] 9 | 10 | [sub_resource type="PhysicsMaterial" id="PhysicsMaterial_3dfhm"] 11 | friction = 100.0 12 | rough = true 13 | bounce = 0.35 14 | 15 | [sub_resource type="CircleShape2D" id="CircleShape2D_7afo6"] 16 | radius = 10.0499 17 | 18 | [sub_resource type="Animation" id="Animation_32cud"] 19 | length = 0.001 20 | tracks/0/type = "value" 21 | tracks/0/imported = false 22 | tracks/0/enabled = true 23 | tracks/0/path = NodePath("../RigidBody2D/Item:scale") 24 | tracks/0/interp = 1 25 | tracks/0/loop_wrap = true 26 | tracks/0/keys = { 27 | "times": PackedFloat32Array(0), 28 | "transitions": PackedFloat32Array(1), 29 | "update": 0, 30 | "values": [Vector2(1, 1)] 31 | } 32 | 33 | [sub_resource type="Animation" id="Animation_xtw0f"] 34 | resource_name = "bump" 35 | length = 0.2 36 | tracks/0/type = "value" 37 | tracks/0/imported = false 38 | tracks/0/enabled = true 39 | tracks/0/path = NodePath("../RigidBody2D/Item:scale") 40 | tracks/0/interp = 1 41 | tracks/0/loop_wrap = true 42 | tracks/0/keys = { 43 | "times": PackedFloat32Array(0, 0.1, 0.2), 44 | "transitions": PackedFloat32Array(1, 1, 1), 45 | "update": 0, 46 | "values": [Vector2(1, 1), Vector2(0.5, 0.5), Vector2(1, 1)] 47 | } 48 | 49 | [sub_resource type="AnimationLibrary" id="AnimationLibrary_d2gsa"] 50 | _data = { 51 | "RESET": SubResource("Animation_32cud"), 52 | "bump": SubResource("Animation_xtw0f") 53 | } 54 | 55 | [sub_resource type="AnimationLibrary" id="AnimationLibrary_cdgy0"] 56 | 57 | [node name="DefaultItem" instance=ExtResource("1_tuxjg")] 58 | y_sort_enabled = true 59 | 60 | [node name="RigidBody2D" type="RigidBody2D" parent="." index="0"] 61 | y_sort_enabled = true 62 | collision_layer = 16 63 | collision_mask = 115 64 | mass = 0.77 65 | inertia = 0.02 66 | physics_material_override = SubResource("PhysicsMaterial_3dfhm") 67 | gravity_scale = 0.0 68 | contact_monitor = true 69 | lock_rotation = true 70 | linear_damp = 6.541 71 | 72 | [node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D" index="0"] 73 | position = Vector2(1, -10) 74 | shape = SubResource("CircleShape2D_7afo6") 75 | 76 | [node name="Item" type="Sprite2D" parent="RigidBody2D" index="1"] 77 | position = Vector2(4, -13) 78 | 79 | [node name="Shadow" type="Sprite2D" parent="RigidBody2D" index="2"] 80 | modulate = Color(1, 1, 1, 0.709804) 81 | z_index = -1 82 | position = Vector2(2, -1) 83 | scale = Vector2(0.356781, 0.235315) 84 | texture = ExtResource("2_wkavh") 85 | 86 | [node name="OnSuccess" type="Node2D" parent="Action" index="0"] 87 | script = ExtResource("3_x7lgx") 88 | 89 | [node name="OnFailure" type="Node2D" parent="Action" index="1"] 90 | script = ExtResource("4_qjjgh") 91 | animation_player_path = NodePath("../../AnimationPlayer") 92 | animation_name = "bump" 93 | 94 | [node name="InteractMechanic" parent="." index="2"] 95 | script = ExtResource("2_w8b4r") 96 | object_body_path = NodePath("../RigidBody2D") 97 | 98 | [node name="AnimationPlayer" type="AnimationPlayer" parent="." index="3"] 99 | root_node = NodePath("../Action") 100 | libraries = { 101 | "": SubResource("AnimationLibrary_d2gsa"), 102 | "Item": SubResource("AnimationLibrary_cdgy0"), 103 | "objects_anim_lib": ExtResource("3_kwbxb") 104 | } 105 | -------------------------------------------------------------------------------- /tiny_wizard/items/default_items/heart.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="QuiverItem" load_steps=4 format=3 uid="uid://b6lwohkppiocx"] 2 | 3 | [ext_resource type="Script" path="res://top-down-shooter-core/items/item.gd" id="1_pdifm"] 4 | [ext_resource type="Script" path="res://top-down-shooter-core/items/use_actions/heal_character.gd" id="2_kc5xy"] 5 | 6 | [sub_resource type="Resource" id="Resource_b5sdn"] 7 | script = ExtResource("2_kc5xy") 8 | healing_type = 1 9 | healing_power = 1 10 | 11 | [resource] 12 | script = ExtResource("1_pdifm") 13 | name = "Full Heart" 14 | short_description = "A full heart to heal you" 15 | long_description = null 16 | stackable = null 17 | stack_size = null 18 | use_action = SubResource("Resource_b5sdn") 19 | pickable_item_scene = "null" 20 | -------------------------------------------------------------------------------- /tiny_wizard/items/hearts/full_heart.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" load_steps=4 format=3 uid="uid://02cbcdkekwct"] 2 | 3 | [ext_resource type="Script" path="res://top-down-shooter-core/items/item.gd" id="1_mco1f"] 4 | [ext_resource type="Script" path="res://top-down-shooter-core/items/use_actions/heal_character.gd" id="2_v3d6x"] 5 | 6 | [sub_resource type="Resource" id="Resource_agv5v"] 7 | script = ExtResource("2_v3d6x") 8 | healing_type = null 9 | healing_power = 2 10 | 11 | [resource] 12 | script = ExtResource("1_mco1f") 13 | name = "Full Heart" 14 | short_description = "A full heart to heal you" 15 | long_description = null 16 | stackable = null 17 | stack_size = null 18 | use_action = SubResource("Resource_agv5v") 19 | pickable_item_scene = "res://tiny_wizard/items/hearts/full_heart.tscn" 20 | -------------------------------------------------------------------------------- /tiny_wizard/items/hearts/full_heart.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=3 uid="uid://k0e5r0r012mk"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://bv1ot60drqmx" path="res://tiny_wizard/items/default_items/default_health_item.tscn" id="1_4vlia"] 4 | [ext_resource type="Resource" uid="uid://02cbcdkekwct" path="res://tiny_wizard/items/hearts/full_heart.tres" id="2_w24rq"] 5 | 6 | [node name="FullHeart" instance=ExtResource("1_4vlia")] 7 | item = ExtResource("2_w24rq") 8 | -------------------------------------------------------------------------------- /tiny_wizard/items/hearts/full_shield.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" load_steps=4 format=3 uid="uid://dpewqvfo4hw0f"] 2 | 3 | [ext_resource type="Script" path="res://top-down-shooter-core/items/item.gd" id="1_uckqt"] 4 | [ext_resource type="Script" path="res://top-down-shooter-core/items/use_actions/heal_character.gd" id="2_axfyc"] 5 | 6 | [sub_resource type="Resource" id="Resource_mr1x2"] 7 | script = ExtResource("2_axfyc") 8 | healing_type = 1 9 | healing_power = 2 10 | 11 | [resource] 12 | script = ExtResource("1_uckqt") 13 | name = "Full Shield" 14 | short_description = "A full shield to protect you" 15 | long_description = null 16 | stackable = null 17 | stack_size = null 18 | use_action = SubResource("Resource_mr1x2") 19 | pickable_item_scene = "res://tiny_wizard/items/hearts/full_shield.tscn" 20 | -------------------------------------------------------------------------------- /tiny_wizard/items/hearts/full_shield.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=3 uid="uid://xp8r02l2aycc"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://bv1ot60drqmx" path="res://tiny_wizard/items/default_items/default_health_item.tscn" id="1_shcai"] 4 | [ext_resource type="Resource" uid="uid://dpewqvfo4hw0f" path="res://tiny_wizard/items/hearts/full_shield.tres" id="2_5cres"] 5 | [ext_resource type="Texture2D" uid="uid://duvklaip1ycrp" path="res://tiny_wizard/assets/placeholder_art/items/shield_full.png" id="3_faysd"] 6 | 7 | [node name="FullShield" instance=ExtResource("1_shcai")] 8 | item = ExtResource("2_5cres") 9 | 10 | [node name="Item" parent="RigidBody2D" index="1"] 11 | texture = ExtResource("3_faysd") 12 | -------------------------------------------------------------------------------- /tiny_wizard/items/hearts/half_heart.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="QuiverItem" load_steps=4 format=3 uid="uid://dc56lnowd3urq"] 2 | 3 | [ext_resource type="Script" path="res://top-down-shooter-core/items/item.gd" id="1_8j8sl"] 4 | [ext_resource type="Script" path="res://top-down-shooter-core/items/use_actions/heal_character.gd" id="2_r646f"] 5 | 6 | [sub_resource type="Resource" id="Resource_ve2ba"] 7 | script = ExtResource("2_r646f") 8 | healing_type = null 9 | healing_power = 1 10 | 11 | [resource] 12 | script = ExtResource("1_8j8sl") 13 | name = "Half Heart" 14 | short_description = "A half heart to heal you a bit" 15 | long_description = null 16 | stackable = null 17 | stack_size = null 18 | use_action = SubResource("Resource_ve2ba") 19 | pickable_item_scene = "res://tiny_wizard/items/hearts/half_heart.tscn" 20 | -------------------------------------------------------------------------------- /tiny_wizard/items/hearts/half_heart.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=3 uid="uid://n34r6hwb62n6"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://bv1ot60drqmx" path="res://tiny_wizard/items/default_items/default_health_item.tscn" id="1_y2f0w"] 4 | [ext_resource type="Resource" uid="uid://dc56lnowd3urq" path="res://tiny_wizard/items/hearts/half_heart.tres" id="2_o7lbo"] 5 | [ext_resource type="Texture2D" uid="uid://s6qc78xl0l0e" path="res://tiny_wizard/assets/placeholder_art/items/heart_half.png" id="3_2xhnw"] 6 | 7 | [node name="HalfHeart" instance=ExtResource("1_y2f0w")] 8 | item = ExtResource("2_o7lbo") 9 | 10 | [node name="Item" parent="RigidBody2D" index="1"] 11 | texture = ExtResource("3_2xhnw") 12 | -------------------------------------------------------------------------------- /tiny_wizard/items/hearts/half_shield.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="QuiverItem" load_steps=4 format=3 uid="uid://bqy1wutr06tk8"] 2 | 3 | [ext_resource type="Script" path="res://top-down-shooter-core/items/item.gd" id="1_3xpuw"] 4 | [ext_resource type="Script" path="res://top-down-shooter-core/items/use_actions/heal_character.gd" id="2_q1nle"] 5 | 6 | [sub_resource type="Resource" id="Resource_gdene"] 7 | script = ExtResource("2_q1nle") 8 | healing_type = 1 9 | healing_power = 1 10 | 11 | [resource] 12 | script = ExtResource("1_3xpuw") 13 | name = "Half Shield" 14 | short_description = "A shield to protect you a bit" 15 | long_description = null 16 | stackable = null 17 | stack_size = null 18 | use_action = SubResource("Resource_gdene") 19 | pickable_item_scene = "res://tiny_wizard/items/hearts/half_shield.tscn" 20 | -------------------------------------------------------------------------------- /tiny_wizard/items/hearts/half_shield.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=3 uid="uid://cdb6il7uu0i7v"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://bv1ot60drqmx" path="res://tiny_wizard/items/default_items/default_health_item.tscn" id="1_ciw66"] 4 | [ext_resource type="Resource" uid="uid://bqy1wutr06tk8" path="res://tiny_wizard/items/hearts/half_shield.tres" id="2_aovbb"] 5 | [ext_resource type="Texture2D" uid="uid://bcueb0c1dd1u4" path="res://tiny_wizard/assets/placeholder_art/items/shield_half.png" id="3_sxg4x"] 6 | 7 | [node name="HalfShield" instance=ExtResource("1_ciw66")] 8 | item = ExtResource("2_aovbb") 9 | 10 | [node name="Item" parent="RigidBody2D" index="1"] 11 | texture = ExtResource("3_sxg4x") 12 | -------------------------------------------------------------------------------- /tiny_wizard/items/key/key.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" load_steps=2 format=3 uid="uid://ca80nqtdifi7q"] 2 | 3 | [ext_resource type="Script" path="res://top-down-shooter-core/items/item.gd" id="1_3uhtu"] 4 | 5 | [resource] 6 | script = ExtResource( "1_3uhtu" ) 7 | name = "Key" 8 | short_description = "A key to open things" 9 | long_description = null 10 | stackable = true 11 | stack_size = null 12 | pickable_item_scene = "res://tiny_wizard/items/key/key.tscn" 13 | -------------------------------------------------------------------------------- /tiny_wizard/items/key/key.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=3 uid="uid://djy8e0bt15gha"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://23m7r5q686kd" path="res://tiny_wizard/items/default_items/default_add_to_inventory_item.tscn" id="1_xatpr"] 4 | [ext_resource type="Resource" uid="uid://ca80nqtdifi7q" path="res://tiny_wizard/items/key/key.tres" id="2_dkjd1"] 5 | [ext_resource type="Texture2D" uid="uid://b2er80wkoc0wx" path="res://tiny_wizard/assets/placeholder_art/items/key.png" id="3_1tq13"] 6 | 7 | [node name="Key" instance=ExtResource( "1_xatpr" )] 8 | item = ExtResource( "2_dkjd1" ) 9 | 10 | [node name="Item" parent="RigidBody2D" index="1"] 11 | position = Vector2(1, -11) 12 | texture = ExtResource( "3_1tq13" ) 13 | 14 | [node name="Shadow" parent="RigidBody2D" index="2"] 15 | position = Vector2(0.999998, -1.17277) 16 | scale = Vector2(0.526316, 0.287376) 17 | 18 | [node name="OnFailure" parent="Action" index="1"] 19 | script = null 20 | -------------------------------------------------------------------------------- /tiny_wizard/items/pickable_bomb/bomb.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="QuiverItem" load_steps=5 format=3 uid="uid://dns8t84rxp4x5"] 2 | 3 | [ext_resource type="Script" path="res://top-down-shooter-core/items/item.gd" id="1_2ib5n"] 4 | [ext_resource type="PackedScene" uid="uid://dppu1vhjy1n1g" path="res://tiny_wizard/items/pickable_bomb/exploding_bomb/exploding_bomb.tscn" id="2_qfkbo"] 5 | [ext_resource type="Script" path="res://top-down-shooter-core/items/use_actions/spawn_a_scene.gd" id="3_8pro8"] 6 | 7 | [sub_resource type="Resource" id="Resource_ydwcg"] 8 | script = ExtResource("3_8pro8") 9 | scene_to_spawn = ExtResource("2_qfkbo") 10 | 11 | [resource] 12 | script = ExtResource("1_2ib5n") 13 | name = "Bomb" 14 | short_description = "A bomb that goes BOUMnull" 15 | long_description = null 16 | stackable = true 17 | stack_size = null 18 | use_action = SubResource("Resource_ydwcg") 19 | pickable_item_scene = "res://tiny_wizard/items/pickable_bomb/pickable_bomb.tscn" 20 | -------------------------------------------------------------------------------- /tiny_wizard/items/pickable_bomb/exploding_bomb/exploding_bomb.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | const TILE_MAP_RANGE = 40 4 | 5 | var active = true 6 | 7 | var stone_rids = [] 8 | 9 | func _ready(): 10 | self.tree_exited.connect(_on_tree_exited) 11 | 12 | func explode(): 13 | 14 | play_anim() 15 | 16 | var exploding_area : Area2D = $RigidBody2D/ExplodingArea 17 | 18 | var explode_position = $RigidBody2D.global_position 19 | 20 | for thing in exploding_area.get_overlapping_bodies(): 21 | if thing != $RigidBody2D: 22 | if thing is TileMap: 23 | update_tilemap(thing) 24 | 25 | if thing.has_method("hit"): 26 | thing.hit(2, explode_position.direction_to(thing.global_position)) 27 | elif thing.has_method("apply_impulse"): 28 | thing.apply_impulse(explode_position.direction_to(thing.global_position)*20000/explode_position.distance_to(thing.global_position)) 29 | 30 | func update_tilemap(tilemap: TileMap): 31 | for stone_rid in stone_rids: 32 | var coords = tilemap.get_coords_for_body_rid(stone_rid) 33 | tilemap.set_cell(0, coords, 0, Vector2i(4,2)) 34 | 35 | func play_anim(): 36 | ($RigidBody2D/AnimatedSprite2D as AnimatedSprite2D).play("explosion") 37 | 38 | func _on_tree_exited(): 39 | var ground_trace = $RigidBody2D/GroundBombTrace 40 | var pos = ground_trace.global_position 41 | ground_trace.get_parent().remove_child(ground_trace) 42 | add_sibling(ground_trace) 43 | ground_trace.global_position = pos 44 | 45 | func _on_exploding_area_body_shape_entered(body_rid, body, body_shape_index, local_shape_index): 46 | if body is TileMap: 47 | stone_rids.append(body_rid) 48 | 49 | func _on_exploding_area_body_shape_exited(body_rid, body, body_shape_index, local_shape_index): 50 | if body is TileMap: 51 | var index = stone_rids.find(body_rid) 52 | if index >= 0: 53 | stone_rids.remove_at(index) 54 | -------------------------------------------------------------------------------- /tiny_wizard/items/pickable_bomb/exploding_bomb/exploding_bomb.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=35 format=3 uid="uid://dppu1vhjy1n1g"] 2 | 3 | [ext_resource type="Script" path="res://tiny_wizard/items/pickable_bomb/exploding_bomb/exploding_bomb.gd" id="1_jlf8b"] 4 | [ext_resource type="Texture2D" uid="uid://f4c432cbhn1u" path="res://tiny_wizard/assets/placeholder_art/items/bomb.png" id="2_4tqbq"] 5 | [ext_resource type="Texture2D" uid="uid://cjjugml0purnn" path="res://tiny_wizard/assets/placeholder_art/shadow.png" id="3_6a5oo"] 6 | [ext_resource type="Texture2D" uid="uid://bov30xsh3t18w" path="res://tiny_wizard/assets/placeholder_art/cirle_particle.png" id="3_ve3s1"] 7 | [ext_resource type="Texture2D" uid="uid://dqf5vs3gpkjvx" path="res://tiny_wizard/assets/placeholder_art/ground_bomb_trace.png" id="5_m0bgr"] 8 | [ext_resource type="Texture2D" uid="uid://cceweiyxj57dr" path="res://tiny_wizard/assets/art/bomb_explode.png" id="5_p4d5h"] 9 | 10 | [sub_resource type="PhysicsMaterial" id="PhysicsMaterial_3dfhm"] 11 | friction = 100.0 12 | rough = true 13 | bounce = 0.35 14 | 15 | [sub_resource type="Curve" id="Curve_5pkwd"] 16 | _data = [Vector2(0, 1), 0.0, 1.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] 17 | point_count = 2 18 | 19 | [sub_resource type="CurveTexture" id="CurveTexture_jvw6x"] 20 | curve = SubResource("Curve_5pkwd") 21 | 22 | [sub_resource type="ParticleProcessMaterial" id="ParticlesMaterial_ctqlr"] 23 | particle_flag_disable_z = true 24 | direction = Vector3(100, 0, 0) 25 | spread = 180.0 26 | gravity = Vector3(0, 5, 0) 27 | initial_velocity_max = 8.86 28 | orbit_velocity_min = 0.0 29 | orbit_velocity_max = 0.0 30 | scale_min = 0.07 31 | scale_max = 0.11 32 | scale_curve = SubResource("CurveTexture_jvw6x") 33 | color = Color(1, 0.85098, 0.211765, 1) 34 | 35 | [sub_resource type="ParticleProcessMaterial" id="ParticlesMaterial_a2mvr"] 36 | particle_flag_disable_z = true 37 | direction = Vector3(100, 0, 0) 38 | spread = 180.0 39 | gravity = Vector3(0, 5, 0) 40 | initial_velocity_max = 8.86 41 | orbit_velocity_min = 0.0 42 | orbit_velocity_max = 0.0 43 | scale_min = 0.07 44 | scale_max = 0.18 45 | scale_curve = SubResource("CurveTexture_jvw6x") 46 | color = Color(1, 0.0941176, 0, 1) 47 | 48 | [sub_resource type="CircleShape2D" id="CircleShape2D_hxqpl"] 49 | radius = 8.0 50 | 51 | [sub_resource type="CircleShape2D" id="CircleShape2D_jhpt5"] 52 | radius = 125.004 53 | 54 | [sub_resource type="AtlasTexture" id="AtlasTexture_5ehax"] 55 | atlas = ExtResource("5_p4d5h") 56 | region = Rect2(0, 0, 344, 344) 57 | 58 | [sub_resource type="AtlasTexture" id="AtlasTexture_gpisd"] 59 | atlas = ExtResource("5_p4d5h") 60 | region = Rect2(344, 0, 344, 344) 61 | 62 | [sub_resource type="AtlasTexture" id="AtlasTexture_uaf62"] 63 | atlas = ExtResource("5_p4d5h") 64 | region = Rect2(688, 0, 344, 344) 65 | 66 | [sub_resource type="AtlasTexture" id="AtlasTexture_euhbg"] 67 | atlas = ExtResource("5_p4d5h") 68 | region = Rect2(1032, 0, 344, 344) 69 | 70 | [sub_resource type="AtlasTexture" id="AtlasTexture_74310"] 71 | atlas = ExtResource("5_p4d5h") 72 | region = Rect2(0, 344, 344, 344) 73 | 74 | [sub_resource type="AtlasTexture" id="AtlasTexture_71mv5"] 75 | atlas = ExtResource("5_p4d5h") 76 | region = Rect2(344, 344, 344, 344) 77 | 78 | [sub_resource type="AtlasTexture" id="AtlasTexture_kvkmr"] 79 | atlas = ExtResource("5_p4d5h") 80 | region = Rect2(688, 344, 344, 344) 81 | 82 | [sub_resource type="AtlasTexture" id="AtlasTexture_8yv4a"] 83 | atlas = ExtResource("5_p4d5h") 84 | region = Rect2(1032, 344, 344, 344) 85 | 86 | [sub_resource type="AtlasTexture" id="AtlasTexture_qi0vg"] 87 | atlas = ExtResource("5_p4d5h") 88 | region = Rect2(0, 688, 344, 344) 89 | 90 | [sub_resource type="AtlasTexture" id="AtlasTexture_j43yo"] 91 | atlas = ExtResource("5_p4d5h") 92 | region = Rect2(344, 688, 344, 344) 93 | 94 | [sub_resource type="AtlasTexture" id="AtlasTexture_80e5q"] 95 | atlas = ExtResource("5_p4d5h") 96 | region = Rect2(688, 688, 344, 344) 97 | 98 | [sub_resource type="AtlasTexture" id="AtlasTexture_l18o3"] 99 | atlas = ExtResource("5_p4d5h") 100 | region = Rect2(1032, 688, 344, 344) 101 | 102 | [sub_resource type="AtlasTexture" id="AtlasTexture_fj8vf"] 103 | atlas = ExtResource("5_p4d5h") 104 | region = Rect2(0, 1032, 344, 344) 105 | 106 | [sub_resource type="AtlasTexture" id="AtlasTexture_yqj5o"] 107 | atlas = ExtResource("5_p4d5h") 108 | region = Rect2(344, 1032, 344, 344) 109 | 110 | [sub_resource type="AtlasTexture" id="AtlasTexture_acpqa"] 111 | atlas = ExtResource("5_p4d5h") 112 | region = Rect2(688, 1032, 344, 344) 113 | 114 | [sub_resource type="AtlasTexture" id="AtlasTexture_krrv4"] 115 | atlas = ExtResource("5_p4d5h") 116 | region = Rect2(1032, 1032, 344, 344) 117 | 118 | [sub_resource type="SpriteFrames" id="SpriteFrames_3ueob"] 119 | animations = [{ 120 | "frames": [{ 121 | "duration": 1.0, 122 | "texture": SubResource("AtlasTexture_5ehax") 123 | }, { 124 | "duration": 1.0, 125 | "texture": SubResource("AtlasTexture_gpisd") 126 | }, { 127 | "duration": 1.0, 128 | "texture": SubResource("AtlasTexture_uaf62") 129 | }, { 130 | "duration": 1.0, 131 | "texture": SubResource("AtlasTexture_euhbg") 132 | }, { 133 | "duration": 1.0, 134 | "texture": SubResource("AtlasTexture_74310") 135 | }, { 136 | "duration": 1.0, 137 | "texture": SubResource("AtlasTexture_71mv5") 138 | }, { 139 | "duration": 1.0, 140 | "texture": SubResource("AtlasTexture_kvkmr") 141 | }, { 142 | "duration": 1.0, 143 | "texture": SubResource("AtlasTexture_8yv4a") 144 | }, { 145 | "duration": 1.0, 146 | "texture": SubResource("AtlasTexture_qi0vg") 147 | }, { 148 | "duration": 1.0, 149 | "texture": SubResource("AtlasTexture_j43yo") 150 | }, { 151 | "duration": 1.0, 152 | "texture": SubResource("AtlasTexture_80e5q") 153 | }, { 154 | "duration": 1.0, 155 | "texture": SubResource("AtlasTexture_l18o3") 156 | }, { 157 | "duration": 1.0, 158 | "texture": SubResource("AtlasTexture_fj8vf") 159 | }, { 160 | "duration": 1.0, 161 | "texture": SubResource("AtlasTexture_yqj5o") 162 | }, { 163 | "duration": 1.0, 164 | "texture": SubResource("AtlasTexture_acpqa") 165 | }, { 166 | "duration": 1.0, 167 | "texture": SubResource("AtlasTexture_krrv4") 168 | }], 169 | "loop": false, 170 | "name": &"explosion", 171 | "speed": 25.0 172 | }, { 173 | "frames": [], 174 | "loop": true, 175 | "name": &"idle", 176 | "speed": 5.0 177 | }] 178 | 179 | [sub_resource type="Animation" id="Animation_8xfum"] 180 | resource_name = "Disappear" 181 | length = 0.06 182 | step = 0.01 183 | tracks/0/type = "value" 184 | tracks/0/imported = false 185 | tracks/0/enabled = true 186 | tracks/0/path = NodePath("RigidBody2D/Sprite:scale") 187 | tracks/0/interp = 1 188 | tracks/0/loop_wrap = true 189 | tracks/0/keys = { 190 | "times": PackedFloat32Array(0, 0.04, 0.06), 191 | "transitions": PackedFloat32Array(1, 1, 1), 192 | "update": 0, 193 | "values": [Vector2(1, 1), Vector2(1, 0.4), Vector2(0, 0)] 194 | } 195 | 196 | [sub_resource type="Animation" id="Animation_2ge80"] 197 | resource_name = "Explode" 198 | length = 2.5 199 | step = 0.01 200 | tracks/0/type = "value" 201 | tracks/0/imported = false 202 | tracks/0/enabled = true 203 | tracks/0/path = NodePath("RigidBody2D/Sprite:scale") 204 | tracks/0/interp = 1 205 | tracks/0/loop_wrap = true 206 | tracks/0/keys = { 207 | "times": PackedFloat32Array(0, 0.07, 0.15, 1.85, 1.94), 208 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1), 209 | "update": 0, 210 | "values": [Vector2(0, 0), Vector2(1, 0.4), Vector2(1, 1), Vector2(1, 1), Vector2(1.795, 0.697)] 211 | } 212 | tracks/1/type = "value" 213 | tracks/1/imported = false 214 | tracks/1/enabled = true 215 | tracks/1/path = NodePath("RigidBody2D/Sprite:modulate") 216 | tracks/1/interp = 1 217 | tracks/1/loop_wrap = true 218 | tracks/1/keys = { 219 | "times": PackedFloat32Array(0.48, 0.49, 0.53, 0.71, 0.72, 0.76, 1.05, 1.06, 1.1, 1.5, 1.51, 1.55, 1.65, 1.66, 1.7, 1.74, 1.85, 1.86, 1.93, 1.97, 1.99), 220 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), 221 | "update": 0, 222 | "values": [Color(1, 1, 1, 1), Color(1, 0, 0.0799975, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 0, 0.0799975, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 0, 0.0799975, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 0, 0.0799975, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 0, 0.0799975, 1), Color(1, 0, 0.0799975, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 0, 0.0799975, 1), Color(1, 0, 0.0799975, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] 223 | } 224 | tracks/2/type = "value" 225 | tracks/2/imported = false 226 | tracks/2/enabled = true 227 | tracks/2/path = NodePath("RigidBody2D/Shadow:modulate") 228 | tracks/2/interp = 1 229 | tracks/2/loop_wrap = true 230 | tracks/2/keys = { 231 | "times": PackedFloat32Array(1.96, 1.99), 232 | "transitions": PackedFloat32Array(1, 1), 233 | "update": 0, 234 | "values": [Color(1, 1, 1, 0.364706), Color(1, 1, 1, 0)] 235 | } 236 | tracks/3/type = "value" 237 | tracks/3/imported = false 238 | tracks/3/enabled = true 239 | tracks/3/path = NodePath("RigidBody2D:collision_mask") 240 | tracks/3/interp = 1 241 | tracks/3/loop_wrap = true 242 | tracks/3/keys = { 243 | "times": PackedFloat32Array(0.01, 0.61), 244 | "transitions": PackedFloat32Array(1, 1), 245 | "update": 1, 246 | "values": [17, 19] 247 | } 248 | tracks/4/type = "method" 249 | tracks/4/imported = false 250 | tracks/4/enabled = true 251 | tracks/4/path = NodePath(".") 252 | tracks/4/interp = 1 253 | tracks/4/loop_wrap = true 254 | tracks/4/keys = { 255 | "times": PackedFloat32Array(1.97, 2.5), 256 | "transitions": PackedFloat32Array(1, 1), 257 | "values": [{ 258 | "args": [], 259 | "method": &"explode" 260 | }, { 261 | "args": [], 262 | "method": &"queue_free" 263 | }] 264 | } 265 | tracks/5/type = "value" 266 | tracks/5/imported = false 267 | tracks/5/enabled = true 268 | tracks/5/path = NodePath("RigidBody2D/GroundBombTrace:visible") 269 | tracks/5/interp = 1 270 | tracks/5/loop_wrap = true 271 | tracks/5/keys = { 272 | "times": PackedFloat32Array(0.03, 2.01), 273 | "transitions": PackedFloat32Array(1, 1), 274 | "update": 1, 275 | "values": [false, true] 276 | } 277 | tracks/6/type = "value" 278 | tracks/6/imported = false 279 | tracks/6/enabled = true 280 | tracks/6/path = NodePath("RigidBody2D/Sprite/GPUParticles2D2:emitting") 281 | tracks/6/interp = 1 282 | tracks/6/loop_wrap = true 283 | tracks/6/keys = { 284 | "times": PackedFloat32Array(0, 1.88, 1.97), 285 | "transitions": PackedFloat32Array(1, 1, 1), 286 | "update": 1, 287 | "values": [true, true, false] 288 | } 289 | tracks/7/type = "value" 290 | tracks/7/imported = false 291 | tracks/7/enabled = true 292 | tracks/7/path = NodePath("RigidBody2D/Sprite/GPUParticles2D:emitting") 293 | tracks/7/interp = 1 294 | tracks/7/loop_wrap = true 295 | tracks/7/keys = { 296 | "times": PackedFloat32Array(0, 1.88, 1.97), 297 | "transitions": PackedFloat32Array(1, 1, 1), 298 | "update": 1, 299 | "values": [true, true, false] 300 | } 301 | tracks/8/type = "value" 302 | tracks/8/imported = false 303 | tracks/8/enabled = true 304 | tracks/8/path = NodePath("RigidBody2D:freeze") 305 | tracks/8/interp = 1 306 | tracks/8/loop_wrap = true 307 | tracks/8/keys = { 308 | "times": PackedFloat32Array(0.01, 2.01), 309 | "transitions": PackedFloat32Array(1, 1), 310 | "update": 1, 311 | "values": [false, true] 312 | } 313 | 314 | [sub_resource type="Animation" id="Animation_2vanl"] 315 | length = 0.001 316 | tracks/0/type = "value" 317 | tracks/0/imported = false 318 | tracks/0/enabled = true 319 | tracks/0/path = NodePath("RigidBody2D/Sprite:scale") 320 | tracks/0/interp = 1 321 | tracks/0/loop_wrap = true 322 | tracks/0/keys = { 323 | "times": PackedFloat32Array(0), 324 | "transitions": PackedFloat32Array(1), 325 | "update": 0, 326 | "values": [Vector2(1, 1)] 327 | } 328 | tracks/1/type = "value" 329 | tracks/1/imported = false 330 | tracks/1/enabled = true 331 | tracks/1/path = NodePath("RigidBody2D/Sprite:modulate") 332 | tracks/1/interp = 1 333 | tracks/1/loop_wrap = true 334 | tracks/1/keys = { 335 | "times": PackedFloat32Array(0), 336 | "transitions": PackedFloat32Array(1), 337 | "update": 0, 338 | "values": [Color(1, 1, 1, 1)] 339 | } 340 | tracks/2/type = "value" 341 | tracks/2/imported = false 342 | tracks/2/enabled = true 343 | tracks/2/path = NodePath("RigidBody2D/Shadow:modulate") 344 | tracks/2/interp = 1 345 | tracks/2/loop_wrap = true 346 | tracks/2/keys = { 347 | "times": PackedFloat32Array(0), 348 | "transitions": PackedFloat32Array(1), 349 | "update": 0, 350 | "values": [Color(1, 1, 1, 1)] 351 | } 352 | tracks/3/type = "value" 353 | tracks/3/imported = false 354 | tracks/3/enabled = true 355 | tracks/3/path = NodePath("RigidBody2D:collision_mask") 356 | tracks/3/interp = 1 357 | tracks/3/loop_wrap = true 358 | tracks/3/keys = { 359 | "times": PackedFloat32Array(0), 360 | "transitions": PackedFloat32Array(1), 361 | "update": 0, 362 | "values": [19] 363 | } 364 | tracks/4/type = "value" 365 | tracks/4/imported = false 366 | tracks/4/enabled = true 367 | tracks/4/path = NodePath("RigidBody2D/GroundBombTrace:visible") 368 | tracks/4/interp = 1 369 | tracks/4/loop_wrap = true 370 | tracks/4/keys = { 371 | "times": PackedFloat32Array(0), 372 | "transitions": PackedFloat32Array(1), 373 | "update": 0, 374 | "values": [false] 375 | } 376 | tracks/5/type = "value" 377 | tracks/5/imported = false 378 | tracks/5/enabled = true 379 | tracks/5/path = NodePath("RigidBody2D/Sprite/GPUParticles2D2:emitting") 380 | tracks/5/interp = 1 381 | tracks/5/loop_wrap = true 382 | tracks/5/keys = { 383 | "times": PackedFloat32Array(0), 384 | "transitions": PackedFloat32Array(1), 385 | "update": 0, 386 | "values": [true] 387 | } 388 | tracks/6/type = "value" 389 | tracks/6/imported = false 390 | tracks/6/enabled = true 391 | tracks/6/path = NodePath("RigidBody2D/Sprite/GPUParticles2D:emitting") 392 | tracks/6/interp = 1 393 | tracks/6/loop_wrap = true 394 | tracks/6/keys = { 395 | "times": PackedFloat32Array(0), 396 | "transitions": PackedFloat32Array(1), 397 | "update": 0, 398 | "values": [true] 399 | } 400 | tracks/7/type = "value" 401 | tracks/7/imported = false 402 | tracks/7/enabled = true 403 | tracks/7/path = NodePath("RigidBody2D:freeze") 404 | tracks/7/interp = 1 405 | tracks/7/loop_wrap = true 406 | tracks/7/keys = { 407 | "times": PackedFloat32Array(0), 408 | "transitions": PackedFloat32Array(1), 409 | "update": 1, 410 | "values": [false] 411 | } 412 | 413 | [sub_resource type="AnimationLibrary" id="AnimationLibrary_i1gif"] 414 | _data = { 415 | "Disappear": SubResource("Animation_8xfum"), 416 | "Explode": SubResource("Animation_2ge80"), 417 | "RESET": SubResource("Animation_2vanl") 418 | } 419 | 420 | [node name="ExplodingBomb" type="Node2D"] 421 | y_sort_enabled = true 422 | script = ExtResource("1_jlf8b") 423 | 424 | [node name="RigidBody2D" type="RigidBody2D" parent="."] 425 | y_sort_enabled = true 426 | collision_layer = 16 427 | collision_mask = 19 428 | inertia = 1.0 429 | physics_material_override = SubResource("PhysicsMaterial_3dfhm") 430 | gravity_scale = 0.0 431 | contact_monitor = true 432 | lock_rotation = true 433 | linear_damp = 1.106 434 | 435 | [node name="Sprite" type="Sprite2D" parent="RigidBody2D"] 436 | y_sort_enabled = true 437 | position = Vector2(-2, -14) 438 | texture = ExtResource("2_4tqbq") 439 | 440 | [node name="GPUParticles2D2" type="GPUParticles2D" parent="RigidBody2D/Sprite"] 441 | position = Vector2(-16, -9) 442 | process_material = SubResource("ParticlesMaterial_ctqlr") 443 | texture = ExtResource("3_ve3s1") 444 | lifetime = 1.69 445 | speed_scale = 3.51 446 | 447 | [node name="GPUParticles2D" type="GPUParticles2D" parent="RigidBody2D/Sprite"] 448 | position = Vector2(-16, -9) 449 | process_material = SubResource("ParticlesMaterial_a2mvr") 450 | texture = ExtResource("3_ve3s1") 451 | speed_scale = 3.51 452 | 453 | [node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D"] 454 | y_sort_enabled = true 455 | shape = SubResource("CircleShape2D_hxqpl") 456 | 457 | [node name="Shadow" type="Sprite2D" parent="RigidBody2D"] 458 | z_index = -1 459 | position = Vector2(1, 0) 460 | scale = Vector2(0.399, 0.266) 461 | texture = ExtResource("3_6a5oo") 462 | 463 | [node name="ExplodingArea" type="Area2D" parent="RigidBody2D"] 464 | collision_layer = 32 465 | collision_mask = 90 466 | 467 | [node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D/ExplodingArea"] 468 | modulate = Color(1, 0.231373, 0.164706, 0.415686) 469 | shape = SubResource("CircleShape2D_jhpt5") 470 | 471 | [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="RigidBody2D"] 472 | y_sort_enabled = true 473 | position = Vector2(-2, -18) 474 | scale = Vector2(0.75, 0.75) 475 | sprite_frames = SubResource("SpriteFrames_3ueob") 476 | animation = &"idle" 477 | autoplay = "idle" 478 | offset = Vector2(1, -3) 479 | 480 | [node name="GroundBombTrace" type="Sprite2D" parent="RigidBody2D"] 481 | visible = false 482 | z_index = -1 483 | position = Vector2(-1, 6) 484 | texture = ExtResource("5_m0bgr") 485 | 486 | [node name="AnimationPlayer" type="AnimationPlayer" parent="."] 487 | autoplay = "Explode" 488 | libraries = { 489 | "": SubResource("AnimationLibrary_i1gif") 490 | } 491 | 492 | [connection signal="body_shape_entered" from="RigidBody2D/ExplodingArea" to="." method="_on_exploding_area_body_shape_entered"] 493 | [connection signal="body_shape_exited" from="RigidBody2D/ExplodingArea" to="." method="_on_exploding_area_body_shape_exited"] 494 | -------------------------------------------------------------------------------- /tiny_wizard/items/pickable_bomb/pickable_bomb.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=3 uid="uid://ch5dnqr8q5qdy"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://23m7r5q686kd" path="res://tiny_wizard/items/default_items/default_add_to_inventory_item.tscn" id="1_e4aaw"] 4 | [ext_resource type="Resource" uid="uid://dns8t84rxp4x5" path="res://tiny_wizard/items/pickable_bomb/bomb.tres" id="2_1323s"] 5 | [ext_resource type="Texture2D" uid="uid://f4c432cbhn1u" path="res://tiny_wizard/assets/placeholder_art/items/bomb.png" id="2_xwlei"] 6 | 7 | [node name="PickableBomb" instance=ExtResource("1_e4aaw")] 8 | item = ExtResource("2_1323s") 9 | 10 | [node name="Item" parent="RigidBody2D" index="1"] 11 | position = Vector2(-1, -16) 12 | texture = ExtResource("2_xwlei") 13 | 14 | [node name="Shadow" parent="RigidBody2D" index="2"] 15 | position = Vector2(1, -1.67277) 16 | scale = Vector2(0.342105, 0.259598) 17 | -------------------------------------------------------------------------------- /tiny_wizard/items/violet_arrow/equip_bullet.gd: -------------------------------------------------------------------------------- 1 | extends QuiverItemUseAction 2 | class_name QuiverItemUseActionEquipBullet 3 | 4 | # A custom QuiverItemUseAction to change the current weapon arrow 5 | 6 | # The bullet packed scene 7 | @export var bullet_scene: PackedScene 8 | 9 | func use(user: QuiverCharacter)->bool: 10 | if user.has_method('change_arrow'): 11 | user.change_arrow(bullet_scene) 12 | return true 13 | -------------------------------------------------------------------------------- /tiny_wizard/items/violet_arrow/violet_arrow.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="QuiverItem" load_steps=5 format=3 uid="uid://cewe5atrwbmch"] 2 | 3 | [ext_resource type="Script" path="res://top-down-shooter-core/items/item.gd" id="1_20jho"] 4 | [ext_resource type="PackedScene" uid="uid://b6ikwtf8k4nt6" path="res://tiny_wizard/player/weapon/bullet/violet_arrow.tscn" id="2_53cof"] 5 | [ext_resource type="Script" path="res://tiny_wizard/items/violet_arrow/equip_bullet.gd" id="3_etyt0"] 6 | 7 | [sub_resource type="Resource" id="Resource_6fqri"] 8 | script = ExtResource("3_etyt0") 9 | bullet_scene = ExtResource("2_53cof") 10 | 11 | [resource] 12 | script = ExtResource("1_20jho") 13 | name = "Violet Arrow" 14 | short_description = "A powerfull arrow" 15 | long_description = null 16 | stackable = null 17 | stack_size = null 18 | use_action = SubResource("Resource_6fqri") 19 | pickable_item_scene = "res://tiny_wizard/items/violet_arrow/violet_arrow.tscn" 20 | -------------------------------------------------------------------------------- /tiny_wizard/items/violet_arrow/violet_arrow.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=7 format=3 uid="uid://btijy130wqauo"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://djs45wxhgd1ma" path="res://tiny_wizard/items/default_items/default_item.tscn" id="1_aa2ce"] 4 | [ext_resource type="Resource" uid="uid://cewe5atrwbmch" path="res://tiny_wizard/items/violet_arrow/violet_arrow.tres" id="2_hi8tp"] 5 | [ext_resource type="Texture2D" uid="uid://ckcoy8y88yst0" path="res://tiny_wizard/assets/art/violet_arrow.png" id="3_a2rxj"] 6 | [ext_resource type="Script" path="res://top-down-shooter-core/items/pickable_items/pick_item_actions/use_item.gd" id="5_qf8us"] 7 | 8 | [sub_resource type="CircleShape2D" id="CircleShape2D_a4x3i"] 9 | radius = 8.0 10 | 11 | [sub_resource type="AtlasTexture" id="AtlasTexture_t72wp"] 12 | atlas = ExtResource("3_a2rxj") 13 | region = Rect2(0, 0, 100, 100) 14 | 15 | [node name="VioletArrow" instance=ExtResource("1_aa2ce")] 16 | item = ExtResource("2_hi8tp") 17 | 18 | [node name="CollisionShape2D" parent="RigidBody2D" index="0"] 19 | position = Vector2(0, -8) 20 | shape = SubResource("CircleShape2D_a4x3i") 21 | 22 | [node name="Item" parent="RigidBody2D" index="1"] 23 | y_sort_enabled = true 24 | position = Vector2(0, -13) 25 | texture = SubResource("AtlasTexture_t72wp") 26 | 27 | [node name="Shadow" parent="RigidBody2D" index="2"] 28 | position = Vector2(1, -1.67277) 29 | scale = Vector2(0.342105, 0.259598) 30 | 31 | [node name="Action" parent="." index="1"] 32 | script = ExtResource("5_qf8us") 33 | -------------------------------------------------------------------------------- /tiny_wizard/main.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=15 format=3 uid="uid://cxl7rbtvsb5nc"] 2 | 3 | [ext_resource type="Script" path="res://tiny_wizard/tiny_wizard_main.gd" id="1_5rjdy"] 4 | [ext_resource type="PackedScene" uid="uid://bnuih6qfwgu2p" path="res://tiny_wizard/player/player_character.tscn" id="2_5wjcq"] 5 | [ext_resource type="PackedScene" uid="uid://clrh7n7dsc2nj" path="res://tiny_wizard/room/room_types/room_3.tscn" id="3_fw0kv"] 6 | [ext_resource type="PackedScene" uid="uid://de3l1l1odllgl" path="res://tiny_wizard/room/room.tscn" id="3_rkala"] 7 | [ext_resource type="PackedScene" uid="uid://buq05y654f2am" path="res://tiny_wizard/room/room_types/room_4.tscn" id="4_dpuob"] 8 | [ext_resource type="PackedScene" uid="uid://7yddsgvc3t8j" path="res://tiny_wizard/room/room_types/room_8.tscn" id="5_p25wi"] 9 | [ext_resource type="PackedScene" uid="uid://bog1ldcsq4qxe" path="res://tiny_wizard/room/room_types/room_6.tscn" id="6_nh7qh"] 10 | [ext_resource type="PackedScene" uid="uid://cny2yyynrb4qo" path="res://tiny_wizard/room/room_types/room_5.tscn" id="7_mobuj"] 11 | [ext_resource type="PackedScene" uid="uid://bs2vw66dejdbp" path="res://tiny_wizard/room/room_types/room_7.tscn" id="8_076cv"] 12 | [ext_resource type="PackedScene" uid="uid://qdyhlh75eu6m" path="res://tiny_wizard/room/room_types/room_9.tscn" id="12_2njgv"] 13 | [ext_resource type="PackedScene" uid="uid://c45gqa1w6c20d" path="res://tiny_wizard/gui/gui.tscn" id="13_ucw2f"] 14 | [ext_resource type="PackedScene" uid="uid://d01c1dqufo578" path="res://tiny_wizard/room/room_types/room_1.tscn" id="14_cw4nu"] 15 | [ext_resource type="Resource" uid="uid://bpvgw7v25bbsx" path="res://tiny_wizard/player/inventory/inventory.tres" id="14_ui8tp"] 16 | [ext_resource type="PackedScene" uid="uid://c70wougnmqni2" path="res://tiny_wizard/room/room_types/room_2.tscn" id="16_mqrf6"] 17 | 18 | [node name="TinyWizardDemo" type="Node2D"] 19 | y_sort_enabled = true 20 | script = ExtResource("1_5rjdy") 21 | metadata/_edit_vertical_guides_ = [0.0] 22 | 23 | [node name="Character" parent="." instance=ExtResource("2_5wjcq")] 24 | position = Vector2(536, 592) 25 | gui_path = NodePath("../Camera2D/GUI") 26 | 27 | [node name="Rooms" type="Node2D" parent="."] 28 | y_sort_enabled = true 29 | 30 | [node name="Room" parent="Rooms" instance=ExtResource("3_fw0kv")] 31 | position = Vector2(3072, -400) 32 | 33 | [node name="Room2" parent="Rooms" instance=ExtResource("4_dpuob")] 34 | position = Vector2(1024, 1400) 35 | 36 | [node name="Room3" parent="Rooms" instance=ExtResource("5_p25wi")] 37 | position = Vector2(3072, 200) 38 | 39 | [node name="Room4" parent="Rooms" instance=ExtResource("6_nh7qh")] 40 | position = Vector2(2048, 200) 41 | 42 | [node name="Room_1_-1" parent="Rooms" instance=ExtResource("7_mobuj")] 43 | position = Vector2(1024, -400) 44 | 45 | [node name="Room6" parent="Rooms" instance=ExtResource("8_076cv")] 46 | position = Vector2(0, 1400) 47 | 48 | [node name="Room_0_0" parent="Rooms" instance=ExtResource("3_rkala")] 49 | hide_down_door = true 50 | hide_left_door = true 51 | hide_up_door = true 52 | 53 | [node name="Room_1_0" parent="Rooms" instance=ExtResource("14_cw4nu")] 54 | position = Vector2(1024, 200) 55 | hide_right_door = true 56 | 57 | [node name="Room_1_1" parent="Rooms" instance=ExtResource("16_mqrf6")] 58 | position = Vector2(1024, 800) 59 | hide_right_door = true 60 | hide_down_door = true 61 | hide_left_door = true 62 | 63 | [node name="Room5" parent="Rooms" instance=ExtResource("12_2njgv")] 64 | position = Vector2(-1024, 200) 65 | 66 | [node name="Camera2D" type="Camera2D" parent="."] 67 | anchor_mode = 0 68 | 69 | [node name="GUI" parent="Camera2D" instance=ExtResource("13_ucw2f")] 70 | inventory = ExtResource("14_ui8tp") 71 | -------------------------------------------------------------------------------- /tiny_wizard/player/character_visual.gd: -------------------------------------------------------------------------------- 1 | extends QuiverCharacterVisual 2 | 3 | 4 | # This is a Visual meant to be used with an AnimatedSprite2D node 5 | # The animations should be named "0" "1" "2"... each animation coresponding to a rotation of the character 6 | # The animation "0" should be the enemy facing right 7 | # The next animations represents the character rotated in clockwise order 8 | 9 | enum RotationMode {NONE, AIMING, MOVING} 10 | 11 | # Will the character rotate on aiming or moving ? 12 | @export var rotation_mode : RotationMode = RotationMode.AIMING 13 | 14 | # How many different angles do you want your character to rotate 15 | # You will need to have a walking animation for each angle 16 | @export var rotation_clamping := 4 17 | 18 | @onready var head: AnimatedSprite2D = $Head 19 | @onready var body: AnimatedSprite2D = $Body 20 | @onready var hat: Sprite2D = $Hat 21 | 22 | @onready var weapon = $DistanceWeapon 23 | 24 | 25 | func update_visual(action: QuiverCharacterAction): 26 | 27 | if action.moving_direction.length() > 0: 28 | body.play() 29 | else: 30 | body.stop() 31 | body.frame = 0 # The standing/idle frame 32 | 33 | if action.moving_direction.length() > 0: 34 | body.scale = Vector2(int(action.moving_direction.x>=0)*2-1,1) 35 | _apply_body_rotation(action.moving_direction.angle()) 36 | 37 | if action.aiming_direction.length() > 0: 38 | _apply_head_rotation(action.aiming_direction.angle()) 39 | else: 40 | if !head.is_playing(): 41 | head.frame = 0 42 | head.animation = 'default' 43 | hat.scale = Vector2.ONE 44 | hat.position = Vector2(-1.667,-128.33) 45 | 46 | 47 | func _apply_body_rotation(angle): 48 | var k = int(round(angle/(2*PI/rotation_clamping))) 49 | k = (k+rotation_clamping)%rotation_clamping 50 | if body.animation != 'move_' + str(k): 51 | body.frame = 1 52 | body.animation = 'move_' + str(k) 53 | 54 | func _apply_head_rotation(angle): 55 | var k = int(round(angle/(2*PI/rotation_clamping))) 56 | k = (k+rotation_clamping)%rotation_clamping 57 | if head.animation != 'shoot_' + str(k) or !head.is_playing(): 58 | # Orientate weapon 59 | weapon.shoot_direction = Vector2.RIGHT.rotated((k*2*PI)/rotation_clamping) 60 | 61 | head.frame = 0 62 | head.play('shoot_' + str(k)) 63 | 64 | 65 | hat.scale = Vector2(int(k!=2)*2-1,1) 66 | hat.position = Vector2(-1.667 + int(k==2)*12.0,-128.33) 67 | 68 | 69 | func _on_head_animation_finished(): 70 | head.stop() 71 | -------------------------------------------------------------------------------- /tiny_wizard/player/inventory/inventory.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="QuiverInventory" load_steps=2 format=3 uid="uid://bpvgw7v25bbsx"] 2 | 3 | [ext_resource type="Script" path="res://top-down-shooter-core/inventory/inventory_.gd" id="1_kcdp7"] 4 | 5 | [resource] 6 | script = ExtResource("1_kcdp7") 7 | max_size = 9 8 | -------------------------------------------------------------------------------- /tiny_wizard/player/player_character.gd: -------------------------------------------------------------------------------- 1 | extends QuiverCharacter 2 | 3 | @export var gui_path: NodePath 4 | 5 | var arrow_types = { 6 | 'normal': preload("res://tiny_wizard/player/weapon/bullet/arrow.tscn"), 7 | 'violet': preload("res://tiny_wizard/player/weapon/bullet/violet_arrow.tscn"), 8 | } 9 | 10 | func hit(damage:=1, from:=Vector2.ZERO): 11 | super.hit(damage, from) 12 | $Visual/AnimationPlayer.play("Blink") 13 | 14 | 15 | func _process(delta): 16 | if Input.is_action_just_pressed("drop_bomb"): 17 | (inventory as QuiverInventory).use_item(self, "Bomb") 18 | # inventory.add_to_item('bombs', -1) 19 | # var bomb = BOMB_SCENE.instantiate() 20 | # bomb.position = position 21 | # get_parent().add_child(bomb) 22 | 23 | func change_arrow(arrow_scene): 24 | $Visual/DistanceWeapon.bullet_scene = arrow_scene 25 | # inventory.current_arrow = arrow_scene.instantiate().icon 26 | var gui = get_node_or_null(gui_path) 27 | if gui != null: 28 | gui.change_arrow_texture(arrow_scene.instantiate().icon) 29 | 30 | -------------------------------------------------------------------------------- /tiny_wizard/player/player_character.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=62 format=3 uid="uid://bnuih6qfwgu2p"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://ckan5lwiqvq2a" path="res://top-down-shooter-core/character/character.tscn" id="1_4ld63"] 4 | [ext_resource type="Script" path="res://tiny_wizard/player/player_character.gd" id="2_q71sv"] 5 | [ext_resource type="Resource" path="res://tiny_wizard/player/player_stats.tres" id="3_4j7bh"] 6 | [ext_resource type="Resource" uid="uid://bpvgw7v25bbsx" path="res://tiny_wizard/player/inventory/inventory.tres" id="4_ubej3"] 7 | [ext_resource type="Script" path="res://top-down-shooter-core/character/character_stats/physics_stats.gd" id="5_mb7yt"] 8 | [ext_resource type="Script" path="res://tiny_wizard/player/character_visual.gd" id="5_phrov"] 9 | [ext_resource type="Texture2D" uid="uid://u2qrtjpgbv2k" path="res://tiny_wizard/assets/placeholder_art/shadow.png" id="6_rdbn7"] 10 | [ext_resource type="PackedScene" path="res://tiny_wizard/player/weapon/arrow_shooter.tscn" id="9_8ad45"] 11 | [ext_resource type="Texture2D" uid="uid://2b78raawfdem" path="res://tiny_wizard/assets/art/playerface.png" id="9_d0foh"] 12 | [ext_resource type="Texture2D" uid="uid://baeahixk6m5pn" path="res://tiny_wizard/assets/art/playerbody.png" id="9_qqu0i"] 13 | [ext_resource type="Script" path="res://tiny_wizard/player/player_input.gd" id="10_fjnx3"] 14 | [ext_resource type="Texture2D" uid="uid://bp5dn2pv8ujkv" path="res://tiny_wizard/assets/art/hat.png" id="10_vqe68"] 15 | 16 | [sub_resource type="Resource" id="Resource_h2g7o"] 17 | script = ExtResource("5_mb7yt") 18 | max_speed = 200.0 19 | acceleration = 0.4 20 | friction = 0.19 21 | impulse_force = 0.0 22 | 23 | [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_3vl2b"] 24 | radius = 12.3333 25 | height = 38.0 26 | 27 | [sub_resource type="AtlasTexture" id="AtlasTexture_qoe08"] 28 | atlas = ExtResource("9_qqu0i") 29 | region = Rect2(0, 0, 115, 115) 30 | 31 | [sub_resource type="AtlasTexture" id="AtlasTexture_ejc0j"] 32 | atlas = ExtResource("9_qqu0i") 33 | region = Rect2(805, 230, 115, 115) 34 | 35 | [sub_resource type="AtlasTexture" id="AtlasTexture_et6nd"] 36 | atlas = ExtResource("9_qqu0i") 37 | region = Rect2(0, 230, 115, 115) 38 | 39 | [sub_resource type="AtlasTexture" id="AtlasTexture_dpr67"] 40 | atlas = ExtResource("9_qqu0i") 41 | region = Rect2(115, 230, 115, 115) 42 | 43 | [sub_resource type="AtlasTexture" id="AtlasTexture_j2flx"] 44 | atlas = ExtResource("9_qqu0i") 45 | region = Rect2(230, 230, 115, 115) 46 | 47 | [sub_resource type="AtlasTexture" id="AtlasTexture_x1bgx"] 48 | atlas = ExtResource("9_qqu0i") 49 | region = Rect2(345, 230, 115, 115) 50 | 51 | [sub_resource type="AtlasTexture" id="AtlasTexture_dl5mx"] 52 | atlas = ExtResource("9_qqu0i") 53 | region = Rect2(460, 230, 115, 115) 54 | 55 | [sub_resource type="AtlasTexture" id="AtlasTexture_rsgtw"] 56 | atlas = ExtResource("9_qqu0i") 57 | region = Rect2(575, 230, 115, 115) 58 | 59 | [sub_resource type="AtlasTexture" id="AtlasTexture_gdgks"] 60 | atlas = ExtResource("9_qqu0i") 61 | region = Rect2(690, 230, 115, 115) 62 | 63 | [sub_resource type="AtlasTexture" id="AtlasTexture_5qpn8"] 64 | atlas = ExtResource("9_qqu0i") 65 | region = Rect2(805, 115, 115, 115) 66 | 67 | [sub_resource type="AtlasTexture" id="AtlasTexture_dnyfi"] 68 | atlas = ExtResource("9_qqu0i") 69 | region = Rect2(0, 115, 115, 115) 70 | 71 | [sub_resource type="AtlasTexture" id="AtlasTexture_v8k71"] 72 | atlas = ExtResource("9_qqu0i") 73 | region = Rect2(115, 115, 115, 115) 74 | 75 | [sub_resource type="AtlasTexture" id="AtlasTexture_ynoei"] 76 | atlas = ExtResource("9_qqu0i") 77 | region = Rect2(230, 115, 115, 115) 78 | 79 | [sub_resource type="AtlasTexture" id="AtlasTexture_a6nu2"] 80 | atlas = ExtResource("9_qqu0i") 81 | region = Rect2(345, 115, 115, 115) 82 | 83 | [sub_resource type="AtlasTexture" id="AtlasTexture_1op47"] 84 | atlas = ExtResource("9_qqu0i") 85 | region = Rect2(460, 115, 115, 115) 86 | 87 | [sub_resource type="AtlasTexture" id="AtlasTexture_2sg87"] 88 | atlas = ExtResource("9_qqu0i") 89 | region = Rect2(575, 115, 115, 115) 90 | 91 | [sub_resource type="AtlasTexture" id="AtlasTexture_567om"] 92 | atlas = ExtResource("9_qqu0i") 93 | region = Rect2(690, 115, 115, 115) 94 | 95 | [sub_resource type="AtlasTexture" id="AtlasTexture_8145b"] 96 | atlas = ExtResource("9_qqu0i") 97 | region = Rect2(805, 230, 115, 115) 98 | 99 | [sub_resource type="AtlasTexture" id="AtlasTexture_8c1xm"] 100 | atlas = ExtResource("9_qqu0i") 101 | region = Rect2(0, 230, 115, 115) 102 | 103 | [sub_resource type="AtlasTexture" id="AtlasTexture_qff0r"] 104 | atlas = ExtResource("9_qqu0i") 105 | region = Rect2(115, 230, 115, 115) 106 | 107 | [sub_resource type="AtlasTexture" id="AtlasTexture_7p00g"] 108 | atlas = ExtResource("9_qqu0i") 109 | region = Rect2(230, 230, 115, 115) 110 | 111 | [sub_resource type="AtlasTexture" id="AtlasTexture_uf74h"] 112 | atlas = ExtResource("9_qqu0i") 113 | region = Rect2(345, 230, 115, 115) 114 | 115 | [sub_resource type="AtlasTexture" id="AtlasTexture_qmraf"] 116 | atlas = ExtResource("9_qqu0i") 117 | region = Rect2(460, 230, 115, 115) 118 | 119 | [sub_resource type="AtlasTexture" id="AtlasTexture_j1h58"] 120 | atlas = ExtResource("9_qqu0i") 121 | region = Rect2(575, 230, 115, 115) 122 | 123 | [sub_resource type="AtlasTexture" id="AtlasTexture_jvs2o"] 124 | atlas = ExtResource("9_qqu0i") 125 | region = Rect2(690, 230, 115, 115) 126 | 127 | [sub_resource type="AtlasTexture" id="AtlasTexture_dwith"] 128 | atlas = ExtResource("9_qqu0i") 129 | region = Rect2(805, 115, 115, 115) 130 | 131 | [sub_resource type="AtlasTexture" id="AtlasTexture_0xjdu"] 132 | atlas = ExtResource("9_qqu0i") 133 | region = Rect2(0, 115, 115, 115) 134 | 135 | [sub_resource type="AtlasTexture" id="AtlasTexture_15n00"] 136 | atlas = ExtResource("9_qqu0i") 137 | region = Rect2(115, 115, 115, 115) 138 | 139 | [sub_resource type="AtlasTexture" id="AtlasTexture_i2qo0"] 140 | atlas = ExtResource("9_qqu0i") 141 | region = Rect2(230, 115, 115, 115) 142 | 143 | [sub_resource type="AtlasTexture" id="AtlasTexture_6sfgb"] 144 | atlas = ExtResource("9_qqu0i") 145 | region = Rect2(345, 115, 115, 115) 146 | 147 | [sub_resource type="AtlasTexture" id="AtlasTexture_kijl4"] 148 | atlas = ExtResource("9_qqu0i") 149 | region = Rect2(460, 115, 115, 115) 150 | 151 | [sub_resource type="AtlasTexture" id="AtlasTexture_jacnp"] 152 | atlas = ExtResource("9_qqu0i") 153 | region = Rect2(575, 115, 115, 115) 154 | 155 | [sub_resource type="AtlasTexture" id="AtlasTexture_ckp4n"] 156 | atlas = ExtResource("9_qqu0i") 157 | region = Rect2(690, 115, 115, 115) 158 | 159 | [sub_resource type="SpriteFrames" id="SpriteFrames_82bv6"] 160 | animations = [{ 161 | "frames": [SubResource("AtlasTexture_qoe08")], 162 | "loop": true, 163 | "name": &"default", 164 | "speed": 5.0 165 | }, { 166 | "frames": [SubResource("AtlasTexture_ejc0j"), SubResource("AtlasTexture_et6nd"), SubResource("AtlasTexture_dpr67"), SubResource("AtlasTexture_j2flx"), SubResource("AtlasTexture_x1bgx"), SubResource("AtlasTexture_dl5mx"), SubResource("AtlasTexture_rsgtw"), SubResource("AtlasTexture_gdgks")], 167 | "loop": true, 168 | "name": &"move_0", 169 | "speed": 8.0 170 | }, { 171 | "frames": [SubResource("AtlasTexture_5qpn8"), SubResource("AtlasTexture_dnyfi"), SubResource("AtlasTexture_v8k71"), SubResource("AtlasTexture_ynoei"), SubResource("AtlasTexture_a6nu2"), SubResource("AtlasTexture_1op47"), SubResource("AtlasTexture_2sg87"), SubResource("AtlasTexture_567om")], 172 | "loop": true, 173 | "name": &"move_1", 174 | "speed": 8.0 175 | }, { 176 | "frames": [SubResource("AtlasTexture_8145b"), SubResource("AtlasTexture_8c1xm"), SubResource("AtlasTexture_qff0r"), SubResource("AtlasTexture_7p00g"), SubResource("AtlasTexture_uf74h"), SubResource("AtlasTexture_qmraf"), SubResource("AtlasTexture_j1h58"), SubResource("AtlasTexture_jvs2o")], 177 | "loop": true, 178 | "name": &"move_2", 179 | "speed": 8.0 180 | }, { 181 | "frames": [SubResource("AtlasTexture_dwith"), SubResource("AtlasTexture_0xjdu"), SubResource("AtlasTexture_15n00"), SubResource("AtlasTexture_i2qo0"), SubResource("AtlasTexture_6sfgb"), SubResource("AtlasTexture_kijl4"), SubResource("AtlasTexture_jacnp"), SubResource("AtlasTexture_ckp4n")], 182 | "loop": true, 183 | "name": &"move_3", 184 | "speed": 8.0 185 | }] 186 | 187 | [sub_resource type="AtlasTexture" id="AtlasTexture_xihq5"] 188 | atlas = ExtResource("9_d0foh") 189 | region = Rect2(0, 0, 115, 150) 190 | 191 | [sub_resource type="AtlasTexture" id="AtlasTexture_swosm"] 192 | atlas = ExtResource("9_d0foh") 193 | region = Rect2(115, 300, 115, 150) 194 | 195 | [sub_resource type="AtlasTexture" id="AtlasTexture_84eai"] 196 | atlas = ExtResource("9_d0foh") 197 | region = Rect2(0, 300, 115, 150) 198 | 199 | [sub_resource type="AtlasTexture" id="AtlasTexture_oyfx1"] 200 | atlas = ExtResource("9_d0foh") 201 | region = Rect2(115, 0, 115, 150) 202 | 203 | [sub_resource type="AtlasTexture" id="AtlasTexture_63xj4"] 204 | atlas = ExtResource("9_d0foh") 205 | region = Rect2(0, 0, 115, 150) 206 | 207 | [sub_resource type="AtlasTexture" id="AtlasTexture_700x6"] 208 | atlas = ExtResource("9_d0foh") 209 | region = Rect2(115, 450, 115, 150) 210 | 211 | [sub_resource type="AtlasTexture" id="AtlasTexture_ojmtr"] 212 | atlas = ExtResource("9_d0foh") 213 | region = Rect2(0, 450, 115, 150) 214 | 215 | [sub_resource type="AtlasTexture" id="AtlasTexture_8rjxh"] 216 | atlas = ExtResource("9_d0foh") 217 | region = Rect2(115, 150, 115, 150) 218 | 219 | [sub_resource type="AtlasTexture" id="AtlasTexture_6xiw1"] 220 | atlas = ExtResource("9_d0foh") 221 | region = Rect2(0, 150, 115, 150) 222 | 223 | [sub_resource type="SpriteFrames" id="SpriteFrames_4hf5w"] 224 | animations = [{ 225 | "frames": [SubResource("AtlasTexture_xihq5")], 226 | "loop": false, 227 | "name": &"default", 228 | "speed": 5.0 229 | }, { 230 | "frames": [SubResource("AtlasTexture_swosm"), SubResource("AtlasTexture_84eai")], 231 | "loop": false, 232 | "name": &"shoot_0", 233 | "speed": 2.8 234 | }, { 235 | "frames": [SubResource("AtlasTexture_oyfx1"), SubResource("AtlasTexture_63xj4")], 236 | "loop": false, 237 | "name": &"shoot_1", 238 | "speed": 2.8 239 | }, { 240 | "frames": [SubResource("AtlasTexture_700x6"), SubResource("AtlasTexture_ojmtr")], 241 | "loop": false, 242 | "name": &"shoot_2", 243 | "speed": 2.8 244 | }, { 245 | "frames": [SubResource("AtlasTexture_8rjxh"), SubResource("AtlasTexture_6xiw1")], 246 | "loop": false, 247 | "name": &"shoot_3", 248 | "speed": 2.8 249 | }] 250 | 251 | [sub_resource type="Animation" id="Animation_8vu3a"] 252 | resource_name = "Blink" 253 | length = 0.4 254 | tracks/0/type = "value" 255 | tracks/0/imported = false 256 | tracks/0/enabled = true 257 | tracks/0/path = NodePath(".:modulate") 258 | tracks/0/interp = 1 259 | tracks/0/loop_wrap = true 260 | tracks/0/keys = { 261 | "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4), 262 | "transitions": PackedFloat32Array(1, 1, 1, 1, 1), 263 | "update": 0, 264 | "values": [Color(1, 1, 1, 1), Color(0.520833, 0.172007, 0.151272, 1), Color(1, 1, 1, 1), Color(0.520833, 0.172007, 0.151272, 1), Color(1, 1, 1, 1)] 265 | } 266 | 267 | [sub_resource type="Animation" id="Animation_sh1cv"] 268 | length = 0.001 269 | tracks/0/type = "value" 270 | tracks/0/imported = false 271 | tracks/0/enabled = true 272 | tracks/0/path = NodePath(".:modulate") 273 | tracks/0/interp = 1 274 | tracks/0/loop_wrap = true 275 | tracks/0/keys = { 276 | "times": PackedFloat32Array(0), 277 | "transitions": PackedFloat32Array(1), 278 | "update": 0, 279 | "values": [Color(1, 1, 1, 1)] 280 | } 281 | 282 | [sub_resource type="AnimationLibrary" id="AnimationLibrary_70246"] 283 | _data = { 284 | "Blink": SubResource("Animation_8vu3a"), 285 | "RESET": SubResource("Animation_sh1cv") 286 | } 287 | 288 | [node name="Character" instance=ExtResource("1_4ld63")] 289 | scale = Vector2(0.6, 0.6) 290 | y_sort_enabled = true 291 | collision_layer = 2 292 | collision_mask = 97 293 | script = ExtResource("2_q71sv") 294 | gui_path = null 295 | character_stats = ExtResource("3_4j7bh") 296 | inventory = ExtResource("4_ubej3") 297 | physics_stats = SubResource("Resource_h2g7o") 298 | 299 | [node name="CollisionShape2D" type="CollisionShape2D" parent="." index="0"] 300 | position = Vector2(0, -3.33333) 301 | rotation = 1.57079 302 | shape = SubResource("CapsuleShape2D_3vl2b") 303 | 304 | [node name="Visual" parent="." index="1"] 305 | script = ExtResource("5_phrov") 306 | 307 | [node name="Shadow" type="Sprite2D" parent="Visual" index="0"] 308 | modulate = Color(1, 1, 1, 0.533333) 309 | position = Vector2(0.833333, -0.833332) 310 | scale = Vector2(0.504386, 0.509259) 311 | z_index = -1 312 | texture = ExtResource("6_rdbn7") 313 | 314 | [node name="Body" type="AnimatedSprite2D" parent="Visual" index="1"] 315 | position = Vector2(-2.38419e-07, -40) 316 | frames = SubResource("SpriteFrames_82bv6") 317 | animation = &"move_0" 318 | speed_scale = 1.75 319 | offset = Vector2(3.5, 1.5) 320 | 321 | [node name="Head" type="AnimatedSprite2D" parent="Visual" index="2"] 322 | position = Vector2(0, -101.667) 323 | frames = SubResource("SpriteFrames_4hf5w") 324 | animation = &"shoot_3" 325 | speed_scale = 2.0 326 | 327 | [node name="Hat" type="Sprite2D" parent="Visual" index="3"] 328 | position = Vector2(-3.33333, -130) 329 | texture = ExtResource("10_vqe68") 330 | 331 | [node name="DistanceWeapon" parent="Visual" index="4" instance=ExtResource("9_8ad45")] 332 | position = Vector2(0, -3.33333) 333 | holder_character = NodePath("../..") 334 | 335 | [node name="AnimationPlayer" type="AnimationPlayer" parent="Visual" index="5"] 336 | libraries = { 337 | "": SubResource("AnimationLibrary_70246") 338 | } 339 | 340 | [node name="Behavior" parent="." index="2"] 341 | script = ExtResource("10_fjnx3") 342 | 343 | [connection signal="shoot" from="." to="Visual/DistanceWeapon" method="shoot"] 344 | [connection signal="animation_finished" from="Visual/Head" to="Visual" method="_on_head_animation_finished"] 345 | -------------------------------------------------------------------------------- /tiny_wizard/player/player_input.gd: -------------------------------------------------------------------------------- 1 | extends QuiverCharacterBehavior 2 | 3 | 4 | # returns the player input movement direction 5 | func _get_moving_input()->Vector2: 6 | return Input.get_vector("player_left", "player_right", "player_up", "player_down") 7 | 8 | # returns the player input aiming direction 9 | func _get_aiming_input()->Vector2: 10 | return Input.get_vector("player_shoot_left", "player_shoot_right", "player_shoot_up", "player_shoot_down") 11 | 12 | 13 | func _physics_process(delta): 14 | action.moving_direction = _get_moving_input() 15 | action.aiming_direction = _get_aiming_input() 16 | action.shoot = action.aiming_direction.length() > 0 17 | 18 | -------------------------------------------------------------------------------- /tiny_wizard/player/player_stats.gd: -------------------------------------------------------------------------------- 1 | extends QuiverCharacterStats 2 | 3 | # This extension adds shield to the character stats 4 | 5 | var current_shield := 0: 6 | set(value): 7 | if value < 0: 8 | value = 0 9 | current_shield = value 10 | stats_changed.emit() 11 | 12 | 13 | # Redefine damage to take into consideration the shield 14 | func damage(amount:int): 15 | if current_shield > 0: 16 | amount -= current_shield 17 | 18 | if amount > 0: 19 | current_shield = 0 20 | super.damage(amount) 21 | else: 22 | current_shield = -amount 23 | 24 | else: 25 | super.damage(amount) 26 | -------------------------------------------------------------------------------- /tiny_wizard/player/player_stats.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" load_steps=2 format=3 uid="uid://bx4cpu32gty6d"] 2 | 3 | [ext_resource type="Script" path="res://tiny_wizard/player/player_stats.gd" id="1_fpjwe"] 4 | 5 | [resource] 6 | script = ExtResource("1_fpjwe") 7 | max_life = 6 8 | -------------------------------------------------------------------------------- /tiny_wizard/player/weapon/arrow_shooter.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=3 uid="uid://bqdmmt2bdsek2"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://cop8ouksmiyov" path="res://top-down-shooter-core/weapons/distance_weapon.tscn" id="1_0ty35"] 4 | [ext_resource type="PackedScene" uid="uid://bfb5p6vrxtur1" path="res://tiny_wizard/player/weapon/bullet/arrow.tscn" id="2_kki1l"] 5 | 6 | [node name="DistanceWeapon" instance=ExtResource("1_0ty35")] 7 | shoot_delay = 0.4 8 | bullet_scene = ExtResource("2_kki1l") 9 | -------------------------------------------------------------------------------- /tiny_wizard/player/weapon/bullet/arrow.gd: -------------------------------------------------------------------------------- 1 | extends QuiverBullet 2 | 3 | # A custom bullet type that explode 4 | 5 | @export var icon: Texture 6 | 7 | var _freed := false 8 | 9 | func _ready(): 10 | self.tree_exited.connect(_on_tree_exited) 11 | 12 | func _on_tree_exited(): 13 | if _freed: return 14 | _freed = true 15 | $AnimatedSprite2D.play("explode") 16 | ($AnimatedSprite2D as AnimatedSprite2D).animation_finished.connect(self.destroy) 17 | _velocity = Vector2.ZERO 18 | collision_mask = 0 19 | bullet_destroyed.emit() 20 | 21 | func destroy(): 22 | super.queue_free() 23 | -------------------------------------------------------------------------------- /tiny_wizard/player/weapon/bullet/arrow.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=14 format=3 uid="uid://bfb5p6vrxtur1"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://bqsaw7jghbxn4" path="res://top-down-shooter-core/bullets/bullet.tscn" id="1_v0j7v"] 4 | [ext_resource type="Script" path="res://tiny_wizard/player/weapon/bullet/arrow.gd" id="2_5y2tp"] 5 | [ext_resource type="Texture2D" uid="uid://cuwusijx2588i" path="res://tiny_wizard/assets/art/arrow.png" id="4_8iin3"] 6 | [ext_resource type="Texture2D" uid="uid://u2qrtjpgbv2k" path="res://tiny_wizard/assets/placeholder_art/shadow.png" id="4_ajvt1"] 7 | 8 | [sub_resource type="AtlasTexture" id="AtlasTexture_5ixgr"] 9 | atlas = ExtResource("4_8iin3") 10 | region = Rect2(0, 0, 100, 100) 11 | 12 | [sub_resource type="AtlasTexture" id="AtlasTexture_ixiq7"] 13 | atlas = ExtResource("4_8iin3") 14 | region = Rect2(0, 0, 100, 100) 15 | 16 | [sub_resource type="AtlasTexture" id="AtlasTexture_3ohqw"] 17 | atlas = ExtResource("4_8iin3") 18 | region = Rect2(100, 0, 100, 100) 19 | 20 | [sub_resource type="AtlasTexture" id="AtlasTexture_dbya2"] 21 | atlas = ExtResource("4_8iin3") 22 | region = Rect2(200, 0, 100, 100) 23 | 24 | [sub_resource type="AtlasTexture" id="AtlasTexture_2vbij"] 25 | atlas = ExtResource("4_8iin3") 26 | region = Rect2(300, 0, 100, 100) 27 | 28 | [sub_resource type="AtlasTexture" id="AtlasTexture_3653p"] 29 | atlas = ExtResource("4_8iin3") 30 | region = Rect2(400, 0, 100, 100) 31 | 32 | [sub_resource type="AtlasTexture" id="AtlasTexture_1idko"] 33 | atlas = ExtResource("4_8iin3") 34 | region = Rect2(500, 0, 100, 100) 35 | 36 | [sub_resource type="SpriteFrames" id="SpriteFrames_pclq8"] 37 | animations = [{ 38 | "frames": [SubResource("AtlasTexture_ixiq7"), SubResource("AtlasTexture_3ohqw")], 39 | "loop": true, 40 | "name": &"default", 41 | "speed": 5.0 42 | }, { 43 | "frames": [SubResource("AtlasTexture_dbya2"), SubResource("AtlasTexture_2vbij"), SubResource("AtlasTexture_3653p"), SubResource("AtlasTexture_1idko")], 44 | "loop": false, 45 | "name": &"explode", 46 | "speed": 15.0 47 | }] 48 | 49 | [sub_resource type="CircleShape2D" id="CircleShape2D_dukfo"] 50 | radius = 8.33333 51 | 52 | [node name="Bullet" instance=ExtResource("1_v0j7v")] 53 | position = Vector2(0, 0) 54 | scale = Vector2(0.6, 0.6) 55 | y_sort_enabled = true 56 | collision_mask = 73 57 | script = ExtResource("2_5y2tp") 58 | icon = SubResource("AtlasTexture_5ixgr") 59 | speed = 600.0 60 | life_time = 1.2 61 | 62 | [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="0"] 63 | position = Vector2(1.66667, -26.6667) 64 | scale = Vector2(0.6, 0.6) 65 | y_sort_enabled = true 66 | frames = SubResource("SpriteFrames_pclq8") 67 | frame = 1 68 | playing = true 69 | 70 | [node name="CollisionShape2D" type="CollisionShape2D" parent="." index="1"] 71 | position = Vector2(0, -2.28882e-05) 72 | shape = SubResource("CircleShape2D_dukfo") 73 | 74 | [node name="Shadow" type="Sprite2D" parent="." index="2"] 75 | modulate = Color(1, 1, 1, 0.458824) 76 | position = Vector2(0, 1.52588e-05) 77 | scale = Vector2(0.25, 0.25) 78 | z_index = -1 79 | texture = ExtResource("4_ajvt1") 80 | -------------------------------------------------------------------------------- /tiny_wizard/player/weapon/bullet/violet_arrow.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=14 format=3 uid="uid://b6ikwtf8k4nt6"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://bqsaw7jghbxn4" path="res://top-down-shooter-core/bullets/bullet.tscn" id="1_v0j7v"] 4 | [ext_resource type="Script" path="res://tiny_wizard/player/weapon/bullet/arrow.gd" id="2_5y2tp"] 5 | [ext_resource type="Texture2D" uid="uid://cjjugml0purnn" path="res://tiny_wizard/assets/placeholder_art/shadow.png" id="4_ajvt1"] 6 | [ext_resource type="Texture2D" uid="uid://ckcoy8y88yst0" path="res://tiny_wizard/assets/art/violet_arrow.png" id="4_k26la"] 7 | 8 | [sub_resource type="AtlasTexture" id="AtlasTexture_wj2ee"] 9 | atlas = ExtResource("4_k26la") 10 | region = Rect2(0, 0, 100, 100) 11 | 12 | [sub_resource type="AtlasTexture" id="AtlasTexture_5vw8k"] 13 | atlas = ExtResource("4_k26la") 14 | region = Rect2(0, 0, 100, 100) 15 | 16 | [sub_resource type="AtlasTexture" id="AtlasTexture_jc6up"] 17 | atlas = ExtResource("4_k26la") 18 | region = Rect2(100, 0, 100, 100) 19 | 20 | [sub_resource type="AtlasTexture" id="AtlasTexture_j4ud3"] 21 | atlas = ExtResource("4_k26la") 22 | region = Rect2(200, 0, 100, 100) 23 | 24 | [sub_resource type="AtlasTexture" id="AtlasTexture_nntcr"] 25 | atlas = ExtResource("4_k26la") 26 | region = Rect2(300, 0, 100, 100) 27 | 28 | [sub_resource type="AtlasTexture" id="AtlasTexture_q6lrj"] 29 | atlas = ExtResource("4_k26la") 30 | region = Rect2(400, 0, 100, 100) 31 | 32 | [sub_resource type="AtlasTexture" id="AtlasTexture_sjjca"] 33 | atlas = ExtResource("4_k26la") 34 | region = Rect2(500, 0, 100, 100) 35 | 36 | [sub_resource type="SpriteFrames" id="SpriteFrames_uh41j"] 37 | animations = [{ 38 | "frames": [{ 39 | "duration": 1.0, 40 | "texture": SubResource("AtlasTexture_5vw8k") 41 | }, { 42 | "duration": 1.0, 43 | "texture": SubResource("AtlasTexture_jc6up") 44 | }], 45 | "loop": true, 46 | "name": &"default", 47 | "speed": 5.0 48 | }, { 49 | "frames": [{ 50 | "duration": 1.0, 51 | "texture": SubResource("AtlasTexture_j4ud3") 52 | }, { 53 | "duration": 1.0, 54 | "texture": SubResource("AtlasTexture_nntcr") 55 | }, { 56 | "duration": 1.0, 57 | "texture": SubResource("AtlasTexture_q6lrj") 58 | }, { 59 | "duration": 1.0, 60 | "texture": SubResource("AtlasTexture_sjjca") 61 | }], 62 | "loop": false, 63 | "name": &"explode", 64 | "speed": 15.0 65 | }] 66 | 67 | [sub_resource type="CircleShape2D" id="CircleShape2D_cc8co"] 68 | radius = 8.33333 69 | 70 | [node name="Bullet" instance=ExtResource("1_v0j7v")] 71 | y_sort_enabled = true 72 | position = Vector2(0, 0) 73 | scale = Vector2(0.6, 0.6) 74 | collision_mask = 73 75 | script = ExtResource("2_5y2tp") 76 | icon = SubResource("AtlasTexture_wj2ee") 77 | speed = 600.0 78 | life_time = 1.2 79 | damage = 2.0 80 | 81 | [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="0"] 82 | y_sort_enabled = true 83 | position = Vector2(1.66667, -26.6667) 84 | scale = Vector2(0.6, 0.6) 85 | sprite_frames = SubResource("SpriteFrames_uh41j") 86 | autoplay = "default" 87 | 88 | [node name="CollisionShape2D" type="CollisionShape2D" parent="." index="1"] 89 | position = Vector2(0, -2.28882e-05) 90 | shape = SubResource("CircleShape2D_cc8co") 91 | 92 | [node name="Shadow" type="Sprite2D" parent="." index="2"] 93 | modulate = Color(1, 1, 1, 0.458824) 94 | z_index = -1 95 | position = Vector2(0, 1.52588e-05) 96 | scale = Vector2(0.25, 0.25) 97 | texture = ExtResource("4_ajvt1") 98 | -------------------------------------------------------------------------------- /tiny_wizard/room/room.gd: -------------------------------------------------------------------------------- 1 | @tool 2 | class_name Room 3 | extends Node2D 4 | 5 | enum Direction {RIGHT, DOWN, LEFT, UP} 6 | enum Status {UNEXPLORED, EXPLORED} 7 | 8 | const ROOM_SIZE = Vector2(1024,600) 9 | 10 | const OPEN_DOORS = [ 11 | preload("res://tiny_wizard/assets/placeholder_art/Doors/right_door.png"), 12 | preload("res://tiny_wizard/assets/placeholder_art/Doors/down_door.png"), 13 | preload("res://tiny_wizard/assets/placeholder_art/Doors/left_door.png"), 14 | preload("res://tiny_wizard/assets/placeholder_art/Doors/up_door.png"), 15 | ] 16 | 17 | const CLOSED_DOORS = [ 18 | preload("res://tiny_wizard/assets/placeholder_art/Doors/right_door_closed.png"), 19 | preload("res://tiny_wizard/assets/placeholder_art/Doors/down_door_closed.png"), 20 | preload("res://tiny_wizard/assets/placeholder_art/Doors/left_door_closed.png"), 21 | preload("res://tiny_wizard/assets/placeholder_art/Doors/up_door_closed.png"), 22 | ] 23 | 24 | const PLAYER_CHARACTER = preload("res://tiny_wizard/player/player_character.tscn") 25 | const GUI_SCENE = preload("res://tiny_wizard/gui/gui.tscn") 26 | 27 | @onready var doors = [ 28 | $RoomWalls/RightDoor, 29 | $RoomWalls/DownDoor, 30 | $RoomWalls/LeftDoor, 31 | $RoomWalls/UpDoor, 32 | ] 33 | 34 | @onready var spawn_points = [ 35 | $RightSpawnPoint, 36 | $DownSpawnPoint, 37 | $LeftSpawnPoint, 38 | $UpSpawnPoint, 39 | ] 40 | 41 | 42 | @export var hide_right_door := false 43 | @export var hide_down_door := false 44 | @export var hide_left_door := false 45 | @export var hide_up_door := false 46 | 47 | var room_pos := Vector2i.ZERO 48 | 49 | signal door_entered(direction) 50 | 51 | func _ready(): 52 | # This spawns the player if launching the scene from the editor 53 | # This allows to run the room and test it without having to launch the game 54 | if get_tree().current_scene == self: 55 | var player_node = PLAYER_CHARACTER.instantiate() 56 | add_child(player_node) 57 | player_node.position = spawn_points[0].position 58 | enter_room() 59 | var gui = GUI_SCENE.instantiate() 60 | add_child(gui) 61 | player_node.gui_path = gui.get_path() 62 | 63 | # Get the position of the room on the level matrix: (0,0), (0,1)... 64 | func get_room_matrix_position()->Vector2i: 65 | return room_pos 66 | 67 | func get_room_global_position()->Vector2: 68 | return global_position 69 | 70 | func get_room_rect()->Rect2: 71 | return Rect2( 72 | global_position, 73 | ROOM_SIZE 74 | ) 75 | 76 | func update_doors(): 77 | if hide_right_door: _hide_door(Direction.RIGHT) 78 | if hide_down_door: _hide_door(Direction.DOWN) 79 | if hide_left_door: _hide_door(Direction.LEFT) 80 | if hide_up_door: _hide_door(Direction.UP) 81 | 82 | func get_spawning_point(direction): 83 | var dir = Direction.UP 84 | if direction.x > 0: 85 | dir = Direction.RIGHT 86 | if direction.y > 0: 87 | dir = Direction.DOWN 88 | if direction.x < 0: 89 | dir = Direction.LEFT 90 | 91 | return spawn_points[dir] 92 | 93 | func enter_room(): 94 | var enemies = $Enemies.get_children() 95 | if enemies.size() > 0: 96 | # Wake up Enemies 97 | for enemy in enemies: 98 | enemy.set_deferred("process_mode", Node.PROCESS_MODE_INHERIT) 99 | 100 | # Close doors 101 | for d in [Direction.RIGHT, Direction.DOWN, Direction.LEFT, Direction.UP]: 102 | close_door(d) 103 | 104 | func enter_door(_body, door_direction): 105 | door_entered.emit(door_direction) 106 | 107 | func _hide_door(direction): 108 | var door = doors[direction] 109 | door.get_node("Locker").collision_layer = 1 110 | door.visible = false 111 | 112 | func close_door(direction:Direction): 113 | doors[direction].texture = CLOSED_DOORS[direction] 114 | (doors[direction].get_node("Locker") as StaticBody2D).collision_layer = 1 115 | 116 | func open_door(direction:Direction): 117 | doors[direction].texture = OPEN_DOORS[direction] 118 | (doors[direction].get_node("Locker") as StaticBody2D).collision_layer = 0 119 | 120 | 121 | func _on_enemies_child_exiting_tree(node): 122 | # If it is the last enemy (see godotengine/godot #59210) 123 | if $Enemies.get_child_count() == 1: 124 | for d in [Direction.RIGHT, Direction.DOWN, Direction.LEFT, Direction.UP]: 125 | open_door(d) 126 | 127 | -------------------------------------------------------------------------------- /tiny_wizard/room/room.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=18 format=3 uid="uid://de3l1l1odllgl"] 2 | 3 | [ext_resource type="Texture2D" uid="uid://bjfiwnbm17tnx" path="res://tiny_wizard/assets/placeholder_art/doors/down_door.png" id="2_e7uf5"] 4 | [ext_resource type="Texture2D" uid="uid://dejilyb7nodqg" path="res://tiny_wizard/assets/art/room.png" id="2_hc0od"] 5 | [ext_resource type="Script" path="res://tiny_wizard/room/room.gd" id="2_xgkvw"] 6 | [ext_resource type="Texture2D" uid="uid://cqxyrxqrb7lhm" path="res://tiny_wizard/assets/placeholder_art/doors/left_door.png" id="3_0mrgv"] 7 | [ext_resource type="Texture2D" uid="uid://c2l6apt2s8q8f" path="res://tiny_wizard/assets/placeholder_art/doors/right_door.png" id="4_2wnvf"] 8 | [ext_resource type="Texture2D" uid="uid://dtuhal8kv4l1d" path="res://tiny_wizard/assets/placeholder_art/doors/up_door.png" id="5_3b5w2"] 9 | [ext_resource type="Texture2D" uid="uid://h5uwl30wk8xe" path="res://tiny_wizard/assets/art/hole_tileset.png" id="7_lwcn3"] 10 | 11 | [sub_resource type="RectangleShape2D" id="RectangleShape2D_5api5"] 12 | size = Vector2(80, 8) 13 | 14 | [sub_resource type="RectangleShape2D" id="RectangleShape2D_inhan"] 15 | size = Vector2(80, 24) 16 | 17 | [sub_resource type="RectangleShape2D" id="RectangleShape2D_3wuee"] 18 | size = Vector2(8, 48) 19 | 20 | [sub_resource type="RectangleShape2D" id="RectangleShape2D_wvr3b"] 21 | size = Vector2(24, 48) 22 | 23 | [sub_resource type="RectangleShape2D" id="RectangleShape2D_a7l46"] 24 | size = Vector2(8, 48) 25 | 26 | [sub_resource type="RectangleShape2D" id="RectangleShape2D_b7pgd"] 27 | size = Vector2(24, 48) 28 | 29 | [sub_resource type="RectangleShape2D" id="RectangleShape2D_waymt"] 30 | size = Vector2(72, 8) 31 | 32 | [sub_resource type="RectangleShape2D" id="RectangleShape2D_kcdod"] 33 | size = Vector2(72, 24) 34 | 35 | [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_fjj7s"] 36 | texture = ExtResource("7_lwcn3") 37 | texture_region_size = Vector2i(63, 63) 38 | 0:0/0 = 0 39 | 0:0/0/terrain_set = 0 40 | 0:0/0/terrain = 0 41 | 0:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) 42 | 0:0/0/physics_layer_0/angular_velocity = 0.0 43 | 0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-26, -27, 27.5, -26.5, 27, 27, -26, 26.5) 44 | 0:0/0/physics_layer_1/linear_velocity = Vector2(0, 0) 45 | 0:0/0/physics_layer_1/angular_velocity = 0.0 46 | 1:0/0 = 0 47 | 1:0/0/terrain_set = 0 48 | 1:0/0/terrain = 0 49 | 1:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) 50 | 1:0/0/physics_layer_0/angular_velocity = 0.0 51 | 1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-26, -27, 31.5, -26.5, 31.5, 26.5, -26, 26.5) 52 | 1:0/0/physics_layer_1/linear_velocity = Vector2(0, 0) 53 | 1:0/0/physics_layer_1/angular_velocity = 0.0 54 | 1:0/0/terrains_peering_bit/right_side = 0 55 | 2:0/0 = 0 56 | 2:0/0/terrain_set = 0 57 | 2:0/0/terrain = 0 58 | 2:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) 59 | 2:0/0/physics_layer_0/angular_velocity = 0.0 60 | 2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-31.5, -26.5, 31.5, -26.5, 31.5, 26.5, -31.5, 26.5) 61 | 2:0/0/physics_layer_1/linear_velocity = Vector2(0, 0) 62 | 2:0/0/physics_layer_1/angular_velocity = 0.0 63 | 2:0/0/terrains_peering_bit/right_side = 0 64 | 2:0/0/terrains_peering_bit/left_side = 0 65 | 3:0/0 = 0 66 | 3:0/0/terrain_set = 0 67 | 3:0/0/terrain = 0 68 | 3:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) 69 | 3:0/0/physics_layer_0/angular_velocity = 0.0 70 | 3:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-31.5, -26.5, 27, -26.5, 27.5, 26.5, -31.5, 26.5) 71 | 3:0/0/physics_layer_1/linear_velocity = Vector2(0, 0) 72 | 3:0/0/physics_layer_1/angular_velocity = 0.0 73 | 3:0/0/terrains_peering_bit/left_side = 0 74 | 0:1/0 = 0 75 | 0:1/0/terrain_set = 0 76 | 0:1/0/terrain = 0 77 | 0:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) 78 | 0:1/0/physics_layer_0/angular_velocity = 0.0 79 | 0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-27, -27, 31.5, -27, 31.5, 31.5, -26.5, 31.5) 80 | 0:1/0/physics_layer_1/linear_velocity = Vector2(0, 0) 81 | 0:1/0/physics_layer_1/angular_velocity = 0.0 82 | 0:1/0/terrains_peering_bit/right_side = 0 83 | 0:1/0/terrains_peering_bit/bottom_side = 0 84 | 1:1/0 = 0 85 | 1:1/0/terrain_set = 0 86 | 1:1/0/terrain = 0 87 | 1:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) 88 | 1:1/0/physics_layer_0/angular_velocity = 0.0 89 | 1:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-31.5, -26.5, 31.5, -27, 31.5, 31.5, -31.5, 31.5) 90 | 1:1/0/physics_layer_1/linear_velocity = Vector2(0, 0) 91 | 1:1/0/physics_layer_1/angular_velocity = 0.0 92 | 1:1/0/terrains_peering_bit/right_side = 0 93 | 1:1/0/terrains_peering_bit/bottom_side = 0 94 | 1:1/0/terrains_peering_bit/left_side = 0 95 | 2:1/0 = 0 96 | 2:1/0/terrain_set = 0 97 | 2:1/0/terrain = 0 98 | 2:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) 99 | 2:1/0/physics_layer_0/angular_velocity = 0.0 100 | 2:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-31.5, -26.5, 27.5, -26.5, 27, 31.5, -31.5, 31.5) 101 | 2:1/0/physics_layer_1/linear_velocity = Vector2(0, 0) 102 | 2:1/0/physics_layer_1/angular_velocity = 0.0 103 | 2:1/0/terrains_peering_bit/bottom_side = 0 104 | 2:1/0/terrains_peering_bit/left_side = 0 105 | 3:1/0 = 0 106 | 3:1/0/terrain_set = 0 107 | 3:1/0/terrain = 0 108 | 3:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) 109 | 3:1/0/physics_layer_0/angular_velocity = 0.0 110 | 3:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-26.5, -27.5, 26.5, -27.5, 26, 31.5, -26.5, 31.5) 111 | 3:1/0/physics_layer_1/linear_velocity = Vector2(0, 0) 112 | 3:1/0/physics_layer_1/angular_velocity = 0.0 113 | 3:1/0/terrains_peering_bit/bottom_side = 0 114 | 0:2/0 = 0 115 | 0:2/0/terrain_set = 0 116 | 0:2/0/terrain = 0 117 | 0:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) 118 | 0:2/0/physics_layer_0/angular_velocity = 0.0 119 | 0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-26, -31.5, 31.5, -31.5, 31.5, 31.5, -26, 31.5) 120 | 0:2/0/physics_layer_1/linear_velocity = Vector2(0, 0) 121 | 0:2/0/physics_layer_1/angular_velocity = 0.0 122 | 0:2/0/terrains_peering_bit/right_side = 0 123 | 0:2/0/terrains_peering_bit/bottom_side = 0 124 | 0:2/0/terrains_peering_bit/top_side = 0 125 | 1:2/0 = 0 126 | 1:2/0/terrain_set = 0 127 | 1:2/0/terrain = 0 128 | 1:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) 129 | 1:2/0/physics_layer_0/angular_velocity = 0.0 130 | 1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-31.5, -31.5, 31.5, -31.5, 31.5, 31.5, -31.5, 31.5) 131 | 1:2/0/physics_layer_1/linear_velocity = Vector2(0, 0) 132 | 1:2/0/physics_layer_1/angular_velocity = 0.0 133 | 1:2/0/terrains_peering_bit/right_side = 0 134 | 1:2/0/terrains_peering_bit/bottom_side = 0 135 | 1:2/0/terrains_peering_bit/left_side = 0 136 | 1:2/0/terrains_peering_bit/top_side = 0 137 | 2:2/0 = 0 138 | 2:2/0/terrain_set = 0 139 | 2:2/0/terrain = 0 140 | 2:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) 141 | 2:2/0/physics_layer_0/angular_velocity = 0.0 142 | 2:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-31.5, -31.5, 27, -31.5, 27, 31.5, -31.5, 31.5) 143 | 2:2/0/physics_layer_1/linear_velocity = Vector2(0, 0) 144 | 2:2/0/physics_layer_1/angular_velocity = 0.0 145 | 2:2/0/terrains_peering_bit/bottom_side = 0 146 | 2:2/0/terrains_peering_bit/left_side = 0 147 | 2:2/0/terrains_peering_bit/top_side = 0 148 | 0:3/0 = 0 149 | 0:3/0/terrain_set = 0 150 | 0:3/0/terrain = 0 151 | 0:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) 152 | 0:3/0/physics_layer_0/angular_velocity = 0.0 153 | 0:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-26, -31.5, 31.5, -31.5, 31.5, 27.5, -26, 27) 154 | 0:3/0/physics_layer_1/linear_velocity = Vector2(0, 0) 155 | 0:3/0/physics_layer_1/angular_velocity = 0.0 156 | 0:3/0/terrains_peering_bit/right_side = 0 157 | 0:3/0/terrains_peering_bit/top_side = 0 158 | 1:3/0 = 0 159 | 1:3/0/terrain_set = 0 160 | 1:3/0/terrain = 0 161 | 1:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) 162 | 1:3/0/physics_layer_0/angular_velocity = 0.0 163 | 1:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-31.5, -31.5, 31.5, -31.5, 31.5, 27.5, -31.5, 27) 164 | 1:3/0/physics_layer_1/linear_velocity = Vector2(0, 0) 165 | 1:3/0/physics_layer_1/angular_velocity = 0.0 166 | 1:3/0/terrains_peering_bit/right_side = 0 167 | 1:3/0/terrains_peering_bit/left_side = 0 168 | 1:3/0/terrains_peering_bit/top_side = 0 169 | 2:3/0 = 0 170 | 2:3/0/terrain_set = 0 171 | 2:3/0/terrain = 0 172 | 2:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) 173 | 2:3/0/physics_layer_0/angular_velocity = 0.0 174 | 2:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-31.5, -31.5, 27, -31.5, 26, 26.5, -31.5, 26.5) 175 | 2:3/0/physics_layer_1/linear_velocity = Vector2(0, 0) 176 | 2:3/0/physics_layer_1/angular_velocity = 0.0 177 | 2:3/0/terrains_peering_bit/left_side = 0 178 | 2:3/0/terrains_peering_bit/top_side = 0 179 | 3:2/0 = 0 180 | 3:2/0/terrain_set = 0 181 | 3:2/0/terrain = 0 182 | 3:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) 183 | 3:2/0/physics_layer_0/angular_velocity = 0.0 184 | 3:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-26, -31.5, 26.5, -31.5, 26, 31.5, -26.5, 31.5) 185 | 3:2/0/physics_layer_1/linear_velocity = Vector2(0, 0) 186 | 3:2/0/physics_layer_1/angular_velocity = 0.0 187 | 3:2/0/terrains_peering_bit/bottom_side = 0 188 | 3:2/0/terrains_peering_bit/top_side = 0 189 | 3:3/0 = 0 190 | 3:3/0/terrain_set = 0 191 | 3:3/0/terrain = 0 192 | 3:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) 193 | 3:3/0/physics_layer_0/angular_velocity = 0.0 194 | 3:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-25.5, -31.5, 26.5, -31.5, 26, 27, -26, 26.5) 195 | 3:3/0/physics_layer_1/linear_velocity = Vector2(0, 0) 196 | 3:3/0/physics_layer_1/angular_velocity = 0.0 197 | 3:3/0/terrains_peering_bit/top_side = 0 198 | 4:1/0 = 0 199 | 4:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) 200 | 4:1/0/physics_layer_0/angular_velocity = 0.0 201 | 4:1/0/physics_layer_1/linear_velocity = Vector2(0, 0) 202 | 4:1/0/physics_layer_1/angular_velocity = 0.0 203 | 4:1/0/physics_layer_1/polygon_0/points = PackedVector2Array(-31.5, -31.5, 31.5, -31.5, 31.5, 31.5, -31.5, 31.5) 204 | 4:2/0 = 0 205 | 4:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) 206 | 4:2/0/physics_layer_0/angular_velocity = 0.0 207 | 4:2/0/physics_layer_1/linear_velocity = Vector2(0, 0) 208 | 4:2/0/physics_layer_1/angular_velocity = 0.0 209 | 210 | [sub_resource type="TileSet" id="TileSet_is1mf"] 211 | tile_size = Vector2i(63, 63) 212 | physics_layer_0/collision_layer = 32 213 | physics_layer_0/collision_mask = 0 214 | physics_layer_1/collision_layer = 64 215 | physics_layer_1/collision_mask = 0 216 | terrain_set_0/mode = 2 217 | terrain_set_0/terrain_0/name = "Holes" 218 | terrain_set_0/terrain_0/color = Color(0.501961, 0.345098, 0.25098, 1) 219 | custom_data_layer_0/name = "" 220 | custom_data_layer_0/type = 0 221 | sources/0 = SubResource("TileSetAtlasSource_fjj7s") 222 | 223 | [node name="Room" type="Node2D"] 224 | position = Vector2(0, 200) 225 | y_sort_enabled = true 226 | script = ExtResource("2_xgkvw") 227 | 228 | [node name="RoomWalls" type="Sprite2D" parent="."] 229 | z_index = -3 230 | texture = ExtResource("2_hc0od") 231 | centered = false 232 | 233 | [node name="DownDoor" type="Sprite2D" parent="RoomWalls"] 234 | position = Vector2(512, 557) 235 | texture = ExtResource("2_e7uf5") 236 | 237 | [node name="Area2D" type="Area2D" parent="RoomWalls/DownDoor"] 238 | collision_layer = 0 239 | collision_mask = 2 240 | 241 | [node name="CollisionShape2D" type="CollisionShape2D" parent="RoomWalls/DownDoor/Area2D"] 242 | position = Vector2(0, -17) 243 | shape = SubResource("RectangleShape2D_5api5") 244 | 245 | [node name="Locker" type="StaticBody2D" parent="RoomWalls/DownDoor"] 246 | position = Vector2(0, -13) 247 | collision_layer = 0 248 | collision_mask = 15 249 | 250 | [node name="CollisionShape2D" type="CollisionShape2D" parent="RoomWalls/DownDoor/Locker"] 251 | position = Vector2(0, -12) 252 | shape = SubResource("RectangleShape2D_inhan") 253 | 254 | [node name="LeftDoor" type="Sprite2D" parent="RoomWalls"] 255 | position = Vector2(48, 280) 256 | texture = ExtResource("3_0mrgv") 257 | 258 | [node name="Area2D" type="Area2D" parent="RoomWalls/LeftDoor"] 259 | collision_layer = 0 260 | collision_mask = 2 261 | 262 | [node name="CollisionShape2D" type="CollisionShape2D" parent="RoomWalls/LeftDoor/Area2D"] 263 | position = Vector2(-4, 0) 264 | shape = SubResource("RectangleShape2D_3wuee") 265 | 266 | [node name="Locker" type="StaticBody2D" parent="RoomWalls/LeftDoor"] 267 | collision_layer = 0 268 | 269 | [node name="CollisionShape2D" type="CollisionShape2D" parent="RoomWalls/LeftDoor/Locker"] 270 | position = Vector2(4, 0) 271 | shape = SubResource("RectangleShape2D_wvr3b") 272 | 273 | [node name="RightDoor" type="Sprite2D" parent="RoomWalls"] 274 | position = Vector2(979, 280) 275 | texture = ExtResource("4_2wnvf") 276 | 277 | [node name="Area2D" type="Area2D" parent="RoomWalls/RightDoor"] 278 | collision_layer = 0 279 | collision_mask = 2 280 | 281 | [node name="CollisionShape2D" type="CollisionShape2D" parent="RoomWalls/RightDoor/Area2D"] 282 | position = Vector2(1, 0) 283 | shape = SubResource("RectangleShape2D_a7l46") 284 | 285 | [node name="Locker" type="StaticBody2D" parent="RoomWalls/RightDoor"] 286 | collision_layer = 0 287 | 288 | [node name="CollisionShape2D" type="CollisionShape2D" parent="RoomWalls/RightDoor/Locker"] 289 | position = Vector2(-7, 0) 290 | shape = SubResource("RectangleShape2D_b7pgd") 291 | 292 | [node name="UpDoor" type="Sprite2D" parent="RoomWalls"] 293 | position = Vector2(515, 51) 294 | texture = ExtResource("5_3b5w2") 295 | 296 | [node name="Area2D" type="Area2D" parent="RoomWalls/UpDoor"] 297 | collision_layer = 0 298 | collision_mask = 2 299 | 300 | [node name="CollisionShape2D" type="CollisionShape2D" parent="RoomWalls/UpDoor/Area2D"] 301 | position = Vector2(1, 9) 302 | shape = SubResource("RectangleShape2D_waymt") 303 | 304 | [node name="Locker" type="StaticBody2D" parent="RoomWalls/UpDoor"] 305 | collision_layer = 0 306 | 307 | [node name="CollisionShape2D" type="CollisionShape2D" parent="RoomWalls/UpDoor/Locker"] 308 | position = Vector2(1, 17) 309 | shape = SubResource("RectangleShape2D_kcdod") 310 | 311 | [node name="StaticBody2D" type="StaticBody2D" parent="RoomWalls"] 312 | collision_mask = 15 313 | 314 | [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="RoomWalls/StaticBody2D"] 315 | polygon = PackedVector2Array(0, 80, 480, 80, 480, 56, 552, 56, 552, 80, 960, 80, 960, 256, 984, 256, 984, 304, 960, 304, 960, 520, 552, 520, 552, 544, 472, 544, 472, 520, 64, 520, 64, 304, 40, 304, 40, 256, 64, 256, 64, 80, 0, 80, 0, 600, 1024, 600, 1024, 0, 0, 0) 316 | 317 | [node name="RightSpawnPoint" type="Position2D" parent="."] 318 | position = Vector2(88, 280) 319 | 320 | [node name="DownSpawnPoint" type="Position2D" parent="."] 321 | position = Vector2(512, 104) 322 | 323 | [node name="LeftSpawnPoint" type="Position2D" parent="."] 324 | position = Vector2(936, 280) 325 | 326 | [node name="UpSpawnPoint" type="Position2D" parent="."] 327 | position = Vector2(512, 496) 328 | 329 | [node name="Enemies" type="Node2D" parent="."] 330 | y_sort_enabled = true 331 | 332 | [node name="TileMap" type="TileMap" parent="."] 333 | position = Vector2(8, 20) 334 | tile_set = SubResource("TileSet_is1mf") 335 | format = 2 336 | layer_0/name = "Ground" 337 | layer_0/z_index = -2 338 | 339 | [connection signal="body_entered" from="RoomWalls/DownDoor/Area2D" to="." method="enter_door" binds= [Vector2(0, 1)]] 340 | [connection signal="body_entered" from="RoomWalls/LeftDoor/Area2D" to="." method="enter_door" binds= [Vector2(-1, 0)]] 341 | [connection signal="body_entered" from="RoomWalls/RightDoor/Area2D" to="." method="enter_door" binds= [Vector2(1, 0)]] 342 | [connection signal="body_entered" from="RoomWalls/UpDoor/Area2D" to="." method="enter_door" binds= [Vector2(0, -1)]] 343 | [connection signal="child_exiting_tree" from="Enemies" to="." method="_on_enemies_child_exiting_tree"] 344 | -------------------------------------------------------------------------------- /tiny_wizard/room/room_types/room_1.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=12 format=3 uid="uid://d01c1dqufo578"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://de3l1l1odllgl" path="res://tiny_wizard/room/room.tscn" id="1_o627n"] 4 | [ext_resource type="PackedScene" uid="uid://cnoc26x8qgyyw" path="res://tiny_wizard/enemies/black_fly/black_fly.tscn" id="2_htb2l"] 5 | [ext_resource type="Script" path="res://top-down-shooter-core/character/character_stats/character_stats.gd" id="3_opten"] 6 | [ext_resource type="PackedScene" uid="uid://8gachgsj3jdx" path="res://tiny_wizard/enemies/red_fly/red_fly.tscn" id="4_5fybu"] 7 | [ext_resource type="Script" path="res://top-down-shooter-core/character/character_stats/physics_stats.gd" id="4_knq7s"] 8 | 9 | [sub_resource type="Resource" id="Resource_pm8y8"] 10 | resource_local_to_scene = true 11 | script = ExtResource("3_opten") 12 | max_life = 3 13 | 14 | [sub_resource type="Resource" id="Resource_mh6ji"] 15 | resource_local_to_scene = true 16 | script = ExtResource("4_knq7s") 17 | max_speed = 75.0 18 | acceleration = 0.4 19 | friction = 0.1 20 | impulse_force = 500.0 21 | 22 | [sub_resource type="Resource" id="Resource_i5vyh"] 23 | resource_local_to_scene = true 24 | script = ExtResource("3_opten") 25 | max_life = 3 26 | 27 | [sub_resource type="Resource" id="Resource_76yfb"] 28 | resource_local_to_scene = true 29 | script = ExtResource("4_knq7s") 30 | max_speed = 75.0 31 | acceleration = 0.4 32 | friction = 0.1 33 | impulse_force = 500.0 34 | 35 | [sub_resource type="Resource" id="Resource_qt1ii"] 36 | script = ExtResource("3_opten") 37 | max_life = 3 38 | 39 | [sub_resource type="Resource" id="Resource_yoef2"] 40 | resource_local_to_scene = true 41 | script = ExtResource("4_knq7s") 42 | max_speed = 90.0 43 | acceleration = 0.4 44 | friction = 0.1 45 | impulse_force = 500.0 46 | 47 | [node name="Room" instance=ExtResource("1_o627n")] 48 | 49 | [node name="BlackFly" parent="Enemies" index="0" instance=ExtResource("2_htb2l")] 50 | position = Vector2(680, 232) 51 | character_stats = SubResource("Resource_pm8y8") 52 | physics_stats = SubResource("Resource_mh6ji") 53 | 54 | [node name="BlackFly2" parent="Enemies" index="1" instance=ExtResource("2_htb2l")] 55 | position = Vector2(736, 296) 56 | character_stats = SubResource("Resource_i5vyh") 57 | physics_stats = SubResource("Resource_76yfb") 58 | 59 | [node name="RedFly" parent="Enemies" index="2" instance=ExtResource("4_5fybu")] 60 | position = Vector2(792, 328) 61 | character_stats = SubResource("Resource_qt1ii") 62 | physics_stats = SubResource("Resource_yoef2") 63 | -------------------------------------------------------------------------------- /tiny_wizard/room/room_types/room_2.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=13 format=3 uid="uid://c70wougnmqni2"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://de3l1l1odllgl" path="res://tiny_wizard/room/room.tscn" id="1_o627n"] 4 | [ext_resource type="PackedScene" uid="uid://cnoc26x8qgyyw" path="res://tiny_wizard/enemies/black_fly/black_fly.tscn" id="2_htb2l"] 5 | [ext_resource type="Script" path="res://top-down-shooter-core/character/character_stats/character_stats.gd" id="3_opten"] 6 | [ext_resource type="Script" path="res://top-down-shooter-core/character/character_stats/physics_stats.gd" id="4_rhwwk"] 7 | 8 | [sub_resource type="Resource" id="Resource_5kpmg"] 9 | resource_local_to_scene = true 10 | script = ExtResource("3_opten") 11 | max_life = 3 12 | 13 | [sub_resource type="Resource" id="Resource_1gfsp"] 14 | resource_local_to_scene = true 15 | script = ExtResource("4_rhwwk") 16 | max_speed = 75.0 17 | acceleration = 0.4 18 | friction = 0.1 19 | impulse_force = 500.0 20 | 21 | [sub_resource type="Resource" id="Resource_2cwfj"] 22 | resource_local_to_scene = true 23 | script = ExtResource("3_opten") 24 | max_life = 3 25 | 26 | [sub_resource type="Resource" id="Resource_8gqxl"] 27 | resource_local_to_scene = true 28 | script = ExtResource("4_rhwwk") 29 | max_speed = 75.0 30 | acceleration = 0.4 31 | friction = 0.1 32 | impulse_force = 500.0 33 | 34 | [sub_resource type="Resource" id="Resource_unumj"] 35 | resource_local_to_scene = true 36 | script = ExtResource("3_opten") 37 | max_life = 3 38 | 39 | [sub_resource type="Resource" id="Resource_6f13c"] 40 | resource_local_to_scene = true 41 | script = ExtResource("4_rhwwk") 42 | max_speed = 75.0 43 | acceleration = 0.4 44 | friction = 0.1 45 | impulse_force = 500.0 46 | 47 | [sub_resource type="Resource" id="Resource_bnjyu"] 48 | resource_local_to_scene = true 49 | script = ExtResource("3_opten") 50 | max_life = 3 51 | 52 | [sub_resource type="Resource" id="Resource_65m3g"] 53 | resource_local_to_scene = true 54 | script = ExtResource("4_rhwwk") 55 | max_speed = 75.0 56 | acceleration = 0.4 57 | friction = 0.1 58 | impulse_force = 500.0 59 | 60 | [node name="Room" instance=ExtResource("1_o627n")] 61 | 62 | [node name="BlackFly" parent="Enemies" index="0" instance=ExtResource("2_htb2l")] 63 | position = Vector2(680, 232) 64 | character_stats = SubResource("Resource_5kpmg") 65 | physics_stats = SubResource("Resource_1gfsp") 66 | 67 | [node name="BlackFly2" parent="Enemies" index="1" instance=ExtResource("2_htb2l")] 68 | position = Vector2(736, 296) 69 | character_stats = SubResource("Resource_2cwfj") 70 | physics_stats = SubResource("Resource_8gqxl") 71 | 72 | [node name="BlackFly3" parent="Enemies" index="2" instance=ExtResource("2_htb2l")] 73 | position = Vector2(680, 352) 74 | character_stats = SubResource("Resource_unumj") 75 | physics_stats = SubResource("Resource_6f13c") 76 | 77 | [node name="BlackFly4" parent="Enemies" index="3" instance=ExtResource("2_htb2l")] 78 | position = Vector2(776, 232) 79 | character_stats = SubResource("Resource_bnjyu") 80 | physics_stats = SubResource("Resource_65m3g") 81 | 82 | [node name="TileMap" parent="." index="6"] 83 | position = Vector2(8, 25) 84 | layer_0/tile_data = PackedInt32Array(393217, 262144, 1, 196609, 262144, 1, 327681, 262144, 1, 131073, 262144, 1, 65542, 262144, 1, 458758, 262144, 1, 196622, 262144, 1, 327694, 262144, 1, 393230, 262144, 1, 131086, 262144, 1, 65545, 262144, 1, 458761, 262144, 1) 85 | -------------------------------------------------------------------------------- /tiny_wizard/room/room_types/room_3.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=8 format=3 uid="uid://clrh7n7dsc2nj"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://de3l1l1odllgl" path="res://tiny_wizard/room/room.tscn" id="1_43kv8"] 4 | [ext_resource type="PackedScene" uid="uid://bu83qkq8qqvg6" path="res://tiny_wizard/interactable_objects/chests/chest.tscn" id="2_tyont"] 5 | [ext_resource type="Resource" uid="uid://6d63alr8jx35" path="res://tiny_wizard/items/coin/coin.tres" id="3_1krdd"] 6 | [ext_resource type="PackedScene" uid="uid://n34r6hwb62n6" path="res://tiny_wizard/items/hearts/half_heart.tscn" id="3_vpvpb"] 7 | [ext_resource type="PackedScene" uid="uid://o3yevur5onpt" path="res://tiny_wizard/interactable_objects/chests/locked_chest.tscn" id="4_bwbuu"] 8 | [ext_resource type="Resource" uid="uid://dns8t84rxp4x5" path="res://tiny_wizard/items/pickable_bomb/bomb.tres" id="5_uwgop"] 9 | [ext_resource type="Resource" uid="uid://bqy1wutr06tk8" path="res://tiny_wizard/items/hearts/half_shield.tres" id="7_1cdyb"] 10 | 11 | [node name="Room" instance=ExtResource("1_43kv8")] 12 | 13 | [node name="TileMap" parent="." index="6"] 14 | layer_0/tile_data = PackedInt32Array(196616, 262144, 1, 196613, 0, 1, 262149, 196608, 2, 327685, 0, 3, 327686, 196608, 0, 196614, 196608, 0, 196617, 65536, 0, 327689, 65536, 0, 327688, 262144, 1, 327687, 262144, 1, 196615, 262144, 1, 196618, 131072, 1, 262154, 196608, 2, 327690, 131072, 3) 15 | 16 | [node name="Chest" parent="." index="7" instance=ExtResource("2_tyont")] 17 | position = Vector2(416, 314) 18 | items = [ExtResource("3_1krdd"), ExtResource("3_vpvpb")] 19 | 20 | [node name="Chest2" parent="." index="8" instance=ExtResource("4_bwbuu")] 21 | position = Vector2(604, 320) 22 | items = [ExtResource("3_1krdd"), ExtResource("5_uwgop"), ExtResource("7_1cdyb")] 23 | -------------------------------------------------------------------------------- /tiny_wizard/room/room_types/room_4.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=3 uid="uid://buq05y654f2am"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://de3l1l1odllgl" path="res://tiny_wizard/room/room.tscn" id="1_43kv8"] 4 | [ext_resource type="PackedScene" uid="uid://btijy130wqauo" path="res://tiny_wizard/items/violet_arrow/violet_arrow.tscn" id="2_6ynv7"] 5 | 6 | [node name="Room" instance=ExtResource("1_43kv8")] 7 | 8 | [node name="TileMap" parent="." index="6"] 9 | layer_0/tile_data = PackedInt32Array(196616, 262144, 1, 196613, 0, 1, 262149, 0, 2, 327685, 0, 3, 327686, 65536, 3, 196614, 131072, 1, 196617, 0, 1, 327689, 65536, 3, 196615, 262144, 1, 196618, 131072, 1, 262154, 131072, 2, 327690, 131072, 3, 327687, 131072, 0, 327688, 131072, 0, 262150, 131072, 2, 262153, 0, 2, 131079, 262144, 1, 131080, 262144, 1) 10 | 11 | [node name="VioletArrow" parent="." index="7" instance=ExtResource("2_6ynv7")] 12 | position = Vector2(508, 316) 13 | -------------------------------------------------------------------------------- /tiny_wizard/room/room_types/room_5.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=3 uid="uid://cny2yyynrb4qo"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://de3l1l1odllgl" path="res://tiny_wizard/room/room.tscn" id="1_43kv8"] 4 | [ext_resource type="PackedScene" uid="uid://ch5dnqr8q5qdy" path="res://tiny_wizard/items/pickable_bomb/pickable_bomb.tscn" id="2_00t0x"] 5 | 6 | [node name="Room" instance=ExtResource("1_43kv8")] 7 | 8 | [node name="PickableBomb" parent="." index="7" instance=ExtResource("2_00t0x")] 9 | position = Vector2(455, 305) 10 | 11 | [node name="PickableBomb3" parent="." index="8" instance=ExtResource("2_00t0x")] 12 | position = Vector2(398, 329) 13 | 14 | [node name="PickableBomb4" parent="." index="9" instance=ExtResource("2_00t0x")] 15 | position = Vector2(398, 329) 16 | 17 | [node name="PickableBomb2" parent="." index="10" instance=ExtResource("2_00t0x")] 18 | position = Vector2(513, 331) 19 | 20 | [node name="PickableBomb5" parent="." index="11" instance=ExtResource("2_00t0x")] 21 | position = Vector2(494, 300) 22 | 23 | [node name="PickableBomb6" parent="." index="12" instance=ExtResource("2_00t0x")] 24 | position = Vector2(455, 334) 25 | 26 | [node name="PickableBomb7" parent="." index="13" instance=ExtResource("2_00t0x")] 27 | position = Vector2(366, 295) 28 | 29 | [node name="PickableBomb8" parent="." index="14" instance=ExtResource("2_00t0x")] 30 | position = Vector2(321, 316) 31 | -------------------------------------------------------------------------------- /tiny_wizard/room/room_types/room_6.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=3 uid="uid://bog1ldcsq4qxe"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://de3l1l1odllgl" path="res://tiny_wizard/room/room.tscn" id="1_43kv8"] 4 | [ext_resource type="PackedScene" uid="uid://bu83qkq8qqvg6" path="res://tiny_wizard/interactable_objects/chests/chest.tscn" id="3_rxhyj"] 5 | [ext_resource type="Resource" uid="uid://6d63alr8jx35" path="res://tiny_wizard/items/coin/coin.tres" id="3_u0lwx"] 6 | [ext_resource type="Resource" uid="uid://ca80nqtdifi7q" path="res://tiny_wizard/items/key/key.tres" id="4_sp77y"] 7 | 8 | [node name="Room" instance=ExtResource("1_43kv8")] 9 | 10 | [node name="TileMap" parent="." index="6"] 11 | layer_0/tile_data = PackedInt32Array(196611, 131072, 3, 131075, 131072, 1, 131074, 0, 1, 196610, 0, 3, 327682, 0, 1, 393218, 0, 3, 393219, 131072, 3, 327683, 131072, 1, 196614, 196608, 1, 262150, 196608, 2, 327686, 196608, 3, 196617, 196608, 1, 262153, 196608, 2, 327689, 196608, 3, 131084, 0, 1, 196620, 0, 3, 196621, 131072, 3, 131085, 131072, 1, 327692, 0, 1, 393228, 0, 3, 393229, 131072, 3, 327693, 131072, 1) 12 | 13 | [node name="Chest" parent="." index="7" instance=ExtResource("3_rxhyj")] 14 | position = Vector2(503, 323) 15 | items = [ExtResource("3_u0lwx"), ExtResource("4_sp77y")] 16 | -------------------------------------------------------------------------------- /tiny_wizard/room/room_types/room_7.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=17 format=3 uid="uid://bs2vw66dejdbp"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://de3l1l1odllgl" path="res://tiny_wizard/room/room.tscn" id="1_43kv8"] 4 | [ext_resource type="PackedScene" uid="uid://8gachgsj3jdx" path="res://tiny_wizard/enemies/red_fly/red_fly.tscn" id="2_e0ixt"] 5 | [ext_resource type="Script" path="res://top-down-shooter-core/character/character_stats/character_stats.gd" id="3_bk2rq"] 6 | [ext_resource type="Script" path="res://top-down-shooter-core/character/character_stats/physics_stats.gd" id="4_b4eal"] 7 | 8 | [sub_resource type="Resource" id="Resource_vkqm6"] 9 | resource_local_to_scene = true 10 | script = ExtResource("3_bk2rq") 11 | max_life = 3 12 | 13 | [sub_resource type="Resource" id="Resource_dxvll"] 14 | resource_local_to_scene = true 15 | script = ExtResource("4_b4eal") 16 | max_speed = 90.0 17 | acceleration = 0.4 18 | friction = 0.1 19 | impulse_force = 500.0 20 | 21 | [sub_resource type="Resource" id="Resource_847to"] 22 | resource_local_to_scene = true 23 | script = ExtResource("3_bk2rq") 24 | max_life = 3 25 | 26 | [sub_resource type="Resource" id="Resource_andfy"] 27 | resource_local_to_scene = true 28 | script = ExtResource("4_b4eal") 29 | max_speed = 90.0 30 | acceleration = 0.4 31 | friction = 0.1 32 | impulse_force = 500.0 33 | 34 | [sub_resource type="Resource" id="Resource_2o21i"] 35 | resource_local_to_scene = true 36 | script = ExtResource("3_bk2rq") 37 | max_life = 3 38 | 39 | [sub_resource type="Resource" id="Resource_77tc8"] 40 | resource_local_to_scene = true 41 | script = ExtResource("4_b4eal") 42 | max_speed = 90.0 43 | acceleration = 0.4 44 | friction = 0.1 45 | impulse_force = 500.0 46 | 47 | [sub_resource type="Resource" id="Resource_kb438"] 48 | resource_local_to_scene = true 49 | script = ExtResource("3_bk2rq") 50 | max_life = 3 51 | 52 | [sub_resource type="Resource" id="Resource_rwcv0"] 53 | resource_local_to_scene = true 54 | script = ExtResource("4_b4eal") 55 | max_speed = 90.0 56 | acceleration = 0.4 57 | friction = 0.1 58 | impulse_force = 500.0 59 | 60 | [sub_resource type="Resource" id="Resource_s64q8"] 61 | resource_local_to_scene = true 62 | script = ExtResource("3_bk2rq") 63 | max_life = 3 64 | 65 | [sub_resource type="Resource" id="Resource_q360p"] 66 | resource_local_to_scene = true 67 | script = ExtResource("4_b4eal") 68 | max_speed = 90.0 69 | acceleration = 0.4 70 | friction = 0.1 71 | impulse_force = 500.0 72 | 73 | [sub_resource type="Resource" id="Resource_1beyd"] 74 | script = ExtResource("3_bk2rq") 75 | max_life = 6 76 | 77 | [sub_resource type="Resource" id="Resource_t3alx"] 78 | resource_local_to_scene = true 79 | resource_name = "SpecialRedFlyPS" 80 | script = ExtResource("4_b4eal") 81 | max_speed = 110.0 82 | acceleration = 0.8 83 | friction = 0.1 84 | impulse_force = 350.0 85 | 86 | [node name="Room" instance=ExtResource("1_43kv8")] 87 | 88 | [node name="RedFly" parent="Enemies" index="0" instance=ExtResource("2_e0ixt")] 89 | position = Vector2(485, 306) 90 | character_stats = SubResource("Resource_vkqm6") 91 | physics_stats = SubResource("Resource_dxvll") 92 | 93 | [node name="RedFly2" parent="Enemies" index="1" instance=ExtResource("2_e0ixt")] 94 | position = Vector2(540, 304) 95 | character_stats = SubResource("Resource_847to") 96 | physics_stats = SubResource("Resource_andfy") 97 | 98 | [node name="RedFly3" parent="Enemies" index="2" instance=ExtResource("2_e0ixt")] 99 | position = Vector2(510, 258) 100 | character_stats = SubResource("Resource_2o21i") 101 | physics_stats = SubResource("Resource_77tc8") 102 | 103 | [node name="RedFly4" parent="Enemies" index="3" instance=ExtResource("2_e0ixt")] 104 | position = Vector2(512, 356) 105 | character_stats = SubResource("Resource_kb438") 106 | physics_stats = SubResource("Resource_rwcv0") 107 | 108 | [node name="RedFly5" parent="Enemies" index="4" instance=ExtResource("2_e0ixt")] 109 | position = Vector2(921, 122) 110 | character_stats = SubResource("Resource_s64q8") 111 | physics_stats = SubResource("Resource_q360p") 112 | 113 | [node name="RedFly6" parent="Enemies" index="5" instance=ExtResource("2_e0ixt")] 114 | modulate = Color(1, 0, 0.509804, 1) 115 | position = Vector2(921, 499) 116 | scale = Vector2(0.8, 0.8) 117 | character_stats = SubResource("Resource_1beyd") 118 | physics_stats = SubResource("Resource_t3alx") 119 | 120 | [node name="Visual" parent="Enemies/RedFly6" index="0"] 121 | modulate = Color(0.52549, 0.309804, 1, 1) 122 | 123 | [node name="TileMap" parent="." index="6"] 124 | layer_0/tile_data = PackedInt32Array(196611, 131072, 3, 131075, 131072, 1, 131074, 0, 1, 196610, 0, 3, 327682, 0, 1, 393218, 0, 3, 393219, 131072, 3, 327683, 131072, 1, 196614, 196608, 1, 262150, 196608, 2, 327686, 196608, 3, 196617, 196608, 1, 262153, 196608, 2, 327689, 196608, 3, 131084, 0, 1, 196620, 0, 3, 196621, 131072, 3, 131085, 131072, 1, 327692, 0, 1, 393228, 0, 3, 393229, 131072, 3, 327693, 131072, 1, 131073, 262144, 1, 393217, 262144, 1, 196613, 262144, 1, 327685, 262144, 1, 196618, 262144, 1, 327690, 262144, 1, 131086, 262144, 1, 393230, 262144, 1, 65542, 262144, 1, 65545, 262144, 1, 458758, 262144, 1, 458761, 262144, 1) 125 | 126 | [editable path="Enemies/RedFly6"] 127 | -------------------------------------------------------------------------------- /tiny_wizard/room/room_types/room_8.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=15 format=3 uid="uid://7yddsgvc3t8j"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://de3l1l1odllgl" path="res://tiny_wizard/room/room.tscn" id="1_o627n"] 4 | [ext_resource type="PackedScene" uid="uid://cnoc26x8qgyyw" path="res://tiny_wizard/enemies/black_fly/black_fly.tscn" id="2_htb2l"] 5 | [ext_resource type="Script" path="res://top-down-shooter-core/character/character_stats/character_stats.gd" id="3_opten"] 6 | [ext_resource type="Script" path="res://top-down-shooter-core/character/character_stats/physics_stats.gd" id="4_206yx"] 7 | 8 | [sub_resource type="Resource" id="Resource_5kpmg"] 9 | resource_local_to_scene = true 10 | script = ExtResource("3_opten") 11 | max_life = 3 12 | 13 | [sub_resource type="Resource" id="Resource_72m23"] 14 | resource_local_to_scene = true 15 | script = ExtResource("4_206yx") 16 | max_speed = 75.0 17 | acceleration = 0.4 18 | friction = 0.1 19 | impulse_force = 500.0 20 | 21 | [sub_resource type="Resource" id="Resource_2cwfj"] 22 | resource_local_to_scene = true 23 | script = ExtResource("3_opten") 24 | max_life = 3 25 | 26 | [sub_resource type="Resource" id="Resource_osilr"] 27 | resource_local_to_scene = true 28 | script = ExtResource("4_206yx") 29 | max_speed = 75.0 30 | acceleration = 0.4 31 | friction = 0.1 32 | impulse_force = 500.0 33 | 34 | [sub_resource type="Resource" id="Resource_unumj"] 35 | resource_local_to_scene = true 36 | script = ExtResource("3_opten") 37 | max_life = 3 38 | 39 | [sub_resource type="Resource" id="Resource_gy1b6"] 40 | resource_local_to_scene = true 41 | script = ExtResource("4_206yx") 42 | max_speed = 75.0 43 | acceleration = 0.4 44 | friction = 0.1 45 | impulse_force = 500.0 46 | 47 | [sub_resource type="Resource" id="Resource_bnjyu"] 48 | resource_local_to_scene = true 49 | script = ExtResource("3_opten") 50 | max_life = 3 51 | 52 | [sub_resource type="Resource" id="Resource_0w4od"] 53 | resource_local_to_scene = true 54 | script = ExtResource("4_206yx") 55 | max_speed = 75.0 56 | acceleration = 0.4 57 | friction = 0.1 58 | impulse_force = 500.0 59 | 60 | [sub_resource type="Resource" id="Resource_juqcf"] 61 | resource_local_to_scene = true 62 | script = ExtResource("4_206yx") 63 | max_speed = 75.0 64 | acceleration = 0.4 65 | friction = 0.1 66 | impulse_force = 500.0 67 | 68 | [sub_resource type="Resource" id="Resource_cxyw6"] 69 | resource_local_to_scene = true 70 | script = ExtResource("4_206yx") 71 | max_speed = 75.0 72 | acceleration = 0.4 73 | friction = 0.1 74 | impulse_force = 500.0 75 | 76 | [node name="Room" instance=ExtResource("1_o627n")] 77 | 78 | [node name="BlackFly" parent="Enemies" index="0" instance=ExtResource("2_htb2l")] 79 | position = Vector2(231, 305) 80 | character_stats = SubResource("Resource_5kpmg") 81 | physics_stats = SubResource("Resource_72m23") 82 | 83 | [node name="BlackFly2" parent="Enemies" index="1" instance=ExtResource("2_htb2l")] 84 | position = Vector2(518, 216) 85 | character_stats = SubResource("Resource_2cwfj") 86 | physics_stats = SubResource("Resource_osilr") 87 | 88 | [node name="BlackFly3" parent="Enemies" index="2" instance=ExtResource("2_htb2l")] 89 | position = Vector2(514, 419) 90 | character_stats = SubResource("Resource_unumj") 91 | physics_stats = SubResource("Resource_gy1b6") 92 | 93 | [node name="BlackFly4" parent="Enemies" index="3" instance=ExtResource("2_htb2l")] 94 | position = Vector2(768, 298) 95 | character_stats = SubResource("Resource_bnjyu") 96 | physics_stats = SubResource("Resource_0w4od") 97 | 98 | [node name="BlackFly5" parent="Enemies" index="4" instance=ExtResource("2_htb2l")] 99 | position = Vector2(441, 308) 100 | character_stats = SubResource("Resource_bnjyu") 101 | physics_stats = SubResource("Resource_juqcf") 102 | 103 | [node name="BlackFly6" parent="Enemies" index="5" instance=ExtResource("2_htb2l")] 104 | position = Vector2(603, 304) 105 | character_stats = SubResource("Resource_bnjyu") 106 | physics_stats = SubResource("Resource_cxyw6") 107 | 108 | [node name="TileMap" parent="." index="6"] 109 | layer_0/tile_data = PackedInt32Array(196609, 262144, 1, 327681, 262144, 1, 65542, 262144, 1, 196622, 262144, 1, 327694, 262144, 1, 65545, 262144, 1, 458761, 262144, 1, 262151, 131072, 0, 262152, 131072, 0, 262149, 65536, 0, 262150, 65536, 2, 327686, 196608, 3, 196614, 196608, 1, 262153, 65536, 2, 262154, 196608, 0, 196617, 196608, 1, 327689, 196608, 3, 458758, 262144, 1) 110 | -------------------------------------------------------------------------------- /tiny_wizard/room/room_types/room_9.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=12 format=3 uid="uid://qdyhlh75eu6m"] 2 | 3 | [ext_resource type="PackedScene" uid="uid://de3l1l1odllgl" path="res://tiny_wizard/room/room.tscn" id="1_o627n"] 4 | [ext_resource type="PackedScene" uid="uid://cnoc26x8qgyyw" path="res://tiny_wizard/enemies/black_fly/black_fly.tscn" id="2_htb2l"] 5 | [ext_resource type="Texture2D" uid="uid://bjfiwnbm17tnx" path="res://tiny_wizard/assets/placeholder_art/Doors/down_door.png" id="2_xc82v"] 6 | [ext_resource type="Script" path="res://top-down-shooter-core/character/character_stats/character_stats.gd" id="3_opten"] 7 | [ext_resource type="Texture2D" uid="uid://cqxyrxqrb7lhm" path="res://tiny_wizard/assets/placeholder_art/Doors/left_door.png" id="3_uhh5a"] 8 | [ext_resource type="PackedScene" uid="uid://cdb6il7uu0i7v" path="res://tiny_wizard/items/hearts/half_shield.tscn" id="4_1iy3s"] 9 | [ext_resource type="Texture2D" uid="uid://c2l6apt2s8q8f" path="res://tiny_wizard/assets/placeholder_art/Doors/right_door.png" id="4_8thpn"] 10 | [ext_resource type="Script" path="res://top-down-shooter-core/character/character_stats/physics_stats.gd" id="4_i7cey"] 11 | [ext_resource type="Texture2D" uid="uid://dtuhal8kv4l1d" path="res://tiny_wizard/assets/placeholder_art/Doors/up_door.png" id="5_iv8fe"] 12 | 13 | [sub_resource type="Resource" id="Resource_5kpmg"] 14 | resource_local_to_scene = true 15 | script = ExtResource("3_opten") 16 | max_life = 3 17 | 18 | [sub_resource type="Resource" id="Resource_xu1dp"] 19 | resource_local_to_scene = true 20 | script = ExtResource("4_i7cey") 21 | max_speed = 75.0 22 | acceleration = 0.4 23 | friction = 0.1 24 | impulse_force = 500.0 25 | 26 | [node name="Room" instance=ExtResource("1_o627n")] 27 | 28 | [node name="DownDoor" parent="RoomWalls" index="0"] 29 | texture = ExtResource("2_xc82v") 30 | 31 | [node name="LeftDoor" parent="RoomWalls" index="1"] 32 | texture = ExtResource("3_uhh5a") 33 | 34 | [node name="RightDoor" parent="RoomWalls" index="2"] 35 | texture = ExtResource("4_8thpn") 36 | 37 | [node name="UpDoor" parent="RoomWalls" index="3"] 38 | texture = ExtResource("5_iv8fe") 39 | 40 | [node name="BlackFly" parent="Enemies" index="0" instance=ExtResource("2_htb2l")] 41 | position = Vector2(231, 305) 42 | character_stats = SubResource("Resource_5kpmg") 43 | physics_stats = SubResource("Resource_xu1dp") 44 | 45 | [node name="TileMap" parent="." index="6"] 46 | layer_0/tile_data = PackedInt32Array(262151, 65536, 0, 262152, 196608, 0, 393219, 0, 3, 327683, 0, 1, 327684, 131072, 1, 393220, 131072, 3, 327691, 0, 1, 393227, 0, 3, 393228, 131072, 3, 327692, 131072, 1, 327686, 262144, 1, 327689, 262144, 1, 196614, 262144, 1, 196617, 262144, 1) 47 | 48 | [node name="HalfShield" parent="." index="7" instance=ExtResource("4_1iy3s")] 49 | position = Vector2(310, 242) 50 | -------------------------------------------------------------------------------- /tiny_wizard/tiny_wizard_main.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | 4 | 5 | var _current_room := Vector2i.ZERO 6 | 7 | var rooms = {} 8 | 9 | func _ready(): 10 | for room in $Rooms.get_children(): 11 | room.door_entered.connect(self.move_camera) 12 | 13 | var room_pos = Vector2i((room.global_position - Vector2(0,200)) / room.ROOM_SIZE) 14 | rooms[room_pos] = room 15 | room.room_pos = room_pos 16 | 17 | for room_pos in rooms: 18 | var room = rooms[room_pos] 19 | room.hide_right_door = !rooms.has(room_pos + Vector2i.RIGHT) 20 | room.hide_down_door = !rooms.has(room_pos + Vector2i.DOWN) 21 | room.hide_left_door = !rooms.has(room_pos + Vector2i.LEFT) 22 | room.hide_up_door = !rooms.has(room_pos + Vector2i.UP) 23 | room.update_doors() 24 | 25 | 26 | func move_camera(direction): 27 | 28 | _current_room += Vector2i(direction) 29 | var next_room = get_room(_current_room) 30 | print( 31 | "Entering Room ", get_current_room().get_room_matrix_position(), 32 | " at position ", get_current_room().get_global_position(), 33 | " covering area ", get_current_room().get_room_rect() 34 | ) 35 | $Camera2D.position += direction*next_room.ROOM_SIZE 36 | $Character.global_position = next_room.get_spawning_point(direction).global_position 37 | next_room.enter_room() 38 | 39 | 40 | func get_room(room_coord: Vector2i): 41 | if rooms.has(room_coord): 42 | return rooms[room_coord] 43 | else: 44 | return null 45 | 46 | func get_current_room(): 47 | return get_room(_current_room) 48 | --------------------------------------------------------------------------------