summaryrefslogtreecommitdiff
path: root/demos/2d/space_shooter/asteroid.gd
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-06-03 10:30:38 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-06-03 10:30:38 -0300
commitc7d45ec085086ab86192a7890b9622320d57b89d (patch)
tree0a764a6a2b7bded960a652c81a4b5a6815dd3c31 /demos/2d/space_shooter/asteroid.gd
parentf9af57f3bdb16e015ee10b979fe18cf2195077f9 (diff)
Removed demos
they go to their own project now
Diffstat (limited to 'demos/2d/space_shooter/asteroid.gd')
-rw-r--r--demos/2d/space_shooter/asteroid.gd43
1 files changed, 0 insertions, 43 deletions
diff --git a/demos/2d/space_shooter/asteroid.gd b/demos/2d/space_shooter/asteroid.gd
deleted file mode 100644
index ab71f413eb..0000000000
--- a/demos/2d/space_shooter/asteroid.gd
+++ /dev/null
@@ -1,43 +0,0 @@
-
-extends Area2D
-
-# Member variables
-const SPEED = -200
-const Y_RANDOM = 10
-
-var points = 1
-var speed_y = 0.0
-var destroyed = false
-
-
-func _fixed_process(delta):
- translate(Vector2(SPEED, speed_y)*delta)
-
-
-func _ready():
- speed_y = rand_range(-Y_RANDOM, Y_RANDOM)
-
-
-func destroy():
- if (destroyed):
- return
- destroyed = true
- get_node("anim").play("explode")
- set_fixed_process(false)
- get_node("sfx").play("sound_explode")
- # Accumulate points
- get_node("/root/game_state").points += 1
-
-
-func is_enemy():
- return not destroyed
-
-
-func _on_visibility_enter_screen():
- set_fixed_process(true)
- # Make it spin!
- get_node("anim").play("spin")
-
-
-func _on_visibility_exit_screen():
- queue_free()