fixed script bugs

This commit is contained in:
Jonas Mucke
2020-04-18 19:09:22 +02:00
parent e6d0cf5203
commit f111f75133
14 changed files with 46 additions and 25 deletions

View File

@@ -0,0 +1,6 @@
extends StaticBody2D
func _on_Hurtbox_area_entered(area):
queue_free()

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=8 format=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://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]

View File

@@ -0,0 +1,5 @@
extends Node2D
func _on_Hurtbox_area_entered(area):
queue_free()

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=5 format=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://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]

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=5 format=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://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]

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=5 format=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://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]

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=5 format=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://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]

View File

@@ -0,0 +1,8 @@
extends Node2D
func _on_Hurtbox_area_entered(area):
queue_free()

View File

@@ -1,16 +1,12 @@
[gd_scene load_steps=5 format=2]
[gd_scene load_steps=4 format=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/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 )

View File

@@ -1,6 +1,4 @@
extends Node2D
func _on_Hurtbox_area_entered(area):
queue_free()

View File

@@ -1,13 +1,16 @@
[gd_scene load_steps=6 format=2]
[gd_scene load_steps=7 format=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://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 = 9.0
[sub_resource type="CapsuleShape2D" id=2]
height = 9.0
[node name="Bear_trap" type="Node2D"]
script = ExtResource( 2 )
@@ -22,9 +25,15 @@ collision_layer = 16
rotation = 1.5708
shape = SubResource( 1 )
[node name="Hurtbox" parent="Hitbox" instance=ExtResource( 4 )]
[node name="Hurtbox" parent="." instance=ExtResource( 4 )]
collision_layer = 32
collision_mask = 0
[connection signal="area_entered" from="Hitbox/Hurtbox" to="." method="_on_Hurtbox_area_entered"]
[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"]

View File

@@ -116,8 +116,6 @@ func _on_Stats_no_health():
get_tree().change_scene("res://Menus/TitleScreen/TitleScreen.tscn")
func _on_Hitbox_area_entered(area):
currency += area.currency_value
player_stats.health = player_stats.health+area.health_value

View File

@@ -601,12 +601,12 @@ 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
@@ -667,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 )]
@@ -675,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="."]
@@ -710,6 +710,7 @@ 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"]

View File

@@ -8,7 +8,7 @@
[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]