summaryrefslogtreecommitdiff
path: root/arrow.gd
blob: 829edd71dc01dc9c988be27d3f04441755c73a00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extends Area2D

var velocity: Vector2


func type() -> String: return "arrow"


func damage(other: Area2D) -> void:
	other.damage(1)
	queue_free()

func _physics_process(_delta: float) -> void:
	position += velocity
	if position.x < -Globals.WIDTH / 2. or position.y < -Globals.HEIGHT / 2. or \
	   position.x > Globals.WIDTH / 2. or position.y > Globals.HEIGHT / 2.:
		queue_free()