diff --git a/src/HurtHit_Box/Hitbox.tscn b/src/HurtHit_Box/Hitbox.tscn deleted file mode 100644 index c74ef33..0000000 --- a/src/HurtHit_Box/Hitbox.tscn +++ /dev/null @@ -1,5 +0,0 @@ -[gd_scene format=2] - -[node name="Hitbox" type="Area2D"] - -[node name="CollisionShape2D" type="CollisionShape2D" parent="."] diff --git a/src/HurtHit_Box/Hurtbox.tscn b/src/HurtHit_Box/Hurtbox.tscn deleted file mode 100644 index 7edbcb4..0000000 --- a/src/HurtHit_Box/Hurtbox.tscn +++ /dev/null @@ -1,5 +0,0 @@ -[gd_scene format=2] - -[node name="Hurtbox" type="Area2D"] - -[node name="CollisionShape2D" type="CollisionShape2D" parent="."] diff --git a/src/Maps/Tilesets/Room/tileset_room.tres b/src/Maps/Tilesets/Room/tileset_room.tres index c026a52..54a1ef9 100644 --- a/src/Maps/Tilesets/Room/tileset_room.tres +++ b/src/Maps/Tilesets/Room/tileset_room.tres @@ -41,6 +41,9 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) [sub_resource type="ConvexPolygonShape2D" id=13] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="ConvexPolygonShape2D" id=14] +points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) + [sub_resource type="ConvexPolygonShape2D" id=15] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) @@ -164,9 +167,6 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) [sub_resource type="ConvexPolygonShape2D" id=55] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) -[sub_resource type="ConvexPolygonShape2D" id=56] -points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) - [resource] 16/name = "tileset_room.png 16" 16/texture = ExtResource( 1 ) @@ -319,253 +319,253 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) "autotile_coord": Vector2( 3, 0 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 15 ), +"shape": SubResource( 14 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 4, 0 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 16 ), +"shape": SubResource( 15 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 5, 0 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 17 ), +"shape": SubResource( 16 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 6, 0 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 18 ), +"shape": SubResource( 17 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 7, 0 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 19 ), +"shape": SubResource( 18 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 8, 0 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 20 ), +"shape": SubResource( 19 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 9, 0 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 21 ), +"shape": SubResource( 20 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 4, 1 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 22 ), +"shape": SubResource( 21 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 5, 1 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 23 ), +"shape": SubResource( 22 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 6, 1 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 24 ), +"shape": SubResource( 23 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 7, 1 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 25 ), +"shape": SubResource( 24 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 8, 1 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 26 ), +"shape": SubResource( 25 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 9, 1 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 27 ), +"shape": SubResource( 26 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 0, 2 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 28 ), +"shape": SubResource( 27 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 1, 2 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 29 ), +"shape": SubResource( 28 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 2, 2 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 30 ), +"shape": SubResource( 29 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 3, 2 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 31 ), +"shape": SubResource( 30 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 4, 2 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 32 ), +"shape": SubResource( 31 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 5, 2 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 33 ), +"shape": SubResource( 32 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 6, 2 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 34 ), +"shape": SubResource( 33 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 7, 2 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 35 ), +"shape": SubResource( 34 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 8, 2 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 36 ), +"shape": SubResource( 35 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 9, 2 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 37 ), +"shape": SubResource( 36 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 10, 2 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 38 ), +"shape": SubResource( 37 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 10, 3 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 39 ), +"shape": SubResource( 38 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 9, 3 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 40 ), +"shape": SubResource( 39 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 8, 3 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 41 ), +"shape": SubResource( 40 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 7, 3 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 42 ), +"shape": SubResource( 41 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 6, 3 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 43 ), +"shape": SubResource( 42 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 5, 3 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 44 ), +"shape": SubResource( 43 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 4, 3 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 45 ), +"shape": SubResource( 44 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 3, 3 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 46 ), +"shape": SubResource( 45 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 2, 3 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 47 ), +"shape": SubResource( 46 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 1, 3 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 48 ), +"shape": SubResource( 47 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 0, 3 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 49 ), +"shape": SubResource( 48 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 4, 4 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 50 ), +"shape": SubResource( 49 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 5, 4 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 51 ), +"shape": SubResource( 50 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 6, 4 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 52 ), +"shape": SubResource( 51 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 7, 4 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 53 ), +"shape": SubResource( 52 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 8, 4 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 54 ), +"shape": SubResource( 53 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 0, 0 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 55 ), +"shape": SubResource( 54 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) }, { "autotile_coord": Vector2( 2, 0 ), "one_way": false, "one_way_margin": 1.0, -"shape": SubResource( 56 ), +"shape": SubResource( 55 ), "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) } ] 47/z_index = 0 diff --git a/src/Menus/DragNDrop/DragNDropUI.tscn b/src/Menus/DragNDrop/DragNDropUI.tscn index 6b673fa..ae45afc 100644 --- a/src/Menus/DragNDrop/DragNDropUI.tscn +++ b/src/Menus/DragNDrop/DragNDropUI.tscn @@ -12,6 +12,9 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="DragSource" parent="." instance=ExtResource( 1 )] - [node name="DragSink" parent="." instance=ExtResource( 2 )] +margin_left = 1.19746 +margin_right = 1.19745 + +[node name="DragSource" parent="." instance=ExtResource( 1 )] +PreviewIcon = "res://icon.png" diff --git a/src/Menus/DragNDrop/DragSource.tscn b/src/Menus/DragNDrop/DragSource.tscn index 1c8267e..94e26df 100644 --- a/src/Menus/DragNDrop/DragSource.tscn +++ b/src/Menus/DragNDrop/DragSource.tscn @@ -45,10 +45,10 @@ func get_resized_texture(t: Texture, width: int = 0, height: int = 0): " [node name="DragSource" type="TextureRect"] -margin_left = 8.34148 -margin_top = 147.561 -margin_right = 40.3415 -margin_bottom = 179.561 +margin_left = 10.7364 +margin_top = 227.792 +margin_right = 42.7364 +margin_bottom = 259.792 texture = ExtResource( 1 ) expand = true script = SubResource( 1 ) diff --git a/src/Objects/Banana/Banana.tscn b/src/Objects/Banana/Banana.tscn index 3367fe4..8b4d30e 100644 --- a/src/Objects/Banana/Banana.tscn +++ b/src/Objects/Banana/Banana.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=1] -[ext_resource path="res://Bannana.gd" type="Script" id=2] +[ext_resource path="res://Overlap/HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=1] +[ext_resource path="res://Objects/Banana/Bannana.gd" type="Script" id=2] [ext_resource path="res://testSprites/bannane.png" type="Texture" id=3] [sub_resource type="CapsuleShape2D" id=1] @@ -19,6 +19,7 @@ texture = ExtResource( 3 ) position = Vector2( 1.54256, -4.73786 ) collision_layer = 32 collision_mask = 0 +slowdown_value = 300 [node name="CollisionShape2D" parent="Hurtbox" index="0"] position = Vector2( -1.65275, 4.84804 ) diff --git a/src/Bannana.gd b/src/Objects/Banana/Bannana.gd similarity index 100% rename from src/Bannana.gd rename to src/Objects/Banana/Bannana.gd diff --git a/src/Fass.gd b/src/Objects/Barrel/Barrel.gd similarity index 100% rename from src/Fass.gd rename to src/Objects/Barrel/Barrel.gd diff --git a/src/Objects/Barrel/Barrel.tscn b/src/Objects/Barrel/Barrel.tscn index 78665d9..a90bebd 100644 --- a/src/Objects/Barrel/Barrel.tscn +++ b/src/Objects/Barrel/Barrel.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=6 format=2] -[ext_resource path="res://HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=1] -[ext_resource path="res://Fass.gd" type="Script" id=2] +[ext_resource path="res://Overlap/HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=1] +[ext_resource path="res://Objects/Barrel/Barrel.gd" type="Script" id=2] [ext_resource path="res://testSprites/Fass.png" type="Texture" id=3] [sub_resource type="CapsuleShape2D" id=1] diff --git a/src/Objects/Bonfire/Bonfire.gd b/src/Objects/Bonfire/Bonfire.gd new file mode 100644 index 0000000..dbdd835 --- /dev/null +++ b/src/Objects/Bonfire/Bonfire.gd @@ -0,0 +1,6 @@ +extends StaticBody2D + + + +func _on_Hurtbox_area_entered(area): + queue_free() diff --git a/src/Objects/Bonfire/Bonfire.tscn b/src/Objects/Bonfire/Bonfire.tscn index ce4c4bc..99ca9e5 100644 --- a/src/Objects/Bonfire/Bonfire.tscn +++ b/src/Objects/Bonfire/Bonfire.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=8 format=2] -[ext_resource path="res://HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=1] -[ext_resource path="res://Bannana.gd" type="Script" id=2] +[ext_resource path="res://Overlap/HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=1] +[ext_resource path="res://Objects/Bonfire/Bonfire.gd" type="Script" id=2] [ext_resource path="res://testSprites/Bonfire.png" type="Texture" id=3] +[ext_resource path="res://Overlap/HurtHit_Box/Hitbox.tscn" type="PackedScene" id=4] [sub_resource type="CapsuleShape2D" id=1] radius = 7.76762 @@ -12,6 +13,9 @@ height = 11.2678 radius = 7.10652 height = 9.88821 +[sub_resource type="CircleShape2D" id=3] +radius = 32.0 + [node name="Bonfire" type="StaticBody2D"] script = ExtResource( 2 ) @@ -33,6 +37,16 @@ shape = SubResource( 1 ) position = Vector2( -3.8147e-06, 0.110184 ) rotation = 1.5708 shape = SubResource( 2 ) + +[node name="Hitbox" parent="." instance=ExtResource( 4 )] +collision_layer = 16 +damage = -0.5 + +[node name="CollisionShape2D" parent="Hitbox" index="0"] +position = Vector2( 0, -2 ) +shape = SubResource( 3 ) [connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"] [editable path="Hurtbox"] + +[editable path="Hitbox"] diff --git a/src/Objects/Heart/Heart.gd b/src/Objects/Heart/Heart.gd new file mode 100644 index 0000000..92da9f6 --- /dev/null +++ b/src/Objects/Heart/Heart.gd @@ -0,0 +1,5 @@ +extends Node2D + + +func _on_Hurtbox_area_entered(area): + queue_free() diff --git a/src/Objects/Heart/Heart.tscn b/src/Objects/Heart/Heart.tscn index d2dd89f..d540388 100644 --- a/src/Objects/Heart/Heart.tscn +++ b/src/Objects/Heart/Heart.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=1] -[ext_resource path="res://Bannana.gd" type="Script" id=2] +[ext_resource path="res://Overlap/HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=1] +[ext_resource path="res://Objects/Heart/Heart.gd" type="Script" id=2] [ext_resource path="res://testSprites/Herz.png" type="Texture" id=3] [sub_resource type="CapsuleShape2D" id=1] @@ -19,6 +19,7 @@ texture = ExtResource( 3 ) position = Vector2( 1.54256, -4.73786 ) collision_layer = 32 collision_mask = 0 +health_value = 1 [node name="CollisionShape2D" parent="Hurtbox" index="0"] position = Vector2( -1.54256, 4.73785 ) diff --git a/src/Objects/Rubies/Blue.tscn b/src/Objects/Rubies/Blue.tscn index 4754ca2..cdc6a76 100644 --- a/src/Objects/Rubies/Blue.tscn +++ b/src/Objects/Rubies/Blue.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=1] -[ext_resource path="res://Bannana.gd" type="Script" id=2] +[ext_resource path="res://Overlap/HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=1] +[ext_resource path="res://Objects/Rubies/Rubies.gd" type="Script" id=2] [ext_resource path="res://testSprites/blue_Rubi.png" type="Texture" id=3] [sub_resource type="CapsuleShape2D" id=1] @@ -19,6 +19,7 @@ texture = ExtResource( 3 ) position = Vector2( 1.54256, -4.73786 ) collision_layer = 32 collision_mask = 0 +currency_value = 5 [node name="CollisionShape2D" parent="Hurtbox" index="0"] position = Vector2( -1.54256, 4.73785 ) diff --git a/src/Objects/Rubies/Green.tscn b/src/Objects/Rubies/Green.tscn index 89ece79..2ef1a91 100644 --- a/src/Objects/Rubies/Green.tscn +++ b/src/Objects/Rubies/Green.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=1] -[ext_resource path="res://Bannana.gd" type="Script" id=2] +[ext_resource path="res://Overlap/HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=1] +[ext_resource path="res://Objects/Rubies/Rubies.gd" type="Script" id=2] [ext_resource path="res://testSprites/green_Rubi.png" type="Texture" id=3] [sub_resource type="CapsuleShape2D" id=1] @@ -19,6 +19,7 @@ texture = ExtResource( 3 ) position = Vector2( 1.54256, -4.73786 ) collision_layer = 32 collision_mask = 0 +currency_value = 1 [node name="CollisionShape2D" parent="Hurtbox" index="0"] position = Vector2( -1.54256, 4.73785 ) diff --git a/src/Objects/Rubies/Red.tscn b/src/Objects/Rubies/Red.tscn index 3a0dffb..2001ecd 100644 --- a/src/Objects/Rubies/Red.tscn +++ b/src/Objects/Rubies/Red.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=1] -[ext_resource path="res://Bannana.gd" type="Script" id=2] +[ext_resource path="res://Overlap/HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=1] +[ext_resource path="res://Objects/Rubies/Rubies.gd" type="Script" id=2] [ext_resource path="res://testSprites/red_Rubi.png" type="Texture" id=3] [sub_resource type="CapsuleShape2D" id=1] @@ -19,6 +19,7 @@ texture = ExtResource( 3 ) position = Vector2( 1.54256, -4.73786 ) collision_layer = 32 collision_mask = 0 +currency_value = 20 [node name="CollisionShape2D" parent="Hurtbox" index="0"] position = Vector2( -1.54256, 4.73785 ) diff --git a/src/Objects/Rubies/Rubies.gd b/src/Objects/Rubies/Rubies.gd new file mode 100644 index 0000000..274d93f --- /dev/null +++ b/src/Objects/Rubies/Rubies.gd @@ -0,0 +1,8 @@ +extends Node2D + + + + + +func _on_Hurtbox_area_entered(area): + queue_free() diff --git a/src/Objects/Slime/Slime.tscn b/src/Objects/Slime/Slime.tscn new file mode 100644 index 0000000..70dc294 --- /dev/null +++ b/src/Objects/Slime/Slime.tscn @@ -0,0 +1,26 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://testSprites/slime.png" type="Texture" id=1] +[ext_resource path="res://Overlap/HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=2] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 16, 16 ) + +[node name="Slime" type="Node2D"] + +[node name="Sprite" type="Sprite" parent="."] +texture = ExtResource( 1 ) + +[node name="Hurtbox" parent="." instance=ExtResource( 2 )] +position = Vector2( 19.1136, -7.76083 ) +collision_layer = 32 +collision_mask = 0 +slowdown_value = 80 + +[node name="CollisionShape2D" parent="Hurtbox" index="0"] +position = Vector2( -19.0825, 7.65191 ) +rotation = 1.5708 +shape = SubResource( 1 ) +[connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"] + +[editable path="Hurtbox"] diff --git a/src/Objects/Traps/Flame.tscn b/src/Objects/Traps/Flame.tscn index a19a8e1..eed9fd8 100644 --- a/src/Objects/Traps/Flame.tscn +++ b/src/Objects/Traps/Flame.tscn @@ -1,14 +1,12 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=4 format=2] -[ext_resource path="res://HurtHit_Box/Hitbox.tscn" type="PackedScene" id=1] -[ext_resource path="res://Bannana.gd" type="Script" id=2] +[ext_resource path="res://Overlap/HurtHit_Box/Hitbox.tscn" type="PackedScene" id=1] [ext_resource path="res://testSprites/flame.png" type="Texture" id=3] [sub_resource type="CapsuleShape2D" id=1] height = 6.36237 [node name="Flame" type="Node2D"] -script = ExtResource( 2 ) [node name="Sprite" type="Sprite" parent="."] position = Vector2( 0.44072, -6.06005 ) diff --git a/src/Objects/Traps/Spike.tscn b/src/Objects/Traps/Spike.tscn index a6a5ecc..024826f 100644 --- a/src/Objects/Traps/Spike.tscn +++ b/src/Objects/Traps/Spike.tscn @@ -1,9 +1,11 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://HurtHit_Box/Hitbox.tscn" type="PackedScene" id=1] -[ext_resource path="res://Bannana.gd" type="Script" id=2] +[ext_resource path="res://Overlap/HurtHit_Box/Hitbox.tscn" type="PackedScene" id=1] +[ext_resource path="res://Objects/Banana/Bannana.gd" type="Script" id=2] [ext_resource path="res://testSprites/Spike.png" type="Texture" id=3] + + [sub_resource type="CapsuleShape2D" id=1] height = 6.36237 diff --git a/src/Objects/Traps/Sting.tscn b/src/Objects/Traps/Sting.tscn index 7a58eaf..b102af5 100644 --- a/src/Objects/Traps/Sting.tscn +++ b/src/Objects/Traps/Sting.tscn @@ -1,9 +1,11 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://HurtHit_Box/Hitbox.tscn" type="PackedScene" id=1] -[ext_resource path="res://Bannana.gd" type="Script" id=2] +[ext_resource path="res://Overlap/HurtHit_Box/Hitbox.tscn" type="PackedScene" id=1] +[ext_resource path="res://Objects/Banana/Bannana.gd" type="Script" id=2] [ext_resource path="res://testSprites/Sting.png" type="Texture" id=3] + + [sub_resource type="CapsuleShape2D" id=1] radius = 6.77597 height = 6.36237 diff --git a/src/Objects/Traps/bear.gd b/src/Objects/Traps/bear.gd new file mode 100644 index 0000000..bb72cf4 --- /dev/null +++ b/src/Objects/Traps/bear.gd @@ -0,0 +1,4 @@ +extends Node2D + +func _on_Hurtbox_area_entered(area): + queue_free() diff --git a/src/Objects/Traps/bear.tscn b/src/Objects/Traps/bear.tscn index 2ed8fbb..7d23975 100644 --- a/src/Objects/Traps/bear.tscn +++ b/src/Objects/Traps/bear.tscn @@ -1,11 +1,15 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=7 format=2] -[ext_resource path="res://HurtHit_Box/Hitbox.tscn" type="PackedScene" id=1] -[ext_resource path="res://Bannana.gd" type="Script" id=2] +[ext_resource path="res://Overlap/HurtHit_Box/Hitbox.tscn" type="PackedScene" id=1] +[ext_resource path="res://Objects/Traps/Bear.gd" type="Script" id=2] [ext_resource path="res://testSprites/falle.png" type="Texture" id=3] +[ext_resource path="res://Overlap/HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=4] [sub_resource type="CapsuleShape2D" id=1] -height = 6.36237 +height = 9.0 + +[sub_resource type="CapsuleShape2D" id=2] +height = 9.0 [node name="Bear_trap" type="Node2D"] script = ExtResource( 2 ) @@ -21,4 +25,15 @@ collision_layer = 16 rotation = 1.5708 shape = SubResource( 1 ) +[node name="Hurtbox" parent="." instance=ExtResource( 4 )] +collision_layer = 32 +collision_mask = 0 + +[node name="CollisionShape2D" parent="Hurtbox" index="0"] +rotation = 1.5708 +shape = SubResource( 2 ) +[connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"] + [editable path="Hitbox"] + +[editable path="Hurtbox"] diff --git a/src/Overlap/HurtHit_Box/Hitbox.gd b/src/Overlap/HurtHit_Box/Hitbox.gd new file mode 100644 index 0000000..576a7f6 --- /dev/null +++ b/src/Overlap/HurtHit_Box/Hitbox.gd @@ -0,0 +1,3 @@ +extends Area2D + +export(float,-42.0,42.0) var damage := 1.0 diff --git a/src/Overlap/HurtHit_Box/Hitbox.tscn b/src/Overlap/HurtHit_Box/Hitbox.tscn new file mode 100644 index 0000000..6ca90b2 --- /dev/null +++ b/src/Overlap/HurtHit_Box/Hitbox.tscn @@ -0,0 +1,8 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://Overlap/HurtHit_Box/Hitbox.gd" type="Script" id=1] + +[node name="Hitbox" type="Area2D"] +script = ExtResource( 1 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] diff --git a/src/Overlap/HurtHit_Box/Hurtbox.gd b/src/Overlap/HurtHit_Box/Hurtbox.gd new file mode 100644 index 0000000..c749c8c --- /dev/null +++ b/src/Overlap/HurtHit_Box/Hurtbox.gd @@ -0,0 +1,5 @@ +extends Area2D + +export(int, 0, 20) var currency_value:=0 +export(int, 0, 2) var health_value:=0 +export(int, 0, 300) var slowdown_value:=0 diff --git a/src/Overlap/HurtHit_Box/Hurtbox.tscn b/src/Overlap/HurtHit_Box/Hurtbox.tscn new file mode 100644 index 0000000..fde26df --- /dev/null +++ b/src/Overlap/HurtHit_Box/Hurtbox.tscn @@ -0,0 +1,8 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://Overlap/HurtHit_Box/Hurtbox.gd" type="Script" id=1] + +[node name="Hurtbox" type="Area2D"] +script = ExtResource( 1 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] diff --git a/src/Overlap/Stats.gd b/src/Overlap/Stats/Stats.gd similarity index 69% rename from src/Overlap/Stats.gd rename to src/Overlap/Stats/Stats.gd index 4e26512..6ce45cf 100644 --- a/src/Overlap/Stats.gd +++ b/src/Overlap/Stats/Stats.gd @@ -3,20 +3,26 @@ extends Node export(int) var max_health := 1 onready var health := max_health setget set_health -export(int) var max_speed := 125 +export(float) var max_speed := 125.0 onready var speed := max_speed setget set_speed signal no_health func set_health(value): - health = value + + if value > max_health: + health = max_health + else: + health = value if health < 1: emit_signal("no_health") func set_speed(value): if value > max_speed: speed = max_speed + elif value<0.0: + speed = 0.0 else: speed = value - + diff --git a/src/Overlap/Stats.tscn b/src/Overlap/Stats/Stats.tscn similarity index 57% rename from src/Overlap/Stats.tscn rename to src/Overlap/Stats/Stats.tscn index c41ad36..9de2e3d 100644 --- a/src/Overlap/Stats.tscn +++ b/src/Overlap/Stats/Stats.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://Overlap/Stats.gd" type="Script" id=1] +[ext_resource path="res://Overlap/Stats/Stats.gd" type="Script" id=1] [node name="Stats" type="Node"] script = ExtResource( 1 ) diff --git a/src/Player/Player.gd b/src/Player/Player.gd index 5c9c9cf..70031c6 100644 --- a/src/Player/Player.gd +++ b/src/Player/Player.gd @@ -6,13 +6,13 @@ This is an example player controller script created by Paul var velocity := Vector2.ZERO var rollvector := Vector2.ZERO # This is how you export variables with ranges to the editor window -export(int, 0, 500) var MAX_SPEED := 125 export(int, 0, 500) var ROLL_SPEED := 150 export(int, 0, 500) var FRICTION := 200 # Speed at which the player deaccelarates export(int, 0, 500) var ACCELERATION := 450 # Reference for the current player onready var player_stats := $Stats +onready var debug_label := $DebugLabel onready var animation_player := $AnimationPlayer onready var animation_tree := $AnimationTree onready var animation_state = animation_tree.get("parameters/playback") @@ -25,9 +25,26 @@ enum moveState{ var movementState = moveState.MOVE +var damage_per_second := 0.0 +var totaldamage := 0.0 +var currency := 0 +var experience := 0.0 + +func _debug_update(): + debug_label.text = str(player_stats.health) + "/" + str(player_stats.max_health) + " HP\n" + str(currency) + " €" + func _physics_process(delta): + totaldamage+=damage_per_second*delta + player_stats.speed+=10*delta + while(totaldamage>1): + totaldamage-=1 + player_stats.health-=1 + while(totaldamage<-1): + totaldamage+=1 + player_stats.health+=1 + _debug_update() match movementState: moveState.MOVE: movement_move(delta) @@ -65,7 +82,7 @@ func movement_move(delta): animation_tree.set("parameters/roll/blend_position", input_vector) animation_tree.set("parameters/run/blend_position", input_vector) animation_state.travel("run") - velocity = velocity.move_toward(MAX_SPEED * input_vector, ACCELERATION * delta) + velocity = velocity.move_toward(player_stats.speed * input_vector, ACCELERATION * delta) if Input.is_action_just_pressed("roll"): movementState = moveState.ROLL elif Input.is_action_just_pressed("attack"): @@ -87,8 +104,19 @@ func roll_finished(): func _on_Hurtbox_area_entered(area): - queue_free() + player_stats.health-=area.damage + damage_per_second = damage_per_second + area.damage +func _on_Hurtbox_area_exited(area): + damage_per_second = damage_per_second - area.damage + + +func _on_Stats_no_health(): + queue_free() + get_tree().change_scene("res://Menus/TitleScreen/TitleScreen.tscn") + func _on_Hitbox_area_entered(area): - pass + currency += area.currency_value + player_stats.health = player_stats.health+area.health_value + player_stats.speed -= area.slowdown_value diff --git a/src/Player/Player.tscn b/src/Player/Player.tscn index fc012b0..5c33152 100644 --- a/src/Player/Player.tscn +++ b/src/Player/Player.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=54 format=2] +[gd_scene load_steps=56 format=2] [ext_resource path="res://Player/Player.gd" type="Script" id=1] [ext_resource path="res://Player/Player.png" type="Texture" id=2] -[ext_resource path="res://HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=3] -[ext_resource path="res://HurtHit_Box/Hitbox.tscn" type="PackedScene" id=4] -[ext_resource path="res://Overlap/Stats.tscn" type="PackedScene" id=5] +[ext_resource path="res://Overlap/HurtHit_Box/Hurtbox.tscn" type="PackedScene" id=3] +[ext_resource path="res://Overlap/HurtHit_Box/Hitbox.tscn" type="PackedScene" id=4] +[ext_resource path="res://Overlap/Stats/Stats.tscn" type="PackedScene" id=5] +[ext_resource path="res://Fonts/Harmonic/Harmonic.ttf" type="DynamicFontData" id=6] [sub_resource type="CapsuleShape2D" id=1] radius = 2.15976 @@ -600,17 +601,21 @@ start_node = "idle" [sub_resource type="AnimationNodeStateMachinePlayback" id=45] [sub_resource type="CapsuleShape2D" id=46] -radius = 3.36373 -height = 6.59445 +radius = 4.5 +height = 0.2 [sub_resource type="CapsuleShape2D" id=47] -radius = 3.40253 -height = 0.175497 +radius = 4.5 +height = 0.2 [sub_resource type="CapsuleShape2D" id=48] radius = 4.03497 height = 6.99104 +[sub_resource type="DynamicFont" id=49] +size = 12 +font_data = ExtResource( 6 ) + [node name="Player" type="KinematicBody2D"] script = ExtResource( 1 ) FRICTION = 270 @@ -662,7 +667,7 @@ collision_layer = 0 collision_mask = 32 [node name="CollisionShape2D" parent="Hitbox" index="0"] -position = Vector2( 0.420105, -4.84456 ) +position = Vector2( 0, -0.5 ) shape = SubResource( 46 ) [node name="Hurtbox" parent="." instance=ExtResource( 3 )] @@ -670,7 +675,7 @@ position = Vector2( 0, 0.0375252 ) collision_mask = 0 [node name="CollisionShape2D" parent="Hurtbox" index="0"] -position = Vector2( 0.0781527, -0.822231 ) +position = Vector2( 0, -0.5 ) shape = SubResource( 47 ) [node name="Pivot" type="Position2D" parent="."] @@ -689,9 +694,23 @@ position = Vector2( 8.43416, 0.0698299 ) shape = SubResource( 48 ) disabled = true +[node name="DebugLabel" type="Label" parent="."] +margin_left = -8.01196 +margin_top = -21.2223 +margin_right = 8.98804 +margin_bottom = -9.22228 +custom_fonts/font = SubResource( 49 ) +text = "Ahh" +__meta__ = { +"_edit_use_anchors_": false +} + [node name="Stats" parent="." instance=ExtResource( 5 )] +max_health = 5 [connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"] [connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"] +[connection signal="area_exited" from="Hurtbox" to="." method="_on_Hurtbox_area_exited"] +[connection signal="no_health" from="Stats" to="." method="_on_Stats_no_health"] [editable path="Hitbox"] diff --git a/src/World.tscn b/src/World.tscn index 01a5165..16bf630 100644 --- a/src/World.tscn +++ b/src/World.tscn @@ -1,7 +1,6 @@ [gd_scene load_steps=16 format=2] [ext_resource path="res://Player/Player.tscn" type="PackedScene" id=1] -[ext_resource path="res://Menus/Startup/Startup.tscn" type="PackedScene" id=2] [ext_resource path="res://Maps/Tilesets/Room/tileset_room.tres" type="TileSet" id=3] [ext_resource path="res://testSprites/dark.png" type="Texture" id=4] [ext_resource path="res://Objects/Barrel/Barrel.tscn" type="PackedScene" id=5] @@ -9,17 +8,18 @@ [ext_resource path="res://Objects/Bonfire/Bonfire.tscn" type="PackedScene" id=7] [ext_resource path="res://Objects/Traps/Sting.tscn" type="PackedScene" id=8] [ext_resource path="res://Objects/Rubies/Blue.tscn" type="PackedScene" id=9] -[ext_resource path="res://Objects/Traps/bear.tscn" type="PackedScene" id=10] +[ext_resource path="res://Objects/Traps/Bear.tscn" type="PackedScene" id=10] [ext_resource path="res://Objects/Heart/Heart.tscn" type="PackedScene" id=11] [ext_resource path="res://Objects/Rubies/Red.tscn" type="PackedScene" id=12] [ext_resource path="res://Objects/Rubies/Green.tscn" type="PackedScene" id=13] [ext_resource path="res://Objects/Traps/Flame.tscn" type="PackedScene" id=14] [ext_resource path="res://Objects/Traps/Spike.tscn" type="PackedScene" id=15] +[ext_resource path="res://Objects/Slime/Slime.tscn" type="PackedScene" id=16] [node name="World" type="Node2D"] [node name="WallSprite" type="Sprite" parent="."] -position = Vector2( 101.087, 144.871 ) +position = Vector2( 100.332, 144.871 ) texture = ExtResource( 4 ) region_enabled = true region_rect = Rect2( 0, 0, 1280, 720 ) @@ -30,8 +30,11 @@ cell_size = Vector2( 32, 32 ) format = 1 tile_data = PoolIntArray( -131063, 47, 0, -131062, 47, 2, -65536, 47, 4, -65535, 47, 196609, -65534, 47, 196609, -65533, 47, 196609, -65532, 47, 196609, -65531, 47, 196609, -65530, 47, 196609, -65529, 47, 6, -65528, 47, 5, -65527, 47, 196614, -65526, 47, 196613, -65525, 47, 6, -65524, 47, 5, -65523, 47, 196609, -65522, 47, 7, 0, 47, 65539, 7, 47, 131072, 8, 47, 65543, 11, 47, 131072, 12, 47, 65543, 14, 47, 196612, 15, 47, 196610, 65536, 47, 65539, 65544, 47, 196612, 65545, 47, 7, 65548, 47, 65539, 131072, 47, 262148, 131073, 47, 196610, 131081, 47, 65539, 131084, 47, 65539, 131087, 47, 3, 196608, 47, 65539, 196615, 47, 196611, 196617, 47, 131075, 196619, 47, 4, 196620, 47, 196615, 196622, 47, 4, 196623, 47, 196615, 262144, 47, 65539, 262146, 47, 3, 262155, 47, 65539, 262158, 47, 65539, 327680, 47, 262148, 327681, 47, 196609, 327682, 47, 196616, 327683, 47, 196609, 327684, 47, 196609, 327685, 47, 196609, 327686, 47, 196609, 327687, 47, 7, 327691, 47, 131075, 327694, 47, 65539, 393216, 47, 65539, 393223, 47, 196612, 393224, 47, 196610, 393230, 47, 65539, 458752, 47, 196612, 458753, 47, 196609, 458754, 47, 7, 458766, 47, 65539, 524290, 47, 196612, 524291, 47, 196609, 524292, 47, 196609, 524293, 47, 196609, 524294, 47, 196609, 524295, 47, 196609, 524296, 47, 196609, 524297, 47, 196609, 524298, 47, 196609, 524299, 47, 196609, 524300, 47, 196609, 524301, 47, 196609, 524302, 47, 196615 ) -[node name="Startup" parent="." instance=ExtResource( 2 )] -visible = false +[node name="Slime" parent="." instance=ExtResource( 16 )] +position = Vector2( 207.164, 143.978 ) + +[node name="Slime2" parent="." instance=ExtResource( 16 )] +position = Vector2( 239.993, 144.355 ) [node name="YSort" type="YSort" parent="."] position = Vector2( 170.007, 112.118 ) @@ -50,7 +53,7 @@ position = Vector2( 30.9156, 105.927 ) scale = Vector2( 2, 2 ) [node name="Banana" parent="YSort" instance=ExtResource( 6 )] -position = Vector2( -121.577, 4.57831 ) +position = Vector2( -26.4842, -48.6284 ) [node name="Bonfire" parent="YSort" instance=ExtResource( 7 )] position = Vector2( 283.515, -47.7461 ) diff --git a/src/project.godot b/src/project.godot index 5b1eeb9..2d61bd0 100644 --- a/src/project.godot +++ b/src/project.godot @@ -33,7 +33,7 @@ _global_script_class_icons={ [application] config/name="LD46 Game" -run/main_scene="res://Menus/TitleScreen/TitleScreen.tscn" +run/main_scene="res://World.tscn" config/icon="res://icon.png" [autoload]