From c7d45ec085086ab86192a7890b9622320d57b89d Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 3 Jun 2016 10:30:38 -0300 Subject: Removed demos they go to their own project now --- demos/2d/fog_of_war/troll.gd | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 demos/2d/fog_of_war/troll.gd (limited to 'demos/2d/fog_of_war/troll.gd') diff --git a/demos/2d/fog_of_war/troll.gd b/demos/2d/fog_of_war/troll.gd deleted file mode 100644 index 6f40072e84..0000000000 --- a/demos/2d/fog_of_war/troll.gd +++ /dev/null @@ -1,38 +0,0 @@ - -extends KinematicBody2D - -# This is a simple collision demo showing how -# the kinematic controller works. -# move() will allow to move the node, and will -# always move it to a non-colliding spot, -# as long as it starts from a non-colliding spot too. - -# Member variables -const MOTION_SPEED = 160 # Pixels/second - - -func _fixed_process(delta): - var motion = Vector2() - - if (Input.is_action_pressed("move_up")): - motion += Vector2(0, -1) - if (Input.is_action_pressed("move_bottom")): - motion += Vector2(0, 1) - if (Input.is_action_pressed("move_left")): - motion += Vector2(-1, 0) - if (Input.is_action_pressed("move_right")): - motion += Vector2(1, 0) - - motion = motion.normalized()*MOTION_SPEED*delta - motion = move(motion) - - # Make character slide nicely through the world - var slide_attempts = 4 - while(is_colliding() and slide_attempts > 0): - motion = get_collision_normal().slide(motion) - motion = move(motion) - slide_attempts -= 1 - - -func _ready(): - set_fixed_process(true) -- cgit v1.2.3