Convert demos to Godot 4 using regular expressions in a script

This commit is contained in:
Aaron Franke
2022-03-26 05:00:50 -05:00
parent 410d783126
commit bbe50fc9da
1095 changed files with 13628 additions and 13557 deletions

View File

@@ -1,25 +1,25 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://models/white_wood.png" type="Texture" id=1]
[ext_resource path="res://models/white_wood.png" type="Texture2D" id=1]
[sub_resource type="BoxShape" id=1]
extents = Vector3( 0.5, 0.5, 0.5 )
[sub_resource type="BoxShape3D" id=1]
extents = Vector3(0.5, 0.5, 0.5)
[sub_resource type="SpatialMaterial" id=3]
[sub_resource type="StandardMaterial3D" id=3]
resource_name = "Material"
albedo_color = Color( 0.917647, 0.384314, 0.0823529, 1 )
albedo_color = Color(0.917647, 0.384314, 0.0823529, 1)
albedo_texture = ExtResource( 1 )
roughness = 0.75
[sub_resource type="CubeMesh" id=2]
[sub_resource type="BoxMesh" id=2]
material = SubResource( 3 )
size = Vector3( 1, 1, 1 )
size = Vector3(1, 1, 1)
[node name="cube_rigidbody" type="RigidBody"]
[node name="cube_rigidbody" type="RigidBody3D"]
[node name="CollisionShape" type="CollisionShape" parent="."]
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource( 1 )
[node name="MeshInstance" type="MeshInstance" parent="."]
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
mesh = SubResource( 2 )
material/0 = null
surface_material_override/0 = null

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
[sub_resource type="Sky" id=1]
radiance_size = 1
sky_top_color = Color( 0.219882, 0.193725, 0.366471, 1 )
sky_horizon_color = Color( 0.342622, 0.0655002, 0.558935, 1 )

View File

