blob: 0486bbb65844b493e2ad19be7beb70be8f445865 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
extends KinematicBody2D
# member variables here, example:
# var a=2
# var b="textvar"
var advance_dir=Vector2(1,0)
const ADVANCE_SPEED = 500.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():
# Initialization here
set_fixed_process(true)
pass
|