diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-10-03 00:25:53 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-10-03 00:25:53 -0300 |
commit | 1b3a10891ebdc6e76a81c8915ba08065311e17d3 (patch) | |
tree | 3dc1fb08feaafe52726c57ee283253768756a675 /demos/2d/isometric | |
parent | b24fe3dd206ce391ec4c5f68d32fc2259f275563 (diff) |
missing demo files
Diffstat (limited to 'demos/2d/isometric')
-rw-r--r-- | demos/2d/isometric/bastiles.res | bin | 0 -> 1840 bytes | |||
-rw-r--r-- | demos/2d/isometric/dungeon.scn | bin | 0 -> 4582 bytes | |||
-rw-r--r-- | demos/2d/isometric/engine.cfg | 21 | ||||
-rw-r--r-- | demos/2d/isometric/icon.png | bin | 0 -> 9377 bytes | |||
-rw-r--r-- | demos/2d/isometric/isotiles.png | bin | 0 -> 222339 bytes | |||
-rw-r--r-- | demos/2d/isometric/tileset.scn | bin | 0 -> 2305 bytes | |||
-rw-r--r-- | demos/2d/isometric/troll.gd | 43 | ||||
-rw-r--r-- | demos/2d/isometric/troll.png | bin | 0 -> 7246 bytes | |||
-rw-r--r-- | demos/2d/isometric/troll.scn | bin | 0 -> 1839 bytes |
9 files changed, 64 insertions, 0 deletions
diff --git a/demos/2d/isometric/bastiles.res b/demos/2d/isometric/bastiles.res Binary files differnew file mode 100644 index 0000000000..2161c88f1e --- /dev/null +++ b/demos/2d/isometric/bastiles.res diff --git a/demos/2d/isometric/dungeon.scn b/demos/2d/isometric/dungeon.scn Binary files differnew file mode 100644 index 0000000000..76532a44aa --- /dev/null +++ b/demos/2d/isometric/dungeon.scn diff --git a/demos/2d/isometric/engine.cfg b/demos/2d/isometric/engine.cfg new file mode 100644 index 0000000000..48f39826f9 --- /dev/null +++ b/demos/2d/isometric/engine.cfg @@ -0,0 +1,21 @@ +[application] + +name="Isometric Game" +main_scene="res://dungeon.scn" +icon="res://icon.png" + +[image_loader] + +filter=false +gen_mipmaps=false + +[input] + +move_up=[key(Up)] +move_left=[key(Left)] +move_right=[key(Right)] +move_bottom=[key(Down)] + +[rasterizer] + +use_pixel_snap=true diff --git a/demos/2d/isometric/icon.png b/demos/2d/isometric/icon.png Binary files differnew file mode 100644 index 0000000000..c8fb5dcb42 --- /dev/null +++ b/demos/2d/isometric/icon.png diff --git a/demos/2d/isometric/isotiles.png b/demos/2d/isometric/isotiles.png Binary files differnew file mode 100644 index 0000000000..aa5a800f8f --- /dev/null +++ b/demos/2d/isometric/isotiles.png diff --git a/demos/2d/isometric/tileset.scn b/demos/2d/isometric/tileset.scn Binary files differnew file mode 100644 index 0000000000..edb0bc0276 --- /dev/null +++ b/demos/2d/isometric/tileset.scn diff --git a/demos/2d/isometric/troll.gd b/demos/2d/isometric/troll.gd new file mode 100644 index 0000000000..d118d3a2ba --- /dev/null +++ b/demos/2d/isometric/troll.gd @@ -0,0 +1,43 @@ + +extends KinematicBody2D + +# This is a simple collision demo showing how +# the kinematic cotroller 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. + + +#pixels / second +const MOTION_SPEED=160 + +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(): + # Initalization here + set_fixed_process(true) + pass + + diff --git a/demos/2d/isometric/troll.png b/demos/2d/isometric/troll.png Binary files differnew file mode 100644 index 0000000000..69f195d034 --- /dev/null +++ b/demos/2d/isometric/troll.png diff --git a/demos/2d/isometric/troll.scn b/demos/2d/isometric/troll.scn Binary files differnew file mode 100644 index 0000000000..f5d87c3631 --- /dev/null +++ b/demos/2d/isometric/troll.scn |