diff options
Diffstat (limited to 'demos/2d/isometric')
-rw-r--r-- | demos/2d/isometric/dungeon.scn | bin | 8743 -> 4708 bytes | |||
-rw-r--r-- | demos/2d/isometric/tileset.scn | bin | 2565 -> 4476 bytes | |||
-rw-r--r-- | demos/2d/isometric/troll.gd | 31 | ||||
-rw-r--r-- | demos/2d/isometric/troll.scn | bin | 2100 -> 2116 bytes |
4 files changed, 13 insertions, 18 deletions
diff --git a/demos/2d/isometric/dungeon.scn b/demos/2d/isometric/dungeon.scn Binary files differindex e03a3bd3dd..8f0f316d73 100644 --- a/demos/2d/isometric/dungeon.scn +++ b/demos/2d/isometric/dungeon.scn diff --git a/demos/2d/isometric/tileset.scn b/demos/2d/isometric/tileset.scn Binary files differindex c04ea5382c..e487285f83 100644 --- a/demos/2d/isometric/tileset.scn +++ b/demos/2d/isometric/tileset.scn diff --git a/demos/2d/isometric/troll.gd b/demos/2d/isometric/troll.gd index d118d3a2ba..d8d4880df1 100644 --- a/demos/2d/isometric/troll.gd +++ b/demos/2d/isometric/troll.gd @@ -2,42 +2,37 @@ extends KinematicBody2D # This is a simple collision demo showing how -# the kinematic cotroller works. +# 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/seconds -#pixels / second -const MOTION_SPEED=160 func _fixed_process(delta): - var motion = Vector2() if (Input.is_action_pressed("move_up")): - motion+=Vector2(0,-1) + motion += Vector2(0, -1) if (Input.is_action_pressed("move_bottom")): - motion+=Vector2(0,1) + motion += Vector2(0, 1) if (Input.is_action_pressed("move_left")): - motion+=Vector2(-1,0) + motion += Vector2(-1, 0) if (Input.is_action_pressed("move_right")): - motion+=Vector2(1,0) + motion += Vector2(1, 0) - motion = motion.normalized() * MOTION_SPEED * delta + motion = motion.normalized()*MOTION_SPEED*delta motion = move(motion) - #make character slide nicely through the world + # Make character slide nicely through the world var slide_attempts = 4 - while(is_colliding() and slide_attempts>0): + while(is_colliding() and slide_attempts > 0): motion = get_collision_normal().slide(motion) - motion=move(motion) - slide_attempts-=1 - + motion = move(motion) + slide_attempts -= 1 + func _ready(): - # Initalization here set_fixed_process(true) - pass - - diff --git a/demos/2d/isometric/troll.scn b/demos/2d/isometric/troll.scn Binary files differindex 19b566fe05..d53aac4fbf 100644 --- a/demos/2d/isometric/troll.scn +++ b/demos/2d/isometric/troll.scn |