Basic Dungeon generation implementation
This commit is contained in:
@@ -17,4 +17,7 @@
|
|||||||
<PackageReference Include="System.IO.Abstractions" Version="21.0.29" />
|
<PackageReference Include="System.IO.Abstractions" Version="21.0.29" />
|
||||||
<PackageReference Include="Zeroconf" Version="3.6.11" />
|
<PackageReference Include="Zeroconf" Version="3.6.11" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="src\map\dungeon\corridor\" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -23,6 +23,10 @@ window/size/viewport_height=1080
|
|||||||
|
|
||||||
project/assembly_name="GameJamDungeon"
|
project/assembly_name="GameJamDungeon"
|
||||||
|
|
||||||
|
[editor_plugins]
|
||||||
|
|
||||||
|
enabled=PackedStringArray("res://addons/SimpleDungeons/plugin.cfg")
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
MoveUp={
|
MoveUp={
|
||||||
@@ -65,3 +69,43 @@ Inventory={
|
|||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
move_forward={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_backward={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_right={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_left={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_sprint={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194325,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_jump={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_crouch={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194326,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_fly_mode={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ using System.Reflection;
|
|||||||
// If you want to edit your game's main entry-point, please see Game.tscn and
|
// If you want to edit your game's main entry-point, please see Game.tscn and
|
||||||
// Game.cs instead.
|
// Game.cs instead.
|
||||||
|
|
||||||
public partial class Main : Node2D
|
public partial class Main : Node
|
||||||
{
|
{
|
||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
[ext_resource type="Script" path="res://src/Main.cs" id="1_prpoe"]
|
[ext_resource type="Script" path="res://src/Main.cs" id="1_prpoe"]
|
||||||
|
|
||||||
[node name="Node2D" type="Node2D"]
|
[node name="Node" type="Node"]
|
||||||
script = ExtResource("1_prpoe")
|
script = ExtResource("1_prpoe")
|
||||||
|
|||||||
@@ -1,3 +1,89 @@
|
|||||||
[gd_scene format=3 uid="uid://cagfc5ridmteu"]
|
[gd_scene load_steps=8 format=3 uid="uid://cagfc5ridmteu"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://wg25dg65ksgg" path="res://src/map/dungeon/DungeonGenerator.tscn" id="1_eapuk"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dhpwwqow1ahrc" path="res://src/map/dungeon/rooms/Room1.tscn" id="2_x112h"]
|
||||||
|
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="3_614ds"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bn4gslp2gk8ds" path="res://src/map/dungeon/corridor/Corridor.tscn" id="4_tex41"]
|
||||||
|
[ext_resource type="Script" path="res://src/character_controller_3d.gd" id="4_vtqs3"]
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ult2r"]
|
||||||
|
radius = 0.25
|
||||||
|
height = 0.5
|
||||||
|
|
||||||
|
[sub_resource type="Environment" id="Environment_3njg4"]
|
||||||
|
|
||||||
[node name="App" type="Node"]
|
[node name="App" type="Node"]
|
||||||
|
|
||||||
|
[node name="DungeonGenerator3D" parent="." instance=ExtResource("1_eapuk")]
|
||||||
|
|
||||||
|
[node name="RoomsContainer" type="Node3D" parent="DungeonGenerator3D"]
|
||||||
|
|
||||||
|
[node name="DungeonRoom3D_0" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("2_x112h")]
|
||||||
|
transform = Transform3D(1.19249e-08, 0, -1, 0, 1, 0, 1, 0, 1.19249e-08, 35, 0, 45)
|
||||||
|
script = ExtResource("3_614ds")
|
||||||
|
|
||||||
|
[node name="DungeonRoom3D_1" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("2_x112h")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -25, 0, 35)
|
||||||
|
script = ExtResource("3_614ds")
|
||||||
|
|
||||||
|
[node name="Corridor_2" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("4_tex41")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 25, 0, 45)
|
||||||
|
script = ExtResource("3_614ds")
|
||||||
|
|
||||||
|
[node name="Corridor_3" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("4_tex41")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 15, 0, 45)
|
||||||
|
script = ExtResource("3_614ds")
|
||||||
|
|
||||||
|
[node name="Corridor_4" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("4_tex41")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5, 0, 45)
|
||||||
|
script = ExtResource("3_614ds")
|
||||||
|
|
||||||
|
[node name="Corridor_5" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("4_tex41")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5, 0, 45)
|
||||||
|
script = ExtResource("3_614ds")
|
||||||
|
|
||||||
|
[node name="Corridor_6" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("4_tex41")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -15, 0, 45)
|
||||||
|
script = ExtResource("3_614ds")
|
||||||
|
|
||||||
|
[node name="Corridor_7" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("4_tex41")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -25, 0, 45)
|
||||||
|
script = ExtResource("3_614ds")
|
||||||
|
|
||||||
|
[node name="Corridor_8" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("4_tex41")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 45, 0, 45)
|
||||||
|
script = ExtResource("3_614ds")
|
||||||
|
|
||||||
|
[node name="Corridor_9" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("4_tex41")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -25, 0, 25)
|
||||||
|
script = ExtResource("3_614ds")
|
||||||
|
|
||||||
|
[node name="Corridor_10" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("4_tex41")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -15, 0, 25)
|
||||||
|
script = ExtResource("3_614ds")
|
||||||
|
|
||||||
|
[node name="Corridor_11" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("4_tex41")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5, 0, 25)
|
||||||
|
script = ExtResource("3_614ds")
|
||||||
|
|
||||||
|
[node name="Corridor_12" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("4_tex41")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5, 0, 25)
|
||||||
|
script = ExtResource("3_614ds")
|
||||||
|
|
||||||
|
[node name="Corridor_13" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("4_tex41")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5, 0, 35)
|
||||||
|
script = ExtResource("3_614ds")
|
||||||
|
|
||||||
|
[node name="CharacterBody3D" type="CharacterBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14.0223, -3.8587, -16.1332)
|
||||||
|
script = ExtResource("4_vtqs3")
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="CharacterBody3D"]
|
||||||
|
shape = SubResource("CapsuleShape3D_ult2r")
|
||||||
|
|
||||||
|
[node name="OmniLight3D" type="OmniLight3D" parent="CharacterBody3D"]
|
||||||
|
|
||||||
|
[node name="Camera3D" type="Camera3D" parent="CharacterBody3D"]
|
||||||
|
|
||||||
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||||
|
environment = SubResource("Environment_3njg4")
|
||||||
|
|||||||
53
src/character_controller_3d.gd
Normal file
53
src/character_controller_3d.gd
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
extends CharacterBody3D
|
||||||
|
|
||||||
|
@export var FORWARD_SPEED = 2.0
|
||||||
|
@export var BACK_SPEED = 1.0
|
||||||
|
@export var TURN_SPEED = 0.025
|
||||||
|
|
||||||
|
var Vec3Z = Vector3.ZERO
|
||||||
|
|
||||||
|
#OPTIONAL: These could be used to change sensitivity of either rotating z or y
|
||||||
|
#var M_LOOK_SENS = 1
|
||||||
|
#var V_LOOK_SENS = 1
|
||||||
|
|
||||||
|
func _physics_process(delta: float) -> void:
|
||||||
|
if Input.is_action_pressed("move_forward") and Input.is_action_pressed("move_backward"):
|
||||||
|
velocity.x = 0
|
||||||
|
velocity.z = 0
|
||||||
|
|
||||||
|
elif Input.is_action_pressed("move_forward"):
|
||||||
|
var forwardVector = -Vector3.FORWARD.rotated(Vector3.UP, rotation.y)
|
||||||
|
velocity = -forwardVector * FORWARD_SPEED
|
||||||
|
|
||||||
|
elif Input.is_action_pressed("move_backward"):
|
||||||
|
var backwardVector = Vector3.FORWARD.rotated(Vector3.UP, rotation.y)
|
||||||
|
velocity = -backwardVector * BACK_SPEED
|
||||||
|
|
||||||
|
#If pressing nothing stop velocity
|
||||||
|
else:
|
||||||
|
velocity.x = 0
|
||||||
|
velocity.z = 0
|
||||||
|
|
||||||
|
# IF turn left WHILE moving back, turn right
|
||||||
|
if Input.is_action_pressed("move_left") and Input.is_action_pressed("move_backward"):
|
||||||
|
rotation.z -= Vec3Z.y + TURN_SPEED #* V_LOOK_SENS
|
||||||
|
rotation.z = clamp(rotation.x, -50, 90)
|
||||||
|
rotation.y -= Vec3Z.y + TURN_SPEED #* M_LOOK_SENS
|
||||||
|
|
||||||
|
elif Input.is_action_pressed("move_left"):
|
||||||
|
rotation.z += Vec3Z.y - TURN_SPEED #* V_LOOK_SENS
|
||||||
|
rotation.z = clamp(rotation.x, -50, 90)
|
||||||
|
rotation.y += Vec3Z.y + TURN_SPEED #* M_LOOK_SENS
|
||||||
|
|
||||||
|
# IF turn right WHILE moving back, turn left
|
||||||
|
if Input.is_action_pressed("move_right") and Input.is_action_pressed("move_backward"):
|
||||||
|
rotation.z += Vec3Z.y - TURN_SPEED #* V_LOOK_SENS
|
||||||
|
rotation.z = clamp(rotation.x, -50, 90)
|
||||||
|
rotation.y += Vec3Z.y + TURN_SPEED #* M_LOOK_SENS
|
||||||
|
|
||||||
|
elif Input.is_action_pressed("move_right"):
|
||||||
|
rotation.z -= Vec3Z.y + TURN_SPEED #* V_LOOK_SENS
|
||||||
|
rotation.z = clamp(rotation.x, -50, 90)
|
||||||
|
rotation.y -= Vec3Z.y + TURN_SPEED #* M_LOOK_SENS
|
||||||
|
|
||||||
|
move_and_slide()
|
||||||
11
src/map/dungeon/DungeonGenerator.tscn
Normal file
11
src/map/dungeon/DungeonGenerator.tscn
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[gd_scene load_steps=4 format=3 uid="uid://wg25dg65ksgg"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonGenerator3D.gd" id="1_l4et8"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dhpwwqow1ahrc" path="res://src/map/dungeon/rooms/Room1.tscn" id="2_tghss"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bn4gslp2gk8ds" path="res://src/map/dungeon/corridor/Corridor.tscn" id="3_ujbm3"]
|
||||||
|
|
||||||
|
[node name="DungeonGenerator3D" type="Node3D"]
|
||||||
|
script = ExtResource("1_l4et8")
|
||||||
|
room_scenes = Array[PackedScene]([ExtResource("2_tghss")])
|
||||||
|
corridor_room_scene = ExtResource("3_ujbm3")
|
||||||
|
dungeon_size = Vector3i(10, 1, 10)
|
||||||
59
src/map/dungeon/corridor/Corridor.tscn
Normal file
59
src/map/dungeon/corridor/Corridor.tscn
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
[gd_scene load_steps=12 format=3 uid="uid://bn4gslp2gk8ds"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_y0rqi"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://n4ds85jp0aq0" path="res://src/map/dungeon/textures/map_ceiling.jpg" id="2_6scux"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://ckaw6wjmi0fom" path="res://src/map/dungeon/door/Door.tscn" id="2_vpnlr"]
|
||||||
|
[ext_resource type="Script" path="res://src/map/dungeon/corridor/remove_unused_doors.gd" id="3_8i1ij"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bidlc5a6lft6" path="res://src/map/dungeon/textures/map_brickwall.jpg" id="4_6qf87"]
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_nsah4"]
|
||||||
|
transparency = 1
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_18cgv"]
|
||||||
|
albedo_texture = ExtResource("2_6scux")
|
||||||
|
uv1_scale = Vector3(0.23, 0.23, 0.23)
|
||||||
|
uv1_triplanar = true
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_cquyy"]
|
||||||
|
albedo_texture = ExtResource("4_6qf87")
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_67t3u"]
|
||||||
|
albedo_texture = ExtResource("4_6qf87")
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ej8w2"]
|
||||||
|
albedo_texture = ExtResource("4_6qf87")
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_oy7nu"]
|
||||||
|
albedo_texture = ExtResource("4_6qf87")
|
||||||
|
|
||||||
|
[node name="Corridor" type="Node3D"]
|
||||||
|
script = ExtResource("1_y0rqi")
|
||||||
|
|
||||||
|
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(10, 10, 10)
|
||||||
|
material = SubResource("StandardMaterial3D_nsah4")
|
||||||
|
|
||||||
|
[node name="CSGBox3D" type="CSGBox3D" parent="CSGBox3D"]
|
||||||
|
operation = 2
|
||||||
|
size = Vector3(9, 9, 9)
|
||||||
|
material = SubResource("StandardMaterial3D_18cgv")
|
||||||
|
|
||||||
|
[node name="DOOR?" parent="CSGBox3D" instance=ExtResource("2_vpnlr")]
|
||||||
|
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -5, -3.5, 0)
|
||||||
|
material = SubResource("StandardMaterial3D_cquyy")
|
||||||
|
|
||||||
|
[node name="DOOR?3" parent="CSGBox3D" instance=ExtResource("2_vpnlr")]
|
||||||
|
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 5, -3.5, 0)
|
||||||
|
material = SubResource("StandardMaterial3D_67t3u")
|
||||||
|
|
||||||
|
[node name="DOOR?4" parent="CSGBox3D" instance=ExtResource("2_vpnlr")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.5, 5)
|
||||||
|
material = SubResource("StandardMaterial3D_ej8w2")
|
||||||
|
|
||||||
|
[node name="DOOR?2" parent="CSGBox3D" instance=ExtResource("2_vpnlr")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.5, -5)
|
||||||
|
material = SubResource("StandardMaterial3D_oy7nu")
|
||||||
|
|
||||||
|
[node name="RemoveUnusedDoors" type="Node" parent="."]
|
||||||
|
script = ExtResource("3_8i1ij")
|
||||||
11
src/map/dungeon/corridor/remove_unused_doors.gd
Normal file
11
src/map/dungeon/corridor/remove_unused_doors.gd
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
$"..".connect("dungeon_done_generating", remove_unused_doors)
|
||||||
|
|
||||||
|
func remove_unused_doors():
|
||||||
|
for door in $"..".get_doors():
|
||||||
|
if door.get_room_leads_to() == null:
|
||||||
|
door.door_node.queue_free()
|
||||||
6
src/map/dungeon/door/Door.tscn
Normal file
6
src/map/dungeon/door/Door.tscn
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[gd_scene format=3 uid="uid://ckaw6wjmi0fom"]
|
||||||
|
|
||||||
|
[node name="DOOR" type="CSGBox3D"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.01493, 0)
|
||||||
|
operation = 2
|
||||||
|
size = Vector3(2, 2, 1)
|
||||||
30
src/map/dungeon/rooms/Room1.tscn
Normal file
30
src/map/dungeon/rooms/Room1.tscn
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
[gd_scene load_steps=5 format=3 uid="uid://dhpwwqow1ahrc"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_0tfda"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://ckaw6wjmi0fom" path="res://src/map/dungeon/door/Door.tscn" id="2_mdawx"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bidlc5a6lft6" path="res://src/map/dungeon/textures/map_brickwall.jpg" id="2_rw3uc"]
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_gt3ar"]
|
||||||
|
albedo_texture = ExtResource("2_rw3uc")
|
||||||
|
uv1_scale = Vector3(0.105, 0.105, 0.105)
|
||||||
|
uv1_triplanar = true
|
||||||
|
|
||||||
|
[node name="DungeonRoom3D" type="Node3D"]
|
||||||
|
script = ExtResource("1_0tfda")
|
||||||
|
|
||||||
|
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||||
|
material_override = SubResource("StandardMaterial3D_gt3ar")
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(10, 10, 10)
|
||||||
|
|
||||||
|
[node name="CSGBox3D2" type="CSGBox3D" parent="CSGBox3D"]
|
||||||
|
material_override = SubResource("StandardMaterial3D_gt3ar")
|
||||||
|
operation = 2
|
||||||
|
use_collision = true
|
||||||
|
size = Vector3(9, 9, 9)
|
||||||
|
|
||||||
|
[node name="DOOR" parent="CSGBox3D" instance=ExtResource("2_mdawx")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.47376, 4.74571)
|
||||||
|
|
||||||
|
[node name="DOOR2" parent="CSGBox3D" instance=ExtResource("2_mdawx")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.51619, -4.73548)
|
||||||
6
src/map/dungeon/rooms/Room2.tscn
Normal file
6
src/map/dungeon/rooms/Room2.tscn
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://baddk1soq2ske"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_o02dd"]
|
||||||
|
|
||||||
|
[node name="DungeonRoom3D" type="Node3D"]
|
||||||
|
script = ExtResource("1_o02dd")
|
||||||
BIN
src/map/dungeon/textures/map_brickwall.jpg
Normal file
BIN
src/map/dungeon/textures/map_brickwall.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
35
src/map/dungeon/textures/map_brickwall.jpg.import
Normal file
35
src/map/dungeon/textures/map_brickwall.jpg.import
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://bidlc5a6lft6"
|
||||||
|
path.s3tc="res://.godot/imported/map_brickwall.jpg-769eb620c593a0c2aec11a51d3375aec.s3tc.ctex"
|
||||||
|
metadata={
|
||||||
|
"imported_formats": ["s3tc_bptc"],
|
||||||
|
"vram_texture": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://src/map/dungeon/textures/map_brickwall.jpg"
|
||||||
|
dest_files=["res://.godot/imported/map_brickwall.jpg-769eb620c593a0c2aec11a51d3375aec.s3tc.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=2
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=true
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=0
|
||||||
BIN
src/map/dungeon/textures/map_ceiling.jpg
Normal file
BIN
src/map/dungeon/textures/map_ceiling.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
35
src/map/dungeon/textures/map_ceiling.jpg.import
Normal file
35
src/map/dungeon/textures/map_ceiling.jpg.import
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://n4ds85jp0aq0"
|
||||||
|
path.s3tc="res://.godot/imported/map_ceiling.jpg-206aba6e11eacf4f5f6696b3ba8e351a.s3tc.ctex"
|
||||||
|
metadata={
|
||||||
|
"imported_formats": ["s3tc_bptc"],
|
||||||
|
"vram_texture": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://src/map/dungeon/textures/map_ceiling.jpg"
|
||||||
|
dest_files=["res://.godot/imported/map_ceiling.jpg-206aba6e11eacf4f5f6696b3ba8e351a.s3tc.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=2
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=true
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=0
|
||||||
Reference in New Issue
Block a user