Add table scene, make blocks generate on table and randomly
This commit is contained in:
parent
8b00b5aae4
commit
3c302f5a7a
@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=112 format=4 uid="uid://8po7ftboqq4k"]
|
[gd_scene load_steps=113 format=4 uid="uid://8po7ftboqq4k"]
|
||||||
|
|
||||||
[ext_resource type="CameraAttributesPhysical" uid="uid://cxyj2tvfksjl6" path="res://scenes/hazy_env_camera_attrs.tres" id="1_r2j1d"]
|
[ext_resource type="CameraAttributesPhysical" uid="uid://cxyj2tvfksjl6" path="res://scenes/hazy_env_camera_attrs.tres" id="1_r2j1d"]
|
||||||
[ext_resource type="LightmapGIData" uid="uid://bp05p4yab2ukx" path="res://scenes/demo/demo.lmbake" id="2_2ehlo"]
|
[ext_resource type="LightmapGIData" uid="uid://bp05p4yab2ukx" path="res://scenes/demo/demo.lmbake" id="2_2ehlo"]
|
||||||
@ -9,8 +9,9 @@
|
|||||||
[ext_resource type="Material" uid="uid://bpikku6t3gxi5" path="res://textures/white.tres" id="7_70h1h"]
|
[ext_resource type="Material" uid="uid://bpikku6t3gxi5" path="res://textures/white.tres" id="7_70h1h"]
|
||||||
[ext_resource type="Material" uid="uid://dgf570wtqn17j" path="res://textures/steel_fence.tres" id="8_dovc4"]
|
[ext_resource type="Material" uid="uid://dgf570wtqn17j" path="res://textures/steel_fence.tres" id="8_dovc4"]
|
||||||
[ext_resource type="PackedScene" uid="uid://wjbuh7jk50nm" path="res://scenes/player.tscn" id="10_3xiy2"]
|
[ext_resource type="PackedScene" uid="uid://wjbuh7jk50nm" path="res://scenes/player.tscn" id="10_3xiy2"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://d02cqylu3xwos" path="res://scenes/table.tscn" id="11_7trvw"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c670g1qg5gaug" path="res://scenes/interface/pause_menu.tscn" id="11_lav3p"]
|
[ext_resource type="PackedScene" uid="uid://c670g1qg5gaug" path="res://scenes/interface/pause_menu.tscn" id="11_lav3p"]
|
||||||
[ext_resource type="PackedScene" uid="uid://diwlyi146eroa" path="res://models/table.fbx" id="11_mit2f"]
|
[ext_resource type="Material" uid="uid://bq5oqyuwekryv" path="res://textures/building_block.tres" id="12_i3ahj"]
|
||||||
|
|
||||||
[sub_resource type="ArrayMesh" id="ArrayMesh_kaiip"]
|
[sub_resource type="ArrayMesh" id="ArrayMesh_kaiip"]
|
||||||
lightmap_size_hint = Vector2i(1030, 566)
|
lightmap_size_hint = Vector2i(1030, 566)
|
||||||
@ -1051,8 +1052,16 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0415039, 58.3319, 0.0198975
|
|||||||
size = Vector3(43.3174, 26.5295, 43.4319)
|
size = Vector3(43.3174, 26.5295, 43.4319)
|
||||||
|
|
||||||
[node name="Player" parent="." instance=ExtResource("10_3xiy2")]
|
[node name="Player" parent="." instance=ExtResource("10_3xiy2")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.332064, 1.5426, 3.65156)
|
||||||
|
|
||||||
[node name="PauseMenu" parent="." instance=ExtResource("11_lav3p")]
|
[node name="PauseMenu" parent="." instance=ExtResource("11_lav3p")]
|
||||||
|
|
||||||
[node name="table" parent="." instance=ExtResource("11_mit2f")]
|
[node name="table" parent="." instance=ExtResource("11_7trvw")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.73135, 0, 1.00218)
|
transform = Transform3D(-0.0123217, 0, 0.999924, 0, 1, 0, -0.999924, 0, -0.0123217, 0, 0, 0)
|
||||||
|
|
||||||
|
[node name="Node3D" parent="table" index="2" node_paths=PackedStringArray("TrenchbroomMap")]
|
||||||
|
TrenchbroomMap = NodePath("../../FuncGodotMap")
|
||||||
|
BuildingBlockMaterial = ExtResource("12_i3ahj")
|
||||||
|
BuildingBlockScale = 0.005
|
||||||
|
|
||||||
|
[editable path="table"]
|
||||||
|
21
scenes/table.tscn
Normal file
21
scenes/table.tscn
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
[gd_scene load_steps=4 format=3 uid="uid://d02cqylu3xwos"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://diwlyi146eroa" path="res://models/table.fbx" id="1_1soa3"]
|
||||||
|
[ext_resource type="Script" path="res://scripts/BuildingBlockCreator.cs" id="2_rqgiy"]
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_iiew7"]
|
||||||
|
size = Vector3(1.26587, 0.102112, 2.3989)
|
||||||
|
|
||||||
|
[node name="table" type="StaticBody3D"]
|
||||||
|
collision_layer = 2
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="table" parent="." instance=ExtResource("1_1soa3")]
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00354004, 1.05606, -0.00126699)
|
||||||
|
shape = SubResource("BoxShape3D_iiew7")
|
||||||
|
|
||||||
|
[node name="Node3D" type="Node3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.58235, 0)
|
||||||
|
script = ExtResource("2_rqgiy")
|
@ -14,7 +14,10 @@ namespace Gmtk24 {
|
|||||||
public override void _Ready() {
|
public override void _Ready() {
|
||||||
var children = TrenchbroomMap.FindChildren("*_buildingblock");
|
var children = TrenchbroomMap.FindChildren("*_buildingblock");
|
||||||
foreach (var buildingBlockStaticBody in children) {
|
foreach (var buildingBlockStaticBody in children) {
|
||||||
var buildingBlock = new RigidBody3D();
|
var buildingBlock = new RigidBody3D() {
|
||||||
|
CollisionMask = 0b10,
|
||||||
|
CollisionLayer = 0b10,
|
||||||
|
};
|
||||||
|
|
||||||
var smallMesh = (MeshInstance3D)buildingBlockStaticBody.GetChild<MeshInstance3D>(0).Duplicate();
|
var smallMesh = (MeshInstance3D)buildingBlockStaticBody.GetChild<MeshInstance3D>(0).Duplicate();
|
||||||
smallMesh.Scale = Vector3.One * BuildingBlockScale;
|
smallMesh.Scale = Vector3.One * BuildingBlockScale;
|
||||||
@ -45,6 +48,9 @@ namespace Gmtk24 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AddChild(buildingBlock);
|
AddChild(buildingBlock);
|
||||||
|
var rng = new RandomNumberGenerator();
|
||||||
|
buildingBlock.Translate(Vector3.One * rng.Randf() * 0.5f);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user