aboutsummaryrefslogtreecommitdiffstats
path: root/godot
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--godot/scenes/Game.tscn30
-rw-r--r--godot/scenes/levels/GoalTriggerZone.tscn14
-rw-r--r--godot/scenes/levels/test_scene_movement/TestSceneMovement.tscn1
-rw-r--r--godot/scenes/levels/test_scene_uuuhhh/TestSceneUuuhhh.tscn10
-rw-r--r--godot/scenes/objects/Player.tscn3
-rw-r--r--godot/scripts/GoalTriggerBox.gd2
-rw-r--r--godot/scripts/LevelLoader.gd27
7 files changed, 50 insertions, 37 deletions
diff --git a/godot/scenes/Game.tscn b/godot/scenes/Game.tscn
index 6d09370..38a4ceb 100644
--- a/godot/scenes/Game.tscn
+++ b/godot/scenes/Game.tscn
@@ -3,35 +3,16 @@
[ext_resource path="res://native/Game.gdns" type="Script" id=1]
[ext_resource path="res://scenes/levels/test_scene_uuuhhh/TestSceneUuuhhh.tscn" type="PackedScene" id=2]
[ext_resource path="res://scripts/LevelLoader.gd" type="Script" id=3]
-[ext_resource path="res://scripts/GoalTriggerBox.gd" type="Script" id=4]
-
-[sub_resource type="BoxShape" id=1]
+[ext_resource path="res://scenes/levels/GoalTriggerZone.tscn" type="PackedScene" id=4]
+[ext_resource path="res://scenes/objects/Player.tscn" type="PackedScene" id=5]
[sub_resource type="CubeMesh" id=2]
[sub_resource type="SphereMesh" id=3]
-[gd_scene load_steps=3 format=2]
-
-[ext_resource path="res://native/Game.gdns" type="Script" id=1]
-[ext_resource path="res://scenes/levels/test_scene_movement/TestSceneMovement.tscn" type="PackedScene" id=2]
[node name="Game" type="Spatial"]
script = ExtResource( 1 )
-[node name="Camera" type="Camera" parent="."]
-transform = Transform( -0.538224, 0.336461, -0.772728, 0, 0.916856, 0.399217, 0.842802, 0.214868, -0.493474, -6.58972, 3.31005, -7.31211 )
-current = true
-fov = 64.6875
-
-[node name="TestSceneUuuhhh" parent="." instance=ExtResource( 2 )]
-
-[node name="Area2" type="Area" parent="."]
-transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, 20, 0, 0 )
-script = ExtResource( 4 )
-
-[node name="CollisionShape" type="CollisionShape" parent="Area2"]
-shape = SubResource( 1 )
-
[node name="LevelLoader" type="Node" parent="."]
script = ExtResource( 3 )
@@ -42,6 +23,8 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.99199, 0 )
mesh = SubResource( 2 )
material/0 = null
+[node name="GoalTriggerZone" parent="Level1" instance=ExtResource( 4 )]
+
[node name="Level2" type="Spatial" parent="."]
visible = false
@@ -50,5 +33,8 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.99549, 0 )
mesh = SubResource( 3 )
material/0 = null
-[connection signal="body_entered" from="Area2" to="Area2" method="_on_Area2_body_entered"]
+[node name="PlayerRoot" parent="." instance=ExtResource( 5 )]
+input/camera_mouse_sensitivity = Vector2( 0.005, 0.005 )
+input/shoot_sensitivity = 0.005
+
[node name="TestScene" parent="." instance=ExtResource( 2 )]
diff --git a/godot/scenes/levels/GoalTriggerZone.tscn b/godot/scenes/levels/GoalTriggerZone.tscn
new file mode 100644
index 0000000..861db4d
--- /dev/null
+++ b/godot/scenes/levels/GoalTriggerZone.tscn
@@ -0,0 +1,14 @@
+[gd_scene load_steps=3 format=2]
+
+[ext_resource path="res://scripts/GoalTriggerBox.gd" type="Script" id=1]
+
+[sub_resource type="BoxShape" id=1]
+
+[node name="GoalTriggerZone" type="Area"]
+transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, 20, 0, 0 )
+script = ExtResource( 1 )
+
+[node name="CollisionShape" type="CollisionShape" parent="."]
+shape = SubResource( 1 )
+
+[connection signal="body_entered" from="." to="." method="_on_Area2_body_entered"]
diff --git a/godot/scenes/levels/test_scene_movement/TestSceneMovement.tscn b/godot/scenes/levels/test_scene_movement/TestSceneMovement.tscn
index d1c08e3..d23236b 100644
--- a/godot/scenes/levels/test_scene_movement/TestSceneMovement.tscn
+++ b/godot/scenes/levels/test_scene_movement/TestSceneMovement.tscn
@@ -28,4 +28,3 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 40, -1, -20 )
transform = Transform( 0.766044, 0, 0.642788, 0, 2, 0, -0.642788, 0, 0.766044, 19.47, 0, -14 )
[node name="PlayerRoot" parent="." instance=ExtResource( 3 )]
-input/current_buff_index = 1
diff --git a/godot/scenes/levels/test_scene_uuuhhh/TestSceneUuuhhh.tscn b/godot/scenes/levels/test_scene_uuuhhh/TestSceneUuuhhh.tscn
index a8f9003..0e4c8dc 100644
--- a/godot/scenes/levels/test_scene_uuuhhh/TestSceneUuuhhh.tscn
+++ b/godot/scenes/levels/test_scene_uuuhhh/TestSceneUuuhhh.tscn
@@ -1,19 +1,11 @@
-[gd_scene load_steps=6 format=2]
+[gd_scene load_steps=4 format=2]
[ext_resource path="res://scenes/levels/test_scene_uuuhhh/Wall.tscn" type="PackedScene" id=1]
[ext_resource path="res://scenes/levels/test_scene_uuuhhh/Floor.tscn" type="PackedScene" id=2]
-[ext_resource path="res://scenes/scripts/roblox-cube.gd" type="Script" id=3]
[ext_resource path="res://assets/sounds/Uuhhh.mp3" type="AudioStream" id=4]
-[ext_resource path="res://scenes/objects/W8.tscn" type="PackedScene" id=5]
[node name="TestScene" type="Spatial"]
-[node name="W8" parent="." instance=ExtResource( 5 )]
-transform = Transform( 0.990268, 0.0360207, 0.134431, 0, 0.965926, -0.258819, -0.139173, 0.2563, 0.956525, -2.57174, 1.79727, 8.45058 )
-contacts_reported = 3
-contact_monitor = true
-script = ExtResource( 3 )
-
[node name="Floor" parent="." instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0290833, -0.981747, 0.00208664 )
diff --git a/godot/scenes/objects/Player.tscn b/godot/scenes/objects/Player.tscn
index 8cfdd6e..cc3662e 100644
--- a/godot/scenes/objects/Player.tscn
+++ b/godot/scenes/objects/Player.tscn
@@ -10,9 +10,6 @@ camera/camera_clamp = Vector2( 0, -1.3 )
shooting/max_force = 30.0
shooting/up_angle = 0.3
shooting/stopping_velocity = 0.003
-input/camera_mouse_sensitivity = Vector2( 0.003, 0.002 )
-input/shoot_sensitivity = 0.1
-input/current_buff_index = 5
[node name="W8" parent="." instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
diff --git a/godot/scripts/GoalTriggerBox.gd b/godot/scripts/GoalTriggerBox.gd
index 9281f0f..17e98ad 100644
--- a/godot/scripts/GoalTriggerBox.gd
+++ b/godot/scripts/GoalTriggerBox.gd
@@ -5,7 +5,7 @@ var loader: Loader = null
# Called when the node enters the scene tree for the first time.
func _ready():
- loader = get_node("../LevelLoader")
+ loader = get_node("/root/Game/LevelLoader")
# Called every frame. 'delta' is the elapsed time since the previous frame.
diff --git a/godot/scripts/LevelLoader.gd b/godot/scripts/LevelLoader.gd
index 538d4ef..2aec587 100644
--- a/godot/scripts/LevelLoader.gd
+++ b/godot/scripts/LevelLoader.gd
@@ -2,15 +2,26 @@ extends Node
const NUM_LEVELS = 9
+# player node
+var player: Spatial = null
+
+# level control
var current_level_id = 0
var levels = []
+# stroke control
+var current_strokes = 0
+var strokes_per_level = []
+
# Called when the node enters the scene tree for the first time.
func _ready():
for i in range(NUM_LEVELS):
levels.append(get_node("/root/Game/Level%d" % (i+1)))
+ current_strokes = 0
levels[0].show()
+
+ player = get_node("/root/Game/PlayerRoot")
# Called every frame. 'delta' is the elapsed time since the previous frame.
@@ -25,6 +36,20 @@ func load_next_level():
# TODO load main menu
return
- # TODO teleport the die to the start point
+ # load next level
levels[current_level_id].show()
+ # save current strokes and reset
+ strokes_per_level.append(current_strokes)
+ current_strokes = 0
+
+ # TODO teleport player back
+
+
+func add_stroke():
+ current_strokes += 1
+
+
+func revoke_stroke():
+ current_strokes -= 1
+