This commit is contained in:
Jonas Mucke
2020-04-20 10:09:07 +02:00
parent fc59452928
commit b8b026d063
12 changed files with 114 additions and 75 deletions

View File

@@ -1,5 +1,6 @@
extends StaticBody2D
export(int,1,10) var health = 1
var GreenDrop = 0.5
var BlueDrop = 0.4
var RedDrop = 0.2
@@ -10,6 +11,9 @@ func offset_vec():
return Vector2((randf()-0.5)*offset, (randf()-0.5)*offset)
func _on_Hurtbox_area_entered(area):
health -= area.damage
if(health>0):
return
queue_free()
var GreenRubies = load("res://Objects/Rubies/Green.tscn")
var BlueRubies = load("res://Objects/Rubies/Blue.tscn")

View File

@@ -24,9 +24,11 @@ kind = 9
position = Vector2( 0.244171, -10.0111 )
texture = ExtResource( 3 )
[node name="Hurtbox" parent="." instance=ExtResource( 1 )]
[node name="Hurtbox" parent="." groups=[
"HittableByPlayer",
] instance=ExtResource( 1 )]
collision_layer = 8
collision_mask = 0
collision_mask = 128
[node name="CollisionShape2D" parent="Hurtbox" index="0"]
position = Vector2( 0.322258, -10.0297 )

View File

@@ -22,6 +22,6 @@ func _physics_process(delta):
func _on_Hurtbox_area_entered(area):
lifePoints -= area.damage
if(lifePoints<0):
if(lifePoints<=0):
queue_free()
pass

View File

@@ -24,9 +24,11 @@ position = Vector2( 1.88936, -12.4698 )
position = Vector2( 0, -8 )
texture = ExtResource( 2 )
[node name="Hurtbox" parent="." instance=ExtResource( 1 )]
[node name="Hurtbox" parent="." groups=[
"HittableByPlayer",
] instance=ExtResource( 1 )]
collision_layer = 8
collision_mask = 0
collision_mask = 128
script = null
[node name="CollisionShape2D" parent="Hurtbox" index="0"]