Initial files

This commit is contained in:
Jan Groß
2017-11-12 16:56:20 +01:00
commit 509eeffe1e
56 changed files with 1655 additions and 0 deletions

21
scripts/explosion.gd Normal file
View File

@@ -0,0 +1,21 @@
extends Sprite
var ttl = 4
func _ready():
set_process(true)
get_node("AnimationPlayer").connect("finished", self, "anim_finished")
get_node("ExplosionArea").connect("body_enter", self, "on_collision")
func anim_finished():
get_node("ExplosionArea").queue_free()
func on_collision(other):
if other != null and other.has_method("on_rocket_hit"):
other.on_rocket_hit()
print("R ON R")
func _process(delta):
if ttl <= 0:
get_parent().queue_free()
else: ttl -= delta