summaryrefslogtreecommitdiff
path: root/demos/2d/isometric_light/shoot.gd
blob: b48d4ad34b7a61eb7b9f62bea60f687be83840bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

extends KinematicBody2D

# Member variables
const ADVANCE_SPEED = 500.0

var advance_dir = Vector2(1, 0)
var hit = false


func _fixed_process(delta):
	if (hit):
		return
	move(advance_dir*delta*ADVANCE_SPEED)
	if (is_colliding()):
		get_node("anim").play("explode")
		hit = true


func _ready():
	set_fixed_process(true)