diff options
Diffstat (limited to '')
-rw-r--r-- | godot/native/GoalTriggerBox.gdns | 8 | ||||
-rw-r--r-- | godot/native/game.gdnlib | 6 | ||||
-rw-r--r-- | godot/scenes/Die.tscn | 29 | ||||
-rw-r--r-- | godot/scenes/Game.tscn | 38 | ||||
-rw-r--r-- | godot/scenes/levels/GoalTriggerZone.tscn | 14 | ||||
-rw-r--r-- | godot/scenes/levels/test_scene_uuuhhh/TestSceneUuuhhh.tscn | 12 | ||||
-rw-r--r-- | godot/scripts/GoalTriggerBox.gd | 22 | ||||
-rw-r--r-- | godot/scripts/LevelLoader.gd | 55 |
8 files changed, 171 insertions, 13 deletions
diff --git a/godot/native/GoalTriggerBox.gdns b/godot/native/GoalTriggerBox.gdns new file mode 100644 index 0000000..249df19 --- /dev/null +++ b/godot/native/GoalTriggerBox.gdns @@ -0,0 +1,8 @@ +[gd_resource type="NativeScript" load_steps=2 format=2] + +[ext_resource path="res://native/game.gdnlib" type="GDNativeLibrary" id=1] + +[resource] +resource_name = "GoalTriggerZone" +class_name = "GoalTriggerZone" +library = ExtResource( 1 ) diff --git a/godot/native/game.gdnlib b/godot/native/game.gdnlib index 439db91..b7c3ec4 100644 --- a/godot/native/game.gdnlib +++ b/godot/native/game.gdnlib @@ -11,14 +11,14 @@ Android.arm64-v8a="res://../lib/aarch64-linux-android/libcode_with_your_friends2 Android.armeabi-v7a="res://../lib/armv7-linux-androideabi/libcode_with_your_friends2022.so" Android.x86="res://../lib/i686-linux-android/libcode_with_your_friends2022.so" Android.x86_64="res://../lib/x86_64-linux-android/libcode_with_your_friends2022.so" -HTML5.wasm32 = "res://../lib/wasm32-unknown-emscripten/code_with_your_friends2022.wasm" +HTML5.wasm32="res://../lib/wasm32-unknown-emscripten/code_with_your_friends2022.wasm" iOS.arm64="res://../lib/aarch64-apple-ios/libcode_with_your_friends2022.a" OSX.64="res://../lib/x86_64-apple-darwin/libcode_with_your_friends2022.dylib" Server.32="res://../lib/i686-unknown-linux-gnu/libcode_with_your_friends2022.so" Server.64="res://../lib/x86_64-unknown-linux-gnu/libcode_with_your_friends2022.so" -# Windows.32="res://../lib/i686-pc-windows-gnu/code_with_your_friends2022.dll" +#Windows.32="res://../lib/i686-pc-windows-gnu/code_with_your_friends2022.dll" Windows.32="res://../lib/i686-pc-windows-msvc/code_with_your_friends2022.dll" -# Windows.64="res://../lib/x86_64-pc-windows-gnu/code_with_your_friends2022.dll" +#Windows.64="res://../lib/x86_64-pc-windows-gnu/code_with_your_friends2022.dll" Windows.64="res://../lib/x86_64-pc-windows-msvc/code_with_your_friends2022.dll" X11.32="res://../lib/i686-unknown-linux-gnu/libcode_with_your_friends2022.so" X11.64="res://../lib/x86_64-unknown-linux-gnu/libcode_with_your_friends2022.so" diff --git a/godot/scenes/Die.tscn b/godot/scenes/Die.tscn index 813f7b7..57594ed 100644 --- a/godot/scenes/Die.tscn +++ b/godot/scenes/Die.tscn @@ -1,4 +1,8 @@ +<<<<<<< HEAD:godot/scenes/objects/W8.tscn +[gd_scene load_steps=6 format=2] +======= [gd_scene load_steps=5 format=2] +>>>>>>> menu:godot/scenes/Die.tscn [ext_resource path="res://scenes/Die.gd" type="Script" id=1] [ext_resource path="res://assets/game_objects/W8baseColor_Mat.material" type="Material" id=2] @@ -21,17 +25,37 @@ surfaces/0 = { [sub_resource type="ConvexPolygonShape" id=2] points = PoolVector3Array( -0.0850063, -0.879389, -0.0282584, 0.0288993, 0.929375, 0.0289349, 0.0288993, 0.929375, -0.0289349, 0.929367, -0.0289314, 0.0289314, -0.0289784, -0.0289338, 0.929338, -0.929369, 0.028929, 0.028929, 0.0288993, -0.0289349, -0.929375, 0.0288993, -0.929375, 0.0289349, -0.0850063, 0.0282584, -0.879389, 0.0282247, 0.084959, 0.87945, 0.857489, 0.056933, -0.0855785, -0.879454, -0.0849424, 0.0282549, 0.0570775, -0.885814, -0.0571088, 0.0570775, -0.0571088, 0.885814, -0.0571532, 0.885743, -0.0571043, -0.0571532, 0.885743, 0.0571043, 0.0570775, 0.0571088, -0.885814, -0.885806, -0.057097, -0.057097, 0.879446, 0.0849494, 0.0282572, 0.857335, -0.0571018, -0.0855632, -0.0571532, 0.0571043, 0.885743, -0.0571532, -0.885743, 0.0571043, -0.885806, 0.057097, -0.057097, -0.0571532, -0.0571043, -0.885743, 0.0570775, 0.0571088, 0.885814, -0.0571532, -0.885743, -0.0571043, -0.0571532, 0.0571043, -0.885743, 0.0570775, -0.885814, 0.0571088, 0.0570775, 0.885814, 0.0571088, -0.0571532, -0.0571043, 0.885743, -0.885806, 0.057097, 0.057097, 0.0570775, 0.885814, -0.0571088, 0.0570775, -0.0571088, -0.885814, 0.857335, -0.0571018, 0.0855632, -0.885806, -0.057097, 0.057097, 0.857489, 0.056933, 0.0855785, 0.929425, 0.0287513, -0.0289333, 0.929367, -0.0289314, -0.0289314, -0.0289784, 0.929338, -0.0289338, 0.0288993, 0.0289349, -0.929375, -0.929369, -0.028929, -0.028929, -0.0283039, -0.87942, -0.0849561, 0.084933, 0.0282608, 0.879461, -0.0289784, 0.929338, 0.0289338, -0.0289784, -0.0289338, -0.929338, -0.0289784, 0.0289338, 0.929338, 0.0288993, -0.0289349, 0.929375, 0.0288993, -0.929375, -0.0289349, -0.0289784, -0.929338, 0.0289338, -0.929369, 0.028929, -0.028929, -0.0283039, 0.0849561, -0.87942, -0.879454, -0.0282549, 0.0849424, 0.879512, 0.0280816, 0.0849558, 0.879446, -0.0849494, -0.0282572, -0.0282988, -0.822574, 0.141805, 0.17021, 0.0280745, -0.794261, -0.879454, 0.0849424, -0.0282549, -0.0283039, 0.87942, 0.0849561, 0.0282247, 0.87945, -0.084959, 0.0282247, -0.084959, -0.87945, -0.879454, -0.0282549, -0.0849424, -0.0850063, 0.0282584, 0.879389, -0.0850063, 0.879389, 0.0282584, 0.084933, -0.0282608, 0.879461 ) +<<<<<<< HEAD:godot/scenes/objects/W8.tscn +[sub_resource type="SphereShape" id=3] + +[sub_resource type="SphereMesh" id=4] + +[node name="RigidBody" type="RigidBody"] +======= [node name="Die" type="RigidBody"] script = ExtResource( 1 ) +>>>>>>> menu:godot/scenes/Die.tscn -[node name="Cone" type="MeshInstance" parent="."] +[node name="MeshDie" type="MeshInstance" parent="."] mesh = SubResource( 1 ) skeleton = NodePath("../..") material/0 = null -[node name="CollisionShape" type="CollisionShape" parent="."] +[node name="CollisionShapeDie" type="CollisionShape" parent="."] shape = SubResource( 2 ) +<<<<<<< HEAD:godot/scenes/objects/W8.tscn +[node name="CollisionShapeSphere" type="CollisionShape" parent="."] +transform = Transform( 0.7, 0, 0, 0, 0.7, 0, 0, 0, 0.7, 0, 0, 0 ) +shape = SubResource( 3 ) +disabled = true + +[node name="MeshSphere" type="MeshInstance" parent="."] +transform = Transform( 0.7, 0, 0, 0, 0.7, 0, 0, 0, 0.7, 0, 0, 0 ) +visible = false +mesh = SubResource( 4 ) +material/0 = ExtResource( 2 ) +======= [node name="CamRoot" type="Spatial" parent="."] [node name="Horizontal" type="Spatial" parent="CamRoot"] @@ -40,3 +64,4 @@ shape = SubResource( 2 ) [node name="Camera" type="ClippedCamera" parent="CamRoot/Horizontal/Vertical"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 10.1285 ) +>>>>>>> menu:godot/scenes/Die.tscn diff --git a/godot/scenes/Game.tscn b/godot/scenes/Game.tscn index 0896836..710e5b5 100644 --- a/godot/scenes/Game.tscn +++ b/godot/scenes/Game.tscn @@ -1,13 +1,51 @@ +<<<<<<< HEAD +[gd_scene load_steps=8 format=2] + +[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://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=5 format=2] [ext_resource path="res://scenes/Game.gd" type="Script" id=1] [ext_resource path="res://scenes/levels/test_scene_movement/TestSceneMovement.tscn" type="PackedScene" id=2] [ext_resource path="res://assets/theme.tres" type="Theme" id=3] [ext_resource path="res://assets/fonts/format.tres" type="DynamicFont" id=4] +>>>>>>> menu [node name="Game" type="Spatial"] script = ExtResource( 1 ) +[node name="LevelLoader" type="Node" parent="."] +script = ExtResource( 3 ) + +[node name="Level1" type="Spatial" parent="."] + +[node name="MeshInstance" type="MeshInstance" parent="Level1"] +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 + +[node name="MeshInstance" type="MeshInstance" parent="Level2"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.99549, 0 ) +mesh = SubResource( 3 ) +material/0 = null + +[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 )] [node name="PausePopup" type="Control" parent="."] 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_uuuhhh/TestSceneUuuhhh.tscn b/godot/scenes/levels/test_scene_uuuhhh/TestSceneUuuhhh.tscn index 0820451..c1c8707 100644 --- a/godot/scenes/levels/test_scene_uuuhhh/TestSceneUuuhhh.tscn +++ b/godot/scenes/levels/test_scene_uuuhhh/TestSceneUuuhhh.tscn @@ -1,19 +1,15 @@ -[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] +<<<<<<< HEAD +======= [ext_resource path="res://scenes/Die.tscn" type="PackedScene" id=5] +>>>>>>> menu [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/scripts/GoalTriggerBox.gd b/godot/scripts/GoalTriggerBox.gd new file mode 100644 index 0000000..17e98ad --- /dev/null +++ b/godot/scripts/GoalTriggerBox.gd @@ -0,0 +1,22 @@ +extends Area + +const Loader = preload("res://scripts/LevelLoader.gd") +var loader: Loader = null + +# Called when the node enters the scene tree for the first time. +func _ready(): + loader = get_node("/root/Game/LevelLoader") + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass + + +func _on_Area2_body_entered(body: RigidBody): + # return when body is not a rigidbody + if body == null: + return + + loader.load_next_level() + diff --git a/godot/scripts/LevelLoader.gd b/godot/scripts/LevelLoader.gd new file mode 100644 index 0000000..2aec587 --- /dev/null +++ b/godot/scripts/LevelLoader.gd @@ -0,0 +1,55 @@ +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. +#func _process(delta): +# pass + +func load_next_level(): + levels[current_level_id].hide() + current_level_id = current_level_id + 1 + + if current_level_id >= NUM_LEVELS: + # TODO load main menu + return + + # 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 + |