diff options
Diffstat (limited to 'demos/2d/isometric_light/shoot.gd')
-rw-r--r-- | demos/2d/isometric_light/shoot.gd | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/demos/2d/isometric_light/shoot.gd b/demos/2d/isometric_light/shoot.gd new file mode 100644 index 0000000000..0486bbb658 --- /dev/null +++ b/demos/2d/isometric_light/shoot.gd @@ -0,0 +1,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 + + |