@@ -1,8 +1,8 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
type="StreamTexture2D"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
@@ -10,7 +10,7 @@ metadata={
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"]
[params]

View File

@@ -1,9 +1,9 @@
extends Spatial
extends Node3D
# Random spawn of Rigidbody cubes.
func _on_SpawnTimer_timeout():
var new_rb = preload("res://cube_rigidbody.tscn").instance()
new_rb.translation.y = 15
new_rb.translation.x = rand_range(-5, 5)
new_rb.translation.z = rand_range(-5, 5)
var new_rb = preload("res://cube_rigidbody.tscn").instantiate()
new_rb.position.y = 15
new_rb.position.x = randf_range(-5, 5)
new_rb.position.z = randf_range(-5, 5)
add_child(new_rb)

View File

@@ -7,45 +7,45 @@
[ext_resource path="res://level.gd" type="Script" id=6]
[ext_resource path="res://cube_rigidbody.tscn" type="PackedScene" id=7]
[sub_resource type="BoxShape" id=1]
[sub_resource type="BoxShape3D" id=1]
margin = 0.001
extents = Vector3( 0.5, 0.5, 0.5 )
extents = Vector3(0.5, 0.5, 0.5)
[sub_resource type="Animation" id=2]
length = 10.0
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath(".:translation")
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1, 4, 6, 9, 10 ),
"transitions": PoolRealArray( 1, -2, 1, -2, 1, 1 ),
"times": PackedFloat32Array(0, 1, 4, 6, 9, 10),
"transitions": PackedFloat32Array(1, -2, 1, -2, 1, 1),
"update": 0,
"values": [ Vector3( 0.5, 4.5, -2.5 ), Vector3( 0.5, 4.5, -2.5 ), Vector3( 0.5, 8.5, -2.5 ), Vector3( 0.5, 8.5, -2.5 ), Vector3( 0.5, 4.5, -2.5 ), Vector3( 0.5, 4.5, -2.5 ) ]
"values": [Vector3(0.5, 4.5, -2.5), Vector3(0.5, 4.5, -2.5), Vector3(0.5, 8.5, -2.5), Vector3(0.5, 8.5, -2.5), Vector3(0.5, 4.5, -2.5), Vector3(0.5, 4.5, -2.5)]
}
[sub_resource type="Animation" id=3]
length = 10.0
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath(".:translation")
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 2, 4.5, 6, 9 ),
"transitions": PoolRealArray( 1, -2, 1, -2, 1 ),
"times": PackedFloat32Array(0, 2, 4.5, 6, 9),
"transitions": PackedFloat32Array(1, -2, 1, -2, 1),
"update": 0,
"values": [ Vector3( -3.5, 8.5, 4.5 ), Vector3( -3.5, 8.5, 4.5 ), Vector3( 3.5, 8.5, 4.5 ), Vector3( 3.5, 8.5, 4.5 ), Vector3( -3.5, 8.5, 4.5 ) ]
"values": [Vector3(-3.5, 8.5, 4.5), Vector3(-3.5, 8.5, 4.5), Vector3(3.5, 8.5, 4.5), Vector3(3.5, 8.5, 4.5), Vector3(-3.5, 8.5, 4.5)]
}
[sub_resource type="BoxShape" id=4]
[sub_resource type="BoxShape3D" id=4]
[node name="World" type="Spatial"]
[node name="World3D" type="Node3D"]
script = ExtResource( 6 )
__meta__ = {
"__editor_plugin_screen__": "3D"
@@ -53,17 +53,17 @@ __meta__ = {
[node name="GridMap" type="GridMap" parent="."]
mesh_library = ExtResource( 1 )
cell_size = Vector3( 1, 1, 1 )
cell_size = Vector3(1, 1, 1)
data = {
"cells": PoolIntArray( 0, 0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0, 4, 0, 0, 65530, 0, 0, 65531, 0, 0, 65532, 0, 0, 65533, 0, 0, 65534, 0, 0, 65535, 0, 0, 196603, 0, 0, 196604, 0, 0, 524292, 0, 0, 589820, 0, 0, 786432, 0, 0, 851967, 0, 0, 0, 1, 0, 1, 1, 0, 2, 1, 0, 3, 1, 0, 4, 1, 0, 65530, 1, 0, 65531, 1, 0, 65532, 1, 0, 65533, 1, 0, 65534, 1, 0, 65535, 1, 0, 131075, 1, 0, 196603, 1, 0, 196604, 1, 0, 524292, 1, 0, 589820, 1, 0, 786432, 1, 0, 851967, 1, 0, 0, 2, 0, 1, 2, 0, 2, 2, 0, 3, 2, 0, 4, 2, 0, 65530, 2, 0, 65531, 2, 0, 65532, 2, 0, 65533, 2, 0, 65534, 2, 0, 65535, 2, 0, 131075, 2, 0, 196603, 2, 0, 196604, 2, 0, 524292, 2, 0, 589820, 2, 0, 786432, 2, 0, 786433, 2, 0, 851966, 2, 0, 851967, 2, 0, 0, 3, 0, 1, 3, 0, 2, 3, 0, 3, 3, 0, 4, 3, 0, 65530, 3, 0, 65531, 3, 0, 65532, 3, 0, 65533, 3, 0, 65534, 3, 0, 65535, 3, 0, 196603, 3, 0, 524291, 3, 0, 524292, 3, 0, 589820, 3, 0, 786432, 3, 0, 786433, 3, 0, 851966, 3, 0, 851967, 3, 0, 0, 4, 0, 1, 4, 0, 2, 4, 0, 3, 4, 0, 4, 4, 0, 65530, 4, 0, 65531, 4, 0, 65532, 4, 0, 65533, 4, 0, 65534, 4, 0, 65535, 4, 0, 196603, 4, 0, 0, 5, 0, 1, 5, 0, 2, 5, 0, 3, 5, 0, 4, 5, 0, 65530, 5, 0, 65531, 5, 0, 65532, 5, 0, 65533, 5, 0, 65534, 5, 0, 65535, 5, 0, 131075, 5, 0, 0, 6, 0, 1, 6, 0, 2, 6, 0, 3, 6, 0, 4, 6, 0, 65530, 6, 0, 65531, 6, 0, 65532, 6, 0, 65533, 6, 0, 65534, 6, 0, 65535, 6, 0, 131075, 6, 0, 196603, 6, 0, 0, 7, 0, 1, 7, 0, 2, 7, 0, 3, 7, 0, 4, 7, 0, 65530, 7, 0, 65531, 7, 0, 65532, 7, 0, 65533, 7, 0, 65534, 7, 0, 65535, 7, 0, 131075, 7, 0, 196603, 7, 0, 0, 8, 0, 1, 8, 0, 2, 8, 0, 3, 8, 0, 4, 8, 0, 65530, 8, 0, 65531, 8, 0, 65532, 8, 0, 65533, 8, 0, 65534, 8, 0, 65535, 8, 0, 131075, 8, 0, 196603, 8, 0, 196604, 8, 0, 0, 9, 0, 1, 9, 0, 2, 9, 0, 3, 9, 0, 4, 9, 0, 65530, 9, 0, 65531, 9, 0, 65532, 9, 0, 65533, 9, 0, 65534, 9, 0, 65535, 9, 0, 131073, 9, 0, 131074, 9, 0, 131075, 9, 0, 196603, 9, 0, 196604, 9, 0, 196605, 9, 0, 196608, 9, 0, 262142, 9, 0, 0, 10, 0, 1, 10, 0, 2, 10, 0, 3, 10, 0, 4, 10, 0, 65530, 10, 0, 65531, 10, 0, 65532, 10, 0, 65533, 10, 0, 65534, 10, 0, 65535, 10, 0, 0, 11, 0, 1, 11, 0, 2, 11, 0, 3, 11, 0, 4, 11, 0, 65530, 11, 0, 65531, 11, 0, 65532, 11, 0, 65533, 11, 0, 65534, 11, 0, 65535, 11, 0, 0, 65532, 0, 1, 65532, 0, 2, 65532, 0, 3, 65532, 0, 4, 65532, 0, 65530, 65532, 0, 65531, 65532, 0, 65532, 65532, 0, 65533, 65532, 0, 65534, 65532, 0, 65535, 65532, 0, 0, 65533, 0, 1, 65533, 0, 2, 65533, 0, 3, 65533, 0, 4, 65533, 0, 65530, 65533, 0, 65531, 65533, 0, 65532, 65533, 0, 65533, 65533, 0, 65534, 65533, 0, 65535, 65533, 0, 262145, 65533, 0, 262146, 65533, 0, 262147, 65533, 0, 589822, 65533, 0, 589823, 65533, 0, 655363, 65533, 0, 655364, 65533, 0, 720897, 65533, 0, 720898, 65533, 0, 786432, 65533, 0, 851967, 65533, 0, 0, 65534, 0, 1, 65534, 0, 2, 65534, 0, 3, 65534, 0, 4, 65534, 0, 65530, 65534, 0, 65531, 65534, 0, 65532, 65534, 0, 65533, 65534, 0, 65534, 65534, 0, 65535, 65534, 0, 65536, 65534, 0, 131071, 65534, 0, 196603, 65534, 0, 196604, 65534, 0, 196605, 65534, 0, 196606, 65534, 0, 196607, 65534, 0, 589822, 65534, 0, 589828, 65534, 0, 786432, 65534, 0, 851967, 65534, 0, 0, 65535, 0, 1, 65535, 0, 2, 65535, 0, 3, 65535, 0, 4, 65535, 0, 65530, 65535, 0, 65531, 65535, 0, 65532, 65535, 0, 65533, 65535, 0, 65534, 65535, 0, 65535, 65535, 0, 196603, 65535, 0, 196604, 65535, 0, 196611, 65535, 0, 589820, 65535, 0, 589821, 65535, 0, 589822, 65535, 0, 589828, 65535, 0, 786432, 65535, 0, 851967, 65535, 0 )
"cells": PackedInt32Array(0, 0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0, 4, 0, 0, 65530, 0, 0, 65531, 0, 0, 65532, 0, 0, 65533, 0, 0, 65534, 0, 0, 65535, 0, 0, 196603, 0, 0, 196604, 0, 0, 524292, 0, 0, 589820, 0, 0, 786432, 0, 0, 851967, 0, 0, 0, 1, 0, 1, 1, 0, 2, 1, 0, 3, 1, 0, 4, 1, 0, 65530, 1, 0, 65531, 1, 0, 65532, 1, 0, 65533, 1, 0, 65534, 1, 0, 65535, 1, 0, 131075, 1, 0, 196603, 1, 0, 196604, 1, 0, 524292, 1, 0, 589820, 1, 0, 786432, 1, 0, 851967, 1, 0, 0, 2, 0, 1, 2, 0, 2, 2, 0, 3, 2, 0, 4, 2, 0, 65530, 2, 0, 65531, 2, 0, 65532, 2, 0, 65533, 2, 0, 65534, 2, 0, 65535, 2, 0, 131075, 2, 0, 196603, 2, 0, 196604, 2, 0, 524292, 2, 0, 589820, 2, 0, 786432, 2, 0, 786433, 2, 0, 851966, 2, 0, 851967, 2, 0, 0, 3, 0, 1, 3, 0, 2, 3, 0, 3, 3, 0, 4, 3, 0, 65530, 3, 0, 65531, 3, 0, 65532, 3, 0, 65533, 3, 0, 65534, 3, 0, 65535, 3, 0, 196603, 3, 0, 524291, 3, 0, 524292, 3, 0, 589820, 3, 0, 786432, 3, 0, 786433, 3, 0, 851966, 3, 0, 851967, 3, 0, 0, 4, 0, 1, 4, 0, 2, 4, 0, 3, 4, 0, 4, 4, 0, 65530, 4, 0, 65531, 4, 0, 65532, 4, 0, 65533, 4, 0, 65534, 4, 0, 65535, 4, 0, 196603, 4, 0, 0, 5, 0, 1, 5, 0, 2, 5, 0, 3, 5, 0, 4, 5, 0, 65530, 5, 0, 65531, 5, 0, 65532, 5, 0, 65533, 5, 0, 65534, 5, 0, 65535, 5, 0, 131075, 5, 0, 0, 6, 0, 1, 6, 0, 2, 6, 0, 3, 6, 0, 4, 6, 0, 65530, 6, 0, 65531, 6, 0, 65532, 6, 0, 65533, 6, 0, 65534, 6, 0, 65535, 6, 0, 131075, 6, 0, 196603, 6, 0, 0, 7, 0, 1, 7, 0, 2, 7, 0, 3, 7, 0, 4, 7, 0, 65530, 7, 0, 65531, 7, 0, 65532, 7, 0, 65533, 7, 0, 65534, 7, 0, 65535, 7, 0, 131075, 7, 0, 196603, 7, 0, 0, 8, 0, 1, 8, 0, 2, 8, 0, 3, 8, 0, 4, 8, 0, 65530, 8, 0, 65531, 8, 0, 65532, 8, 0, 65533, 8, 0, 65534, 8, 0, 65535, 8, 0, 131075, 8, 0, 196603, 8, 0, 196604, 8, 0, 0, 9, 0, 1, 9, 0, 2, 9, 0, 3, 9, 0, 4, 9, 0, 65530, 9, 0, 65531, 9, 0, 65532, 9, 0, 65533, 9, 0, 65534, 9, 0, 65535, 9, 0, 131073, 9, 0, 131074, 9, 0, 131075, 9, 0, 196603, 9, 0, 196604, 9, 0, 196605, 9, 0, 196608, 9, 0, 262142, 9, 0, 0, 10, 0, 1, 10, 0, 2, 10, 0, 3, 10, 0, 4, 10, 0, 65530, 10, 0, 65531, 10, 0, 65532, 10, 0, 65533, 10, 0, 65534, 10, 0, 65535, 10, 0, 0, 11, 0, 1, 11, 0, 2, 11, 0, 3, 11, 0, 4, 11, 0, 65530, 11, 0, 65531, 11, 0, 65532, 11, 0, 65533, 11, 0, 65534, 11, 0, 65535, 11, 0, 0, 65532, 0, 1, 65532, 0, 2, 65532, 0, 3, 65532, 0, 4, 65532, 0, 65530, 65532, 0, 65531, 65532, 0, 65532, 65532, 0, 65533, 65532, 0, 65534, 65532, 0, 65535, 65532, 0, 0, 65533, 0, 1, 65533, 0, 2, 65533, 0, 3, 65533, 0, 4, 65533, 0, 65530, 65533, 0, 65531, 65533, 0, 65532, 65533, 0, 65533, 65533, 0, 65534, 65533, 0, 65535, 65533, 0, 262145, 65533, 0, 262146, 65533, 0, 262147, 65533, 0, 589822, 65533, 0, 589823, 65533, 0, 655363, 65533, 0, 655364, 65533, 0, 720897, 65533, 0, 720898, 65533, 0, 786432, 65533, 0, 851967, 65533, 0, 0, 65534, 0, 1, 65534, 0, 2, 65534, 0, 3, 65534, 0, 4, 65534, 0, 65530, 65534, 0, 65531, 65534, 0, 65532, 65534, 0, 65533, 65534, 0, 65534, 65534, 0, 65535, 65534, 0, 65536, 65534, 0, 131071, 65534, 0, 196603, 65534, 0, 196604, 65534, 0, 196605, 65534, 0, 196606, 65534, 0, 196607, 65534, 0, 589822, 65534, 0, 589828, 65534, 0, 786432, 65534, 0, 851967, 65534, 0, 0, 65535, 0, 1, 65535, 0, 2, 65535, 0, 3, 65535, 0, 4, 65535, 0, 65530, 65535, 0, 65531, 65535, 0, 65532, 65535, 0, 65533, 65535, 0, 65534, 65535, 0, 65535, 65535, 0, 196603, 65535, 0, 196604, 65535, 0, 196611, 65535, 0, 589820, 65535, 0, 589821, 65535, 0, 589822, 65535, 0, 589828, 65535, 0, 786432, 65535, 0, 851967, 65535, 0)
}
__meta__ = {
"_editor_clip_": 0,
"_editor_floor_": Vector3( 0, 12, 0 )
"_editor_floor_": Vector3(0, 12, 0)
}
[node name="DirectionalLight" type="DirectionalLight" parent="."]
transform = Transform( -0.173649, 0.806707, -0.564863, 0, 0.573576, 0.819152, 0.984808, 0.142244, -0.0996007, 0, 0, 0 )
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.173649, 0.806707, -0.564863, 0, 0.573576, 0.819152, 0.984808, 0.142244, -0.0996007, 0, 0, 0)
light_energy = 1.3
shadow_enabled = true
shadow_bias = -0.02
@@ -74,17 +74,17 @@ directional_shadow_bias_split_scale = 0.0
directional_shadow_max_distance = 20.0
[node name="Cubio" parent="." instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5, 2, 4 )
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.5, 2, 4)
[node name="Elevator1" type="KinematicBody" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 4.5, -2.5 )
[node name="Elevator1" type="CharacterBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 4.5, -2.5)
input_capture_on_drag = true
[node name="Mesh" type="MeshInstance" parent="Elevator1"]
[node name="Mesh" type="MeshInstance3D" parent="Elevator1"]
mesh = ExtResource( 3 )
material/0 = null
surface_material_override/0 = null
[node name="CollisionShape" type="CollisionShape" parent="Elevator1"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Elevator1"]
shape = SubResource( 1 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="Elevator1"]
@@ -92,14 +92,14 @@ autoplay = "updown1"
playback_process_mode = 0
anims/updown1 = SubResource( 2 )
[node name="Elevator2" type="KinematicBody" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -3.5, 8.5, 4.5 )
[node name="Elevator2" type="CharacterBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.5, 8.5, 4.5)
[node name="Mesh" type="MeshInstance" parent="Elevator2"]
[node name="Mesh" type="MeshInstance3D" parent="Elevator2"]
mesh = ExtResource( 3 )
material/0 = null
surface_material_override/0 = null
[node name="CollisionShape" type="CollisionShape" parent="Elevator2"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Elevator2"]
shape = SubResource( 1 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="Elevator2"]
@@ -108,13 +108,13 @@ playback_process_mode = 0
anims/side = SubResource( 3 )
anims/updown1 = SubResource( 2 )
[node name="Princess" type="Area" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 13.25, 3 )
[node name="Princess" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 13.25, 3)
[node name="Mushroom" parent="Princess" instance=ExtResource( 5 )]
[node name="CollisionShape" type="CollisionShape" parent="Princess"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0 )
[node name="CollisionShape3D" type="CollisionShape3D" parent="Princess"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
shape = SubResource( 4 )
[node name="SpawnTimer" type="Timer" parent="."]
@@ -122,7 +122,7 @@ wait_time = 2.0
autostart = true
[node name="cube_rigidbody" parent="." instance=ExtResource( 7 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.416964, 3.3565, 2.6332 )
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.416964, 3.3565, 2.6332)
[connection signal="body_entered" from="Princess" to="Cubio" method="_on_tcube_body_entered"]
[connection signal="timeout" from="SpawnTimer" to="." method="_on_SpawnTimer_timeout"]

View File

@@ -2,16 +2,16 @@
importer="scene"
type="PackedScene"
path="res://.import/cube.glb-c6bf6ebacd621473d1ca4ff4a368b9dc.scn"
path="res://.godot/imported/cube.glb-c6bf6ebacd621473d1ca4ff4a368b9dc.scn"
[deps]
source_file="res://models/cube.glb"
dest_files=[ "res://.import/cube.glb-c6bf6ebacd621473d1ca4ff4a368b9dc.scn" ]
dest_files=["res://.godot/imported/cube.glb-c6bf6ebacd621473d1ca4ff4a368b9dc.scn"]
[params]
nodes/root_type="Spatial"
nodes/root_type="Node3D"
nodes/root_name="Cube"
nodes/root_scale=1.0
nodes/custom_script=""

View File

@@ -1,6 +1,6 @@
[gd_resource type="SpatialMaterial" load_steps=2 format=2]
[gd_resource type="StandardMaterial3D" load_steps=2 format=2]
[ext_resource path="res://models/white_wood.png" type="Texture" id=1]
[ext_resource path="res://models/white_wood.png" type="Texture2D" id=1]
[resource]
resource_name = "Material"

View File

@@ -2,16 +2,16 @@
importer="scene"
type="PackedScene"
path="res://.import/mushroom.glb-32cf35844b7be6455c0c736b26eb7163.scn"
path="res://.godot/imported/mushroom.glb-32cf35844b7be6455c0c736b26eb7163.scn"
[deps]
source_file="res://models/mushroom.glb"
dest_files=[ "res://.import/mushroom.glb-32cf35844b7be6455c0c736b26eb7163.scn" ]
dest_files=["res://.godot/imported/mushroom.glb-32cf35844b7be6455c0c736b26eb7163.scn"]
[params]
nodes/root_type="Spatial"
nodes/root_type="Node3D"
nodes/root_name="Mushroom"
nodes/root_scale=1.0
nodes/custom_script=""

View File

@@ -1,6 +1,6 @@
[gd_resource type="SpatialMaterial" load_steps=2 format=2]
[gd_resource type="StandardMaterial3D" load_steps=2 format=2]
[ext_resource path="res://models/white_wood.png" type="Texture" id=1]
[ext_resource path="res://models/white_wood.png" type="Texture2D" id=1]
[resource]
resource_name = "Material"

View File

@@ -1,19 +1,19 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/white_wood.png-821b7bf9b3881778c9bff1c965d8a87c.s3tc.stex"
path.etc2="res://.import/white_wood.png-821b7bf9b3881778c9bff1c965d8a87c.etc2.stex"
path.etc="res://.import/white_wood.png-821b7bf9b3881778c9bff1c965d8a87c.etc.stex"
type="StreamTexture2D"
path.s3tc="res://.godot/imported/white_wood.png-821b7bf9b3881778c9bff1c965d8a87c.s3tc.stex"
path.etc2="res://.godot/imported/white_wood.png-821b7bf9b3881778c9bff1c965d8a87c.etc2.stex"
path.etc="res://.godot/imported/white_wood.png-821b7bf9b3881778c9bff1c965d8a87c.etc.stex"
metadata={
"imported_formats": [ "s3tc", "etc2", "etc" ],
"imported_formats": ["s3tc", "etc2", "etc"],
"vram_texture": true
}
[deps]
source_file="res://models/white_wood.png"
dest_files=[ "res://.import/white_wood.png-821b7bf9b3881778c9bff1c965d8a87c.s3tc.stex", "res://.import/white_wood.png-821b7bf9b3881778c9bff1c965d8a87c.etc2.stex", "res://.import/white_wood.png-821b7bf9b3881778c9bff1c965d8a87c.etc.stex" ]
dest_files=["res://.godot/imported/white_wood.png-821b7bf9b3881778c9bff1c965d8a87c.s3tc.stex", "res://.godot/imported/white_wood.png-821b7bf9b3881778c9bff1c965d8a87c.etc2.stex", "res://.godot/imported/white_wood.png-821b7bf9b3881778c9bff1c965d8a87c.etc.stex"]
[params]

View File

@@ -1,25 +1,25 @@
extends RigidBody
extends RigidBody3D
onready var raycast = $RayCast
onready var camera = $Target/Camera
onready var start_position = translation
@onready var raycast = $RayCast3D
@onready var camera = $Target/Camera3D
@onready var start_position = position
func _physics_process(_delta):
if Input.is_action_just_pressed("exit"):
get_tree().quit()
if Input.is_action_just_pressed("reset_position"):
translation = start_position
position = start_position
return
var dir = Vector3()
dir.x = Input.get_action_strength("move_right") - Input.get_action_strength("move_left")
dir.z = Input.get_action_strength("move_back") - Input.get_action_strength("move_forward")
dir.x = Input.get_axis(&"move_left", &"move_right")
dir.z = Input.get_axis(&"move_forward", &"move_back")
# Get the camera's transform basis, but remove the X rotation such
# that the Y axis is up and Z is horizontal.
var cam_basis = camera.global_transform.basis
var basis = cam_basis.rotated(cam_basis.x, -cam_basis.get_euler().x)
dir = basis.xform(dir)
dir = basis * (dir)
apply_central_impulse(dir.normalized() / 10)
@@ -36,4 +36,4 @@ func on_ground():
func _on_tcube_body_entered(body):
if body == self:
get_node("WinText").show()
get_node(^"WinText").show()

View File

@@ -8,11 +8,11 @@
radius = 0.5
mid_height = 0.7
[sub_resource type="CapsuleShape" id=5]
[sub_resource type="CapsuleShape3D" id=5]
radius = 0.5
height = 0.7
[node name="RigidBody" type="RigidBody"]
[node name="RigidBody3D" type="RigidBody3D"]
can_sleep = false
axis_lock_angular_x = true
axis_lock_angular_y = true
@@ -20,22 +20,22 @@ axis_lock_angular_z = true
linear_damp = 0.5
script = ExtResource( 1 )
[node name="CubeMesh" type="MeshInstance" parent="."]
[node name="BoxMesh" type="MeshInstance3D" parent="."]
_import_path = NodePath("cube-col")
transform = Transform( 0.9, 0, 0, 0, -3.93403e-08, -0.9, 0, 0.9, -3.93403e-08, 0, 0, 0 )
transform = Transform3D(0.9, 0, 0, 0, -3.93403e-08, -0.9, 0, 0.9, -3.93403e-08, 0, 0, 0)
mesh = SubResource( 6 )
skeleton = NodePath("")
material/0 = ExtResource( 4 )
surface_material_override/0 = ExtResource( 4 )
[node name="CollisionShape" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0 )
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)
shape = SubResource( 5 )
[node name="Target" type="Spatial" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0 )
[node name="Target" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
[node name="Camera" type="Camera" parent="Target"]
transform = Transform( 0.34202, -0.321394, 0.883022, 0, 0.939693, 0.34202, -0.939693, -0.116978, 0.321394, 2, 0.5, 0.913381 )
[node name="Camera3D" type="Camera3D" parent="Target"]
transform = Transform3D(0.34202, -0.321394, 0.883022, 0, 0.939693, 0.34202, -0.939693, -0.116978, 0.321394, 2, 0.5, 0.913381)
fov = 74.0
near = 0.1
far = 50.0
@@ -44,21 +44,21 @@ script = ExtResource( 3 )
[node name="WinText" type="CenterContainer" parent="."]
visible = false
anchor_right = 1.0
margin_bottom = 100.0
offset_bottom = 100.0
[node name="Holder" type="Control" parent="WinText"]
margin_left = 512.0
margin_top = 50.0
margin_right = 512.0
margin_bottom = 50.0
offset_left = 512.0
offset_top = 50.0
offset_right = 512.0
offset_bottom = 50.0
[node name="TextLabel" type="Label" parent="WinText/Holder"]
margin_left = -354.0
margin_bottom = 14.0
rect_scale = Vector2( 2, 2 )
offset_left = -354.0
offset_bottom = 14.0
rect_scale = Vector2(2, 2)
text = "Thank You, Cubio! But the Princess is in Another Demo!"
align = 1
valign = 1
[node name="RayCast" type="RayCast" parent="."]
[node name="RayCast3D" type="RayCast3D" parent="."]
enabled = true

View File

@@ -1,18 +1,18 @@
extends Camera
extends Camera3D
var collision_exception = []
export var min_distance = 0.5
export var max_distance = 3.0
export var angle_v_adjust = 0.0
@export var min_distance = 0.5
@export var max_distance = 3.0
@export var angle_v_adjust = 0.0
var max_height = 2.0
var min_height = 0
onready var target_node: Spatial = get_parent()
@onready var target_node: Node3D = get_parent()
func _ready():
collision_exception.append(target_node.get_parent().get_rid())
# Detaches the camera transform from the parent spatial node
set_as_toplevel(true)
set_as_top_level(true)
func _physics_process(_delta):

View File

@@ -10,7 +10,7 @@ config_version=4
[application]
config/name="RigidBody Character 3D"
config/name="RigidBody3D Character 3D"
config/description="Rigidbody character demo for 3D using a capsule for the character.
"
run/main_scene="res://level.tscn"
@@ -18,59 +18,59 @@ config/icon="res://icon.png"
[gdnative]
singletons=[ ]
singletons=[]
[input]
jump={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
]
]
}
move_back={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777234,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":83,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
]
]
}
move_forward={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777232,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":87,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
]
]
}
move_left={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777231,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":65,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
]
]
}
move_right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777233,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":68,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
]
]
}
reset_position={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":82,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":82,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":2,"pressure":0.0,"pressed":false,"script":null)
]
]
}
exit={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777217,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null)
]
]
}
[physics]