added Fireknockback and added beartrap slowdown(not stun)

This commit is contained in:
Jan Schuffenhauer
2020-04-20 19:17:08 +02:00
parent 512fffee8d
commit ebad05009a
7 changed files with 36 additions and 13 deletions

View File

@@ -1,5 +1,24 @@
extends Node2D
export(float,0.1,10.0) var burning_time = 2.0
var timer = Timer.new()
func on_timer_timeout():
timer.stop()
queue_free()
func _ready():
$Sprite.play("burn")
add_child(timer)
timer.connect("timeout", self, "on_timer_timeout")
timer.set_wait_time(burning_time)
timer.start()
func _on_Hitbox_body_entered(body):
if(body.get_name() == "Player"):
body.velocity*=-3

View File

@@ -93,5 +93,6 @@ collision_layer = 16
[node name="CollisionShape2D" parent="Hitbox" index="0"]
position = Vector2( -0.157784, -0.157772 )
shape = SubResource( 2 )
[connection signal="body_entered" from="Hitbox" to="." method="_on_Hitbox_body_entered"]
[editable path="Hitbox"]