the-crypt/script/Projectile.gd
Diego abd5b85031 Music + Intro
added music and some introduction world part
2020-07-17 14:10:02 -05:00

17 lines
315 B
GDScript

extends KinematicBody2D
class_name Projectile
export var speed = 100
var velocity = Vector2.ZERO
func _physics_process(delta):
var collision = move_and_collide(velocity * delta)
if collision != null:
on_impact()
func launch(direction: Vector2):
velocity = direction * speed
func on_impact():
queue_free()