Fixed Heal Item, added Healthup Item, Folder structure improvements
This commit is contained in:
parent
e923619977
commit
40217226b9
15 changed files with 40 additions and 10 deletions
|
|
@ -7,7 +7,7 @@
|
|||
[ext_resource type="Texture2D" uid="uid://3weywjfsapax" path="res://buildings/Building 2x1 downside.png" id="5_pfkkr"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpv1w56yr1xue" path="res://traps/morning_star.tscn" id="5_xr4t5"]
|
||||
[ext_resource type="PackedScene" uid="uid://chu67ci7sl488" path="res://enemies/ghost.tscn" id="7_35wcg"]
|
||||
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://platform.tscn" id="8_sifiv"]
|
||||
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://utils/platform.tscn" id="8_sifiv"]
|
||||
[ext_resource type="PackedScene" uid="uid://xj0of571aur1" path="res://items/item_spawn.tscn" id="9_i1qmw"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_pfkkr"]
|
||||
|
|
@ -16,7 +16,7 @@ shader_parameter/ground_height = 3000.0
|
|||
shader_parameter/cell_height = 300.0
|
||||
shader_parameter/num_cells = 60
|
||||
|
||||
[node name="Building" type="Node2D"]
|
||||
[node name="Building2" type="Node2D"]
|
||||
script = ExtResource("1_5j34s")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
[ext_resource type="Texture2D" uid="uid://djir4ehm8kif" path="res://buildings/Building 1x2 fixed.png" id="3_uv7v8"]
|
||||
[ext_resource type="Script" uid="uid://dj7d4d2xs3nci" path="res://buildings/building_mesh.gd" id="4_bl5jt"]
|
||||
[ext_resource type="PackedScene" uid="uid://chu67ci7sl488" path="res://enemies/ghost.tscn" id="5_23fi7"]
|
||||
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://platform.tscn" id="6_e6j05"]
|
||||
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://utils/platform.tscn" id="6_e6j05"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_qnfc1"]
|
||||
resource_local_to_scene = true
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@ extends Item
|
|||
|
||||
func collect() -> bool:
|
||||
if(player.current_hp < player.max_hp):
|
||||
player.current_hp += heal_amount
|
||||
player.current_hp = min(player.max_hp, player.current_hp + heal_amount)
|
||||
return true
|
||||
return false
|
||||
|
|
|
|||
8
items/healthup.gd
Normal file
8
items/healthup.gd
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
extends Item
|
||||
@export var heal_amount = 1
|
||||
@export var max_health_increase = 1
|
||||
|
||||
func collect() -> bool:
|
||||
player.max_hp += max_health_increase
|
||||
player.current_hp = min(player.max_hp, player.current_hp + heal_amount)
|
||||
return true
|
||||
1
items/healthup.gd.uid
Normal file
1
items/healthup.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://ce6fxbjarlvtk
|
||||
21
items/healthup.tscn
Normal file
21
items/healthup.tscn
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://gwctb2xqsbj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ce6fxbjarlvtk" path="res://items/healthup.gd" id="1_ivtxh"]
|
||||
[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="2_lolop"]
|
||||
[ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="3_v056v"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_hvhjo"]
|
||||
|
||||
[node name="HealthUp" type="Area2D"]
|
||||
scale = Vector2(1, -1)
|
||||
script = ExtResource("1_ivtxh")
|
||||
|
||||
[node name="EarthAligner" parent="." instance=ExtResource("2_lolop")]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
scale = Vector2(7, 7)
|
||||
shape = SubResource("CircleShape2D_hvhjo")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
modulate = Color(1, 1, 0, 1)
|
||||
texture = ExtResource("3_v056v")
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://ennu3lalstdr"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://ewe36lqcjojk"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bbwsc2a2hd0ow" path="res://updash.gd" id="1_ghbl6"]
|
||||
[ext_resource type="Script" uid="uid://bbwsc2a2hd0ow" path="res://items/updash.gd" id="1_ghbl6"]
|
||||
[ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="1_ptc3l"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_ghbl6"]
|
||||
|
|
@ -6,8 +6,8 @@
|
|||
[ext_resource type="Script" uid="uid://colvx6wq0e8n7" path="res://world/building_generator.gd" id="4_1bvp3"]
|
||||
[ext_resource type="PackedScene" uid="uid://cjsrtswk4vgf2" path="res://healthbar/healthbar.tscn" id="6_7mycd"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpdn2php3ydsv" path="res://death_screen/death_screen.tscn" id="7_5vw27"]
|
||||
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://platform.tscn" id="7_272bh"]
|
||||
[ext_resource type="PackedScene" uid="uid://ennu3lalstdr" path="res://updash.tscn" id="9_4c57u"]
|
||||
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://utils/platform.tscn" id="7_272bh"]
|
||||
[ext_resource type="PackedScene" uid="uid://gwctb2xqsbj" path="res://items/healthup.tscn" id="9_4c57u"]
|
||||
[ext_resource type="PackedScene" uid="uid://chu67ci7sl488" path="res://enemies/ghost.tscn" id="9_kek77"]
|
||||
|
||||
[node name="main" type="Node2D"]
|
||||
|
|
@ -52,7 +52,7 @@ scale = Vector2(5, 3.1)
|
|||
[node name="Ghost" parent="." instance=ExtResource("9_kek77")]
|
||||
position = Vector2(0, -3000)
|
||||
|
||||
[node name="Updash" parent="." instance=ExtResource("9_4c57u")]
|
||||
[node name="HealthUp" parent="." instance=ExtResource("9_4c57u")]
|
||||
position = Vector2(0, -3100)
|
||||
|
||||
[connection signal="health_changed" from="Player" to="CanvasLayer/Healthbar" method="_on_player_health_changed"]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://4l3elvxpghw8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dwmquoam37sve" path="res://platform.gd" id="1_c1gtx"]
|
||||
[ext_resource type="Script" uid="uid://dwmquoam37sve" path="res://utils/platform.gd" id="1_c1gtx"]
|
||||
[ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="1_s8bxr"]
|
||||
[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="2_c1gtx"]
|
||||
|
||||
Loading…
Add table
Reference in a new issue