From 1b3a10891ebdc6e76a81c8915ba08065311e17d3 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 3 Oct 2014 00:25:53 -0300 Subject: missing demo files --- demos/2d/isometric/bastiles.res | Bin 0 -> 1840 bytes demos/2d/isometric/dungeon.scn | Bin 0 -> 4582 bytes demos/2d/isometric/engine.cfg | 21 ++++++++++++++++++++ demos/2d/isometric/icon.png | Bin 0 -> 9377 bytes demos/2d/isometric/isotiles.png | Bin 0 -> 222339 bytes demos/2d/isometric/tileset.scn | Bin 0 -> 2305 bytes demos/2d/isometric/troll.gd | 43 ++++++++++++++++++++++++++++++++++++++++ demos/2d/isometric/troll.png | Bin 0 -> 7246 bytes demos/2d/isometric/troll.scn | Bin 0 -> 1839 bytes 9 files changed, 64 insertions(+) create mode 100644 demos/2d/isometric/bastiles.res create mode 100644 demos/2d/isometric/dungeon.scn create mode 100644 demos/2d/isometric/engine.cfg create mode 100644 demos/2d/isometric/icon.png create mode 100644 demos/2d/isometric/isotiles.png create mode 100644 demos/2d/isometric/tileset.scn create mode 100644 demos/2d/isometric/troll.gd create mode 100644 demos/2d/isometric/troll.png create mode 100644 demos/2d/isometric/troll.scn (limited to 'demos/2d/isometric') diff --git a/demos/2d/isometric/bastiles.res b/demos/2d/isometric/bastiles.res new file mode 100644 index 0000000000..2161c88f1e Binary files /dev/null and b/demos/2d/isometric/bastiles.res differ diff --git a/demos/2d/isometric/dungeon.scn b/demos/2d/isometric/dungeon.scn new file mode 100644 index 0000000000..76532a44aa Binary files /dev/null and b/demos/2d/isometric/dungeon.scn differ 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 new file mode 100644 index 0000000000..c8fb5dcb42 Binary files /dev/null and b/demos/2d/isometric/icon.png differ diff --git a/demos/2d/isometric/isotiles.png b/demos/2d/isometric/isotiles.png new file mode 100644 index 0000000000..aa5a800f8f Binary files /dev/null and b/demos/2d/isometric/isotiles.png differ diff --git a/demos/2d/isometric/tileset.scn b/demos/2d/isometric/tileset.scn new file mode 100644 index 0000000000..edb0bc0276 Binary files /dev/null and b/demos/2d/isometric/tileset.scn differ 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 new file mode 100644 index 0000000000..69f195d034 Binary files /dev/null and b/demos/2d/isometric/troll.png differ diff --git a/demos/2d/isometric/troll.scn b/demos/2d/isometric/troll.scn new file mode 100644 index 0000000000..f5d87c3631 Binary files /dev/null and b/demos/2d/isometric/troll.scn differ -- cgit v1.2.3