summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
Diffstat (limited to 'demos')
-rw-r--r--demos/2d/hexamap/.fscache33
-rw-r--r--demos/2d/hexamap/WWT-01.pngbin0 -> 20369 bytes
-rw-r--r--demos/2d/hexamap/WWT-02.pngbin0 -> 21993 bytes
-rw-r--r--demos/2d/hexamap/WWT-03.pngbin0 -> 22703 bytes
-rw-r--r--demos/2d/hexamap/WWT-04.pngbin0 -> 20615 bytes
-rw-r--r--demos/2d/hexamap/WWT-05.pngbin0 -> 22293 bytes
-rw-r--r--demos/2d/hexamap/WWT-06.pngbin0 -> 22971 bytes
-rw-r--r--demos/2d/hexamap/WWT-07.pngbin0 -> 22306 bytes
-rw-r--r--demos/2d/hexamap/WWT-08.pngbin0 -> 22084 bytes
-rw-r--r--demos/2d/hexamap/WWT-09.pngbin0 -> 22066 bytes
-rw-r--r--demos/2d/hexamap/WWT-10.pngbin0 -> 22019 bytes
-rw-r--r--demos/2d/hexamap/WWT-11.pngbin0 -> 21546 bytes
-rw-r--r--demos/2d/hexamap/WWT-12.pngbin0 -> 21405 bytes
-rw-r--r--demos/2d/hexamap/WWT-13.pngbin0 -> 19682 bytes
-rw-r--r--demos/2d/hexamap/WWT-14.pngbin0 -> 20491 bytes
-rw-r--r--demos/2d/hexamap/WWT-15.pngbin0 -> 21237 bytes
-rw-r--r--demos/2d/hexamap/WWT-16.pngbin0 -> 20673 bytes
-rw-r--r--demos/2d/hexamap/WWT-17.pngbin0 -> 20628 bytes
-rw-r--r--demos/2d/hexamap/WWT-18.pngbin0 -> 22559 bytes
-rw-r--r--demos/2d/hexamap/WWT-19.pngbin0 -> 21600 bytes
-rw-r--r--demos/2d/hexamap/WWT-20.pngbin0 -> 21130 bytes
-rw-r--r--demos/2d/hexamap/WWT-21.pngbin0 -> 21114 bytes
-rw-r--r--demos/2d/hexamap/WWT-22.pngbin0 -> 21440 bytes
-rw-r--r--demos/2d/hexamap/WWT-23.pngbin0 -> 20817 bytes
-rw-r--r--demos/2d/hexamap/WWT-24.pngbin0 -> 19964 bytes
-rw-r--r--demos/2d/hexamap/WWT-25.pngbin0 -> 20584 bytes
-rw-r--r--demos/2d/hexamap/WWT-26.pngbin0 -> 21405 bytes
-rw-r--r--demos/2d/hexamap/engine.cfg12
-rw-r--r--demos/2d/hexamap/icon.pngbin0 -> 5925 bytes
-rw-r--r--demos/2d/hexamap/map.scnbin0 -> 2644 bytes
-rw-r--r--demos/2d/hexamap/tiles.scnbin0 -> 2091 bytes
-rw-r--r--demos/2d/hexamap/tileset.resbin0 -> 6863 bytes
-rw-r--r--demos/2d/hexamap/troll.gd43
-rw-r--r--demos/2d/hexamap/troll.pngbin0 -> 7246 bytes
-rw-r--r--demos/2d/hexamap/troll.scnbin0 -> 1839 bytes
-rw-r--r--demos/2d/isometric/bastiles.resbin0 -> 1840 bytes
-rw-r--r--demos/2d/isometric/dungeon.scnbin0 -> 4582 bytes
-rw-r--r--demos/2d/isometric/engine.cfg21
-rw-r--r--demos/2d/isometric/icon.pngbin0 -> 9377 bytes
-rw-r--r--demos/2d/isometric/isotiles.pngbin0 -> 222339 bytes
-rw-r--r--demos/2d/isometric/tileset.scnbin0 -> 2305 bytes
-rw-r--r--demos/2d/isometric/troll.gd43
-rw-r--r--demos/2d/isometric/troll.pngbin0 -> 7246 bytes
-rw-r--r--demos/2d/isometric/troll.scnbin0 -> 1839 bytes
-rw-r--r--demos/2d/kinematic_char/player.gd3
-rw-r--r--demos/3d/platformer/texture.texbin29600 -> 18209 bytes
-rw-r--r--demos/3d/platformer/tiles.resbin81338 -> 81631 bytes
-rw-r--r--demos/3d/truck_town/car_base.scnbin0 -> 11573 bytes
-rw-r--r--demos/3d/truck_town/car_select.gd42
-rw-r--r--demos/3d/truck_town/car_select.scnbin0 -> 1702 bytes
-rw-r--r--demos/3d/truck_town/cement.texbin0 -> 169836 bytes
-rw-r--r--demos/3d/truck_town/choose_tow.pngbin0 -> 20702 bytes
-rw-r--r--demos/3d/truck_town/choose_trailer.pngbin0 -> 15646 bytes
-rw-r--r--demos/3d/truck_town/choose_van.pngbin0 -> 10106 bytes
-rw-r--r--demos/3d/truck_town/crane.scnbin0 -> 23916 bytes
-rw-r--r--demos/3d/truck_town/engine.cfg12
-rw-r--r--demos/3d/truck_town/follow_camera.gd69
-rw-r--r--demos/3d/truck_town/grass.texbin0 -> 177762 bytes
-rw-r--r--demos/3d/truck_town/trailer_truck.scnbin0 -> 19934 bytes
-rw-r--r--demos/3d/truck_town/truck_scene.scnbin0 -> 1873575 bytes
-rw-r--r--demos/3d/truck_town/trucktown.scnbin0 -> 161749 bytes
-rw-r--r--demos/3d/truck_town/vehicle.gd54
-rw-r--r--demos/misc/autoload/global.gd5
63 files changed, 332 insertions, 5 deletions
diff --git a/demos/2d/hexamap/.fscache b/demos/2d/hexamap/.fscache
new file mode 100644
index 0000000000..60aa69b645
--- /dev/null
+++ b/demos/2d/hexamap/.fscache
@@ -0,0 +1,33 @@
+::res://::1412302385
+WWT-01.png::ImageTexture::1412126473::
+WWT-02.png::ImageTexture::1412126474::
+WWT-03.png::ImageTexture::1412126474::
+WWT-04.png::ImageTexture::1412126474::
+WWT-05.png::ImageTexture::1412126474::
+WWT-06.png::ImageTexture::1412126474::
+WWT-07.png::ImageTexture::1412126474::
+WWT-08.png::ImageTexture::1412126474::
+WWT-09.png::ImageTexture::1412126474::
+WWT-10.png::ImageTexture::1412126474::
+WWT-11.png::ImageTexture::1412126475::
+WWT-12.png::ImageTexture::1412126475::
+WWT-13.png::ImageTexture::1412126475::
+WWT-14.png::ImageTexture::1412126475::
+WWT-15.png::ImageTexture::1412126475::
+WWT-16.png::ImageTexture::1412126475::
+WWT-17.png::ImageTexture::1412126475::
+WWT-18.png::ImageTexture::1412126475::
+WWT-19.png::ImageTexture::1412126476::
+WWT-20.png::ImageTexture::1412126476::
+WWT-21.png::ImageTexture::1412126476::
+WWT-22.png::ImageTexture::1412126476::
+WWT-23.png::ImageTexture::1412126476::
+WWT-24.png::ImageTexture::1412126476::
+WWT-25.png::ImageTexture::1412126476::
+WWT-26.png::ImageTexture::1412126476::
+map.scn::PackedScene::1412127344::
+tiles.scn::PackedScene::1412126994::
+tileset.res::TileSet::1412127001::
+troll.gd::GDScript::1412302377::
+troll.png::ImageTexture::1412302385::
+troll.scn::PackedScene::1412302380::
diff --git a/demos/2d/hexamap/WWT-01.png b/demos/2d/hexamap/WWT-01.png
new file mode 100644
index 0000000000..79d75fa4c9
--- /dev/null
+++ b/demos/2d/hexamap/WWT-01.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-02.png b/demos/2d/hexamap/WWT-02.png
new file mode 100644
index 0000000000..7dcd1c8cca
--- /dev/null
+++ b/demos/2d/hexamap/WWT-02.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-03.png b/demos/2d/hexamap/WWT-03.png
new file mode 100644
index 0000000000..1e76c9a24d
--- /dev/null
+++ b/demos/2d/hexamap/WWT-03.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-04.png b/demos/2d/hexamap/WWT-04.png
new file mode 100644
index 0000000000..84a3b90e71
--- /dev/null
+++ b/demos/2d/hexamap/WWT-04.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-05.png b/demos/2d/hexamap/WWT-05.png
new file mode 100644
index 0000000000..850747dc8d
--- /dev/null
+++ b/demos/2d/hexamap/WWT-05.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-06.png b/demos/2d/hexamap/WWT-06.png
new file mode 100644
index 0000000000..52479e2d26
--- /dev/null
+++ b/demos/2d/hexamap/WWT-06.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-07.png b/demos/2d/hexamap/WWT-07.png
new file mode 100644
index 0000000000..87aa8a4102
--- /dev/null
+++ b/demos/2d/hexamap/WWT-07.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-08.png b/demos/2d/hexamap/WWT-08.png
new file mode 100644
index 0000000000..0234cccd56
--- /dev/null
+++ b/demos/2d/hexamap/WWT-08.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-09.png b/demos/2d/hexamap/WWT-09.png
new file mode 100644
index 0000000000..5467eb58c3
--- /dev/null
+++ b/demos/2d/hexamap/WWT-09.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-10.png b/demos/2d/hexamap/WWT-10.png
new file mode 100644
index 0000000000..bb0b5ae1ff
--- /dev/null
+++ b/demos/2d/hexamap/WWT-10.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-11.png b/demos/2d/hexamap/WWT-11.png
new file mode 100644
index 0000000000..926ad251b4
--- /dev/null
+++ b/demos/2d/hexamap/WWT-11.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-12.png b/demos/2d/hexamap/WWT-12.png
new file mode 100644
index 0000000000..e6c7d33894
--- /dev/null
+++ b/demos/2d/hexamap/WWT-12.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-13.png b/demos/2d/hexamap/WWT-13.png
new file mode 100644
index 0000000000..f14e42af6e
--- /dev/null
+++ b/demos/2d/hexamap/WWT-13.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-14.png b/demos/2d/hexamap/WWT-14.png
new file mode 100644
index 0000000000..826ed49d18
--- /dev/null
+++ b/demos/2d/hexamap/WWT-14.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-15.png b/demos/2d/hexamap/WWT-15.png
new file mode 100644
index 0000000000..c62de67c8e
--- /dev/null
+++ b/demos/2d/hexamap/WWT-15.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-16.png b/demos/2d/hexamap/WWT-16.png
new file mode 100644
index 0000000000..2e8c289d97
--- /dev/null
+++ b/demos/2d/hexamap/WWT-16.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-17.png b/demos/2d/hexamap/WWT-17.png
new file mode 100644
index 0000000000..f8c59a4dbe
--- /dev/null
+++ b/demos/2d/hexamap/WWT-17.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-18.png b/demos/2d/hexamap/WWT-18.png
new file mode 100644
index 0000000000..05269c843c
--- /dev/null
+++ b/demos/2d/hexamap/WWT-18.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-19.png b/demos/2d/hexamap/WWT-19.png
new file mode 100644
index 0000000000..7313ff8871
--- /dev/null
+++ b/demos/2d/hexamap/WWT-19.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-20.png b/demos/2d/hexamap/WWT-20.png
new file mode 100644
index 0000000000..2ec6fe94e2
--- /dev/null
+++ b/demos/2d/hexamap/WWT-20.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-21.png b/demos/2d/hexamap/WWT-21.png
new file mode 100644
index 0000000000..e7a51fa687
--- /dev/null
+++ b/demos/2d/hexamap/WWT-21.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-22.png b/demos/2d/hexamap/WWT-22.png
new file mode 100644
index 0000000000..0e4d7729ed
--- /dev/null
+++ b/demos/2d/hexamap/WWT-22.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-23.png b/demos/2d/hexamap/WWT-23.png
new file mode 100644
index 0000000000..ab1cc895e4
--- /dev/null
+++ b/demos/2d/hexamap/WWT-23.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-24.png b/demos/2d/hexamap/WWT-24.png
new file mode 100644
index 0000000000..b0a05671cf
--- /dev/null
+++ b/demos/2d/hexamap/WWT-24.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-25.png b/demos/2d/hexamap/WWT-25.png
new file mode 100644
index 0000000000..3d90080259
--- /dev/null
+++ b/demos/2d/hexamap/WWT-25.png
Binary files differ
diff --git a/demos/2d/hexamap/WWT-26.png b/demos/2d/hexamap/WWT-26.png
new file mode 100644
index 0000000000..a3baca90a0
--- /dev/null
+++ b/demos/2d/hexamap/WWT-26.png
Binary files differ
diff --git a/demos/2d/hexamap/engine.cfg b/demos/2d/hexamap/engine.cfg
new file mode 100644
index 0000000000..4567af7a16
--- /dev/null
+++ b/demos/2d/hexamap/engine.cfg
@@ -0,0 +1,12 @@
+[application]
+
+name="Hexagonal Game"
+main_scene="res://map.scn"
+icon="res://icon.png"
+
+[input]
+
+move_up=[key(Up)]
+move_left=[key(Left)]
+move_right=[key(Right)]
+move_bottom=[key(Down)]
diff --git a/demos/2d/hexamap/icon.png b/demos/2d/hexamap/icon.png
new file mode 100644
index 0000000000..0fcef95111
--- /dev/null
+++ b/demos/2d/hexamap/icon.png
Binary files differ
diff --git a/demos/2d/hexamap/map.scn b/demos/2d/hexamap/map.scn
new file mode 100644
index 0000000000..5798aab850
--- /dev/null
+++ b/demos/2d/hexamap/map.scn
Binary files differ
diff --git a/demos/2d/hexamap/tiles.scn b/demos/2d/hexamap/tiles.scn
new file mode 100644
index 0000000000..265aedac2b
--- /dev/null
+++ b/demos/2d/hexamap/tiles.scn
Binary files differ
diff --git a/demos/2d/hexamap/tileset.res b/demos/2d/hexamap/tileset.res
new file mode 100644
index 0000000000..05d89316a2
--- /dev/null
+++ b/demos/2d/hexamap/tileset.res
Binary files differ
diff --git a/demos/2d/hexamap/troll.gd b/demos/2d/hexamap/troll.gd
new file mode 100644
index 0000000000..d118d3a2ba
--- /dev/null
+++ b/demos/2d/hexamap/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/hexamap/troll.png b/demos/2d/hexamap/troll.png
new file mode 100644
index 0000000000..69f195d034
--- /dev/null
+++ b/demos/2d/hexamap/troll.png
Binary files differ
diff --git a/demos/2d/hexamap/troll.scn b/demos/2d/hexamap/troll.scn
new file mode 100644
index 0000000000..f5d87c3631
--- /dev/null
+++ b/demos/2d/hexamap/troll.scn
Binary files differ
diff --git a/demos/2d/isometric/bastiles.res b/demos/2d/isometric/bastiles.res
new file mode 100644
index 0000000000..2161c88f1e
--- /dev/null
+++ b/demos/2d/isometric/bastiles.res
Binary files differ
diff --git a/demos/2d/isometric/dungeon.scn b/demos/2d/isometric/dungeon.scn
new file mode 100644
index 0000000000..76532a44aa
--- /dev/null
+++ b/demos/2d/isometric/dungeon.scn
Binary files 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
--- /dev/null
+++ b/demos/2d/isometric/icon.png
Binary files differ
diff --git a/demos/2d/isometric/isotiles.png b/demos/2d/isometric/isotiles.png
new file mode 100644
index 0000000000..aa5a800f8f
--- /dev/null
+++ b/demos/2d/isometric/isotiles.png
Binary files differ
diff --git a/demos/2d/isometric/tileset.scn b/demos/2d/isometric/tileset.scn
new file mode 100644
index 0000000000..edb0bc0276
--- /dev/null
+++ b/demos/2d/isometric/tileset.scn
Binary files 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
--- /dev/null
+++ b/demos/2d/isometric/troll.png
Binary files differ
diff --git a/demos/2d/isometric/troll.scn b/demos/2d/isometric/troll.scn
new file mode 100644
index 0000000000..f5d87c3631
--- /dev/null
+++ b/demos/2d/isometric/troll.scn
Binary files differ
diff --git a/demos/2d/kinematic_char/player.gd b/demos/2d/kinematic_char/player.gd
index 5c56477758..9cff0269e8 100644
--- a/demos/2d/kinematic_char/player.gd
+++ b/demos/2d/kinematic_char/player.gd
@@ -74,6 +74,9 @@ func _fixed_process(delta):
var floor_velocity=Vector2()
if (is_colliding()):
+ # you can check which tile was collision against with this
+ # print(get_collider_metadata())
+
#ran against something, is it the floor? get normal
var n = get_collision_normal()
diff --git a/demos/3d/platformer/texture.tex b/demos/3d/platformer/texture.tex
index 24c4607ab1..d9181b7ffa 100644
--- a/demos/3d/platformer/texture.tex
+++ b/demos/3d/platformer/texture.tex
Binary files differ
diff --git a/demos/3d/platformer/tiles.res b/demos/3d/platformer/tiles.res
index 53534788a1..d4fb779ff1 100644
--- a/demos/3d/platformer/tiles.res
+++ b/demos/3d/platformer/tiles.res
Binary files differ
diff --git a/demos/3d/truck_town/car_base.scn b/demos/3d/truck_town/car_base.scn
new file mode 100644
index 0000000000..d62c8dcb29
--- /dev/null
+++ b/demos/3d/truck_town/car_base.scn
Binary files differ
diff --git a/demos/3d/truck_town/car_select.gd b/demos/3d/truck_town/car_select.gd
new file mode 100644
index 0000000000..00b4d853b8
--- /dev/null
+++ b/demos/3d/truck_town/car_select.gd
@@ -0,0 +1,42 @@
+
+extends Control
+
+# member variables here, example:
+# var a=2
+# var b="textvar"
+
+func _ready():
+ # Initalization here
+ pass
+
+var town=null
+
+
+func _back():
+
+ town.queue_free()
+ show()
+
+
+func _load_scene(car):
+
+ var tt = load(car).instance()
+ tt.set_name("car")
+ town = load("res://truck_scene.scn").instance()
+ town.get_node("instance_pos").add_child(tt)
+ town.get_node("back").connect("pressed",self,"_back")
+ get_parent().add_child(town)
+ hide()
+
+func _on_van_1_pressed():
+
+ _load_scene("res://car_base.scn")
+
+
+func _on_van_2_pressed():
+
+ _load_scene("res://trailer_truck.scn")
+
+
+func _on_van_3_pressed():
+ _load_scene("res://crane.scn")
diff --git a/demos/3d/truck_town/car_select.scn b/demos/3d/truck_town/car_select.scn
new file mode 100644
index 0000000000..024adf1423
--- /dev/null
+++ b/demos/3d/truck_town/car_select.scn
Binary files differ
diff --git a/demos/3d/truck_town/cement.tex b/demos/3d/truck_town/cement.tex
new file mode 100644
index 0000000000..a80cde6464
--- /dev/null
+++ b/demos/3d/truck_town/cement.tex
Binary files differ
diff --git a/demos/3d/truck_town/choose_tow.png b/demos/3d/truck_town/choose_tow.png
new file mode 100644
index 0000000000..8f92833450
--- /dev/null
+++ b/demos/3d/truck_town/choose_tow.png
Binary files differ
diff --git a/demos/3d/truck_town/choose_trailer.png b/demos/3d/truck_town/choose_trailer.png
new file mode 100644
index 0000000000..ead3330296
--- /dev/null
+++ b/demos/3d/truck_town/choose_trailer.png
Binary files differ
diff --git a/demos/3d/truck_town/choose_van.png b/demos/3d/truck_town/choose_van.png
new file mode 100644
index 0000000000..1ecdd54372
--- /dev/null
+++ b/demos/3d/truck_town/choose_van.png
Binary files differ
diff --git a/demos/3d/truck_town/crane.scn b/demos/3d/truck_town/crane.scn
new file mode 100644
index 0000000000..080bd8ea17
--- /dev/null
+++ b/demos/3d/truck_town/crane.scn
Binary files differ
diff --git a/demos/3d/truck_town/engine.cfg b/demos/3d/truck_town/engine.cfg
new file mode 100644
index 0000000000..f47c0de4fa
--- /dev/null
+++ b/demos/3d/truck_town/engine.cfg
@@ -0,0 +1,12 @@
+[application]
+
+main_scene="res://car_select.scn"
+
+[display]
+
+width=1280
+height=720
+
+[rasterizer]
+
+shadow_filter=3
diff --git a/demos/3d/truck_town/follow_camera.gd b/demos/3d/truck_town/follow_camera.gd
new file mode 100644
index 0000000000..cf7172d7bb
--- /dev/null
+++ b/demos/3d/truck_town/follow_camera.gd
@@ -0,0 +1,69 @@
+
+extends Camera
+
+# member variables here, example:
+# var a=2
+# var b="textvar"
+
+var collision_exception=[]
+export var min_distance=0.5
+export var max_distance=4.0
+export var angle_v_adjust=0.0
+export var autoturn_ray_aperture=25
+export var autoturn_speed=50
+var max_height = 2.0
+var min_height = 0
+
+func _fixed_process(dt):
+ var target = get_parent().get_global_transform().origin
+ var pos = get_global_transform().origin
+ var up = Vector3(0,1,0)
+
+ var delta = pos - target
+
+ #regular delta follow
+
+ #check ranges
+
+ if (delta.length() < min_distance):
+ delta = delta.normalized() * min_distance
+ elif (delta.length() > max_distance):
+ delta = delta.normalized() * max_distance
+
+ #check upper and lower height
+ if ( delta.y > max_height):
+ delta.y = max_height
+ if ( delta.y < min_height):
+ delta.y = min_height
+
+ pos = target + delta
+
+ look_at_from_pos(pos,target,up)
+
+ #turn a little up or down
+ var t = get_transform()
+ t.basis = Matrix3(t.basis[0],deg2rad(angle_v_adjust)) * t.basis
+ set_transform(t)
+
+
+
+func _ready():
+
+#find collision exceptions for ray
+ var node = self
+ while(node):
+ if (node extends RigidBody):
+ collision_exception.append(node.get_rid())
+ break
+ else:
+ node=node.get_parent()
+ # Initalization here
+ set_fixed_process(true)
+ #this detaches the camera transform from the parent spatial node
+ set_as_toplevel(true)
+
+
+
+
+
+
diff --git a/demos/3d/truck_town/grass.tex b/demos/3d/truck_town/grass.tex
new file mode 100644
index 0000000000..c28d060697
--- /dev/null
+++ b/demos/3d/truck_town/grass.tex
Binary files differ
diff --git a/demos/3d/truck_town/trailer_truck.scn b/demos/3d/truck_town/trailer_truck.scn
new file mode 100644
index 0000000000..0131e9e3a2
--- /dev/null
+++ b/demos/3d/truck_town/trailer_truck.scn
Binary files differ
diff --git a/demos/3d/truck_town/truck_scene.scn b/demos/3d/truck_town/truck_scene.scn
new file mode 100644
index 0000000000..a02ce259c1
--- /dev/null
+++ b/demos/3d/truck_town/truck_scene.scn
Binary files differ
diff --git a/demos/3d/truck_town/trucktown.scn b/demos/3d/truck_town/trucktown.scn
new file mode 100644
index 0000000000..57a84315ee
--- /dev/null
+++ b/demos/3d/truck_town/trucktown.scn
Binary files differ
diff --git a/demos/3d/truck_town/vehicle.gd b/demos/3d/truck_town/vehicle.gd
new file mode 100644
index 0000000000..1aa7f0faa2
--- /dev/null
+++ b/demos/3d/truck_town/vehicle.gd
@@ -0,0 +1,54 @@
+
+extends VehicleBody
+
+# member variables here, example:
+# var a=2
+# var b="textvar"
+
+
+const STEER_SPEED=1
+const STEER_LIMIT=0.4
+
+var steer_angle=0
+var steer_target=0
+
+
+export var engine_force=40
+
+func _fixed_process(delta):
+
+
+ if (Input.is_action_pressed("ui_left")):
+ steer_target=-STEER_LIMIT
+ elif (Input.is_action_pressed("ui_right")):
+ steer_target=STEER_LIMIT
+ else:
+ steer_target=0
+
+ if (Input.is_action_pressed("ui_up")):
+ set_engine_force(engine_force)
+ else:
+ set_engine_force(0)
+
+ if (Input.is_action_pressed("ui_down")):
+ set_brake(1)
+ else:
+ set_brake(0.0)
+
+
+ if (steer_target < steer_angle):
+ steer_angle -= STEER_SPEED*delta
+ if (steer_target > steer_angle):
+ steer_angle=steer_target
+ elif (steer_target > steer_angle):
+ steer_angle += STEER_SPEED*delta
+ if (steer_target < steer_angle):
+ steer_angle=steer_target
+
+ set_steering(steer_angle)
+func _ready():
+ # Initalization here
+ set_fixed_process(true)
+ pass
+
+
diff --git a/demos/misc/autoload/global.gd b/demos/misc/autoload/global.gd
index dca661a31a..d9fa308a2f 100644
--- a/demos/misc/autoload/global.gd
+++ b/demos/misc/autoload/global.gd
@@ -9,11 +9,6 @@ func goto_scene(scene):
var s = ResourceLoader.load(scene)
#queue erasing old (don't use free because that scene is calling this method)
current_scene.queue_free()
- # Remove the scene before loading the previous one.
- # The node is removed when deleted anyway, but this will fix issues that
- # might arise if both have a root node with the same name,
- # as adding both together will cause the second to be renamed. (not usually a problem, but you might be wanting to look for the node later and not find it)
- get_scene().get_root().remove(current_scene)
#instance the new scene
current_scene = s.instance()
#add it to the active scene, as child of root