mirror of
https://github.com/creyD/ludum_dare_46.git
synced 2026-06-13 22:12:23 +02:00
ai fixed
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user