A dungeon delver roguelike using Pathfinder 2nd edition rules
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Forgot there was a different branch for g3n

+686 -109
+4
.editorconfig
··· 1 + root = true 2 + 3 + [*] 4 + charset = utf-8
+2
.gitattributes
··· 1 + # Normalize EOL for all files that Git considers text files. 2 + * text=auto eol=lf
+21
.gitignore
··· 1 + # Created by https://www.toptal.com/developers/gitignore/api/godot 2 + # Edit at https://www.toptal.com/developers/gitignore?templates=godot 3 + 4 + ### Godot ### 5 + # Godot 4+ specific ignores 6 + .godot/ 7 + 8 + # Godot-specific ignores 9 + .import/ 10 + export.cfg 11 + export_presets.cfg 12 + 13 + # Imported translations (automatically generated from CSV files) 14 + *.translation 15 + 16 + # Mono-specific ignores 17 + .mono/ 18 + data_*/ 19 + mono_crash.*.json 20 + 21 + # End of https://www.toptal.com/developers/gitignore/api/godot
+94
CharacterMarker.tscn
··· 1 + [gd_scene load_steps=6 format=3 uid="uid://ckavyyqwj6peh"] 2 + 3 + [sub_resource type="Shader" id="Shader_5ayyv"] 4 + code = "// NOTE: Shader automatically converted from Godot Engine 4.4.1.stable's StandardMaterial3D. 5 + 6 + shader_type spatial; 7 + render_mode blend_mix, depth_draw_opaque, cull_disabled, diffuse_burley, specular_schlick_ggx; 8 + 9 + uniform vec4 albedo : source_color; 10 + uniform sampler2D texture_albedo : source_color, filter_linear_mipmap, repeat_enable; 11 + uniform ivec2 albedo_texture_size; 12 + uniform float point_size : hint_range(0.1, 128.0, 0.1); 13 + 14 + uniform float roughness : hint_range(0.0, 1.0); 15 + uniform sampler2D texture_metallic : hint_default_white, filter_linear_mipmap, repeat_enable; 16 + uniform vec4 metallic_texture_channel; 17 + uniform sampler2D texture_roughness : hint_roughness_r, filter_linear_mipmap, repeat_enable; 18 + 19 + uniform float specular : hint_range(0.0, 1.0, 0.01); 20 + uniform float metallic : hint_range(0.0, 1.0, 0.01); 21 + 22 + uniform sampler2D texture_emission : source_color, hint_default_black, filter_linear_mipmap, repeat_enable; 23 + uniform vec4 emission : source_color; 24 + uniform float emission_energy : hint_range(0.0, 100.0, 0.01); 25 + 26 + uniform vec3 uv1_scale; 27 + uniform vec3 uv1_offset; 28 + uniform vec3 uv2_scale; 29 + uniform vec3 uv2_offset; 30 + 31 + void vertex() { 32 + UV = UV * uv1_scale.xy + uv1_offset.xy; 33 + float x = UV.x; 34 + float y = UV.y; 35 + UV.x = y; 36 + UV.y = x; 37 + } 38 + 39 + void fragment() { 40 + vec2 base_uv = UV; 41 + 42 + vec4 albedo_tex = texture(texture_albedo, base_uv); 43 + ALBEDO = albedo.rgb * albedo_tex.rgb; 44 + 45 + float metallic_tex = dot(texture(texture_metallic, base_uv), metallic_texture_channel); 46 + METALLIC = metallic_tex * metallic; 47 + SPECULAR = specular; 48 + 49 + vec4 roughness_texture_channel = vec4(1.0, 0.0, 0.0, 0.0); 50 + float roughness_tex = dot(texture(texture_roughness, base_uv), roughness_texture_channel); 51 + ROUGHNESS = roughness_tex * roughness; 52 + 53 + // Emission: Enabled 54 + vec3 emission_tex = texture(texture_emission, base_uv).rgb; 55 + // Emission Operator: Add 56 + EMISSION = (emission.rgb + emission_tex) * emission_energy; 57 + ALPHA *= albedo.a * albedo_tex.a; 58 + } 59 + " 60 + 61 + [sub_resource type="Gradient" id="Gradient_42hn3"] 62 + colors = PackedColorArray(0, 0, 0, 0, 0, 0, 0, 1) 63 + 64 + [sub_resource type="GradientTexture1D" id="GradientTexture1D_4runf"] 65 + gradient = SubResource("Gradient_42hn3") 66 + 67 + [sub_resource type="ShaderMaterial" id="ShaderMaterial_qul5y"] 68 + render_priority = 0 69 + shader = SubResource("Shader_5ayyv") 70 + shader_parameter/albedo = Color(0, 0, 0, 1) 71 + shader_parameter/texture_albedo = SubResource("GradientTexture1D_4runf") 72 + shader_parameter/albedo_texture_size = Vector2i(256, 1) 73 + shader_parameter/point_size = 1.0 74 + shader_parameter/roughness = 1.0 75 + shader_parameter/metallic_texture_channel = Vector4(1, 0, 0, 0) 76 + shader_parameter/specular = 0.5 77 + shader_parameter/metallic = 0.0 78 + shader_parameter/emission = Color(0, 0, 0, 1) 79 + shader_parameter/emission_energy = 1.0 80 + shader_parameter/uv1_scale = Vector3(1, 1, 1) 81 + shader_parameter/uv1_offset = Vector3(0, 0, 0) 82 + shader_parameter/uv2_scale = Vector3(1, 1, 1) 83 + shader_parameter/uv2_offset = Vector3(0, 0, 0) 84 + 85 + [sub_resource type="CylinderMesh" id="CylinderMesh_qul5y"] 86 + material = SubResource("ShaderMaterial_qul5y") 87 + cap_top = false 88 + cap_bottom = false 89 + 90 + [node name="CharacterMarker" type="Node3D"] 91 + 92 + [node name="MeshInstance3D" type="MeshInstance3D" parent="."] 93 + transform = Transform3D(1, 0, 0, 0, 0.183774, 0, 0, 0, 1, 0, 0.189356, 0) 94 + mesh = SubResource("CylinderMesh_qul5y")
+21
LICENSE
··· 1 + MIT License 2 + 3 + Copyright (c) 2024 skeetcha 4 + 5 + Permission is hereby granted, free of charge, to any person obtaining a copy 6 + of this software and associated documentation files (the "Software"), to deal 7 + in the Software without restriction, including without limitation the rights 8 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 + copies of the Software, and to permit persons to whom the Software is 10 + furnished to do so, subject to the following conditions: 11 + 12 + The above copyright notice and this permission notice shall be included in all 13 + copies or substantial portions of the Software. 14 + 15 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 + SOFTWARE.
+1
addons/.gitignore
··· 1 + */
+181
camera/camera.gd
··· 1 + extends Node3D 2 + 3 + @export_group("Movement variables") 4 + @export var move_speed: float = 2.0 5 + @export var rotate_speed: float = 2.0 6 + @export var zoom_speed: float = 2.0 7 + 8 + @export_group("Movement ADSR variables") 9 + @export_subgroup("Move") 10 + @export var attack_move_time: float = 0.2 11 + @export var decay_move_time: float = 0.01 12 + @export var sustain_move_percent: float = 1.0 13 + @export var release_move_time: float = 0.2 14 + @export_subgroup("Rotate") 15 + @export var attack_rotate_time: float = 0.2 16 + @export var decay_rotate_time: float = 0.01 17 + @export var sustain_rotate_percent: float = 1.0 18 + @export var release_rotate_time: float = 0.2 19 + 20 + var left_right_pressed_time: float = 0.0 21 + var left_right_released_time: float = 0.0 22 + var up_down_pressed_time: float = 0.0 23 + var up_down_released_time: float = 0.0 24 + var rotate_pressed_time: float = 0.0 25 + var rotate_released_time: float = 0.0 26 + var move_dir: Vector3 = Vector3.ZERO 27 + var move_direction: Vector3 28 + var rotate_direction: float = 0.0 29 + var zoom_percent: float = 0.5 30 + 31 + var selected_character: GameCharacter 32 + var character_marker: Node3D 33 + 34 + func _physics_process(delta: float) -> void: 35 + if Input.is_action_just_pressed("Right") or Input.is_action_just_pressed("Left"): 36 + left_right_pressed_time = Time.get_unix_time_from_system() 37 + left_right_released_time = -1.0 38 + move_dir.x = Input.get_action_strength("Right") - Input.get_action_strength("Left") 39 + 40 + if Input.is_action_just_released("Right") or Input.is_action_just_released("Left"): 41 + left_right_released_time = Time.get_unix_time_from_system() 42 + 43 + if Input.is_action_just_pressed("Up") or Input.is_action_just_pressed("Down"): 44 + up_down_pressed_time = Time.get_unix_time_from_system() 45 + up_down_released_time = -1.0 46 + move_dir.z = Input.get_action_strength("Down") - Input.get_action_strength("Up") 47 + 48 + if Input.is_action_just_released("Up") or Input.is_action_just_released("Down"): 49 + up_down_released_time = Time.get_unix_time_from_system() 50 + 51 + if Input.is_action_just_pressed("RotateLeft") or Input.is_action_just_pressed("RotateRight"): 52 + rotate_pressed_time = Time.get_unix_time_from_system() 53 + rotate_released_time = -1.0 54 + 55 + if Input.is_action_just_pressed("RotateLeft"): 56 + rotate_direction -= 1.0 57 + 58 + if Input.is_action_just_pressed("RotateRight"): 59 + rotate_direction += 1.0 60 + 61 + if Input.is_action_just_released("RotateLeft") or Input.is_action_just_released("RotateRight"): 62 + rotate_released_time = Time.get_unix_time_from_system() 63 + 64 + move_direction = Vector3.ZERO 65 + 66 + var left_right_adsr = adsr(attack_move_time, decay_move_time, sustain_move_percent, release_move_time, Input.is_action_pressed("Right") or Input.is_action_pressed("Left"), Time.get_unix_time_from_system(), left_right_pressed_time, left_right_released_time) 67 + var up_down_adsr = adsr(attack_move_time, decay_move_time, sustain_move_percent, release_move_time, Input.is_action_pressed("Up") or Input.is_action_pressed("Down"), Time.get_unix_time_from_system(), up_down_pressed_time, up_down_released_time) 68 + var rotate_adsr = adsr(attack_rotate_time, decay_rotate_time, sustain_rotate_percent, release_rotate_time, Input.is_action_pressed("RotateLeft") or Input.is_action_pressed("RotateRight"), Time.get_unix_time_from_system(), rotate_pressed_time, rotate_released_time) 69 + 70 + move_direction.x = (Input.get_action_strength("Right") - Input.get_action_strength("Left")) * left_right_adsr 71 + move_direction.z = (Input.get_action_strength("Down") - Input.get_action_strength("Up")) * up_down_adsr 72 + 73 + move_direction *= move_speed 74 + 75 + var old_rotation: float = global_rotation_degrees.y 76 + move_direction = move_direction.rotated(Vector3.UP, deg_to_rad(old_rotation)) 77 + var changed: bool = false 78 + 79 + if move_direction.x == 0.0: 80 + move_direction.x = move_speed * left_right_adsr * move_dir.x 81 + changed = true 82 + 83 + if move_direction.x == 0.0: 84 + move_dir.x = 0.0 85 + 86 + if move_direction.z == 0.0: 87 + move_direction.z = move_speed * up_down_adsr * move_dir.z 88 + changed = true 89 + 90 + if move_direction.z == 0.0: 91 + move_dir.z = 0.0 92 + 93 + if changed: 94 + move_direction = move_direction.rotated(Vector3.UP, deg_to_rad(old_rotation)) 95 + 96 + global_translate(move_direction) 97 + rotate(Vector3.UP, rotate_direction * rotate_speed * rotate_adsr) 98 + 99 + if rotate_adsr == 0.0: 100 + rotate_direction = 0.0 101 + 102 + if Input.is_action_just_pressed("Select"): 103 + if character_marker: 104 + character_marker.queue_free() 105 + 106 + var mouse_pos = get_viewport().get_mouse_position() 107 + var from = $"Path3D/PathFollow3D/SpringArm3D/Camera3D".project_ray_origin(mouse_pos) 108 + var to = from + $"Path3D/PathFollow3D/SpringArm3D/Camera3D".project_ray_normal(mouse_pos) * 1000.0 109 + var space_state = get_world_3d().direct_space_state 110 + var query = PhysicsRayQueryParameters3D.create(from, to) 111 + var result = space_state.intersect_ray(query) 112 + 113 + if result: 114 + if result.collider is GameCharacter: 115 + if selected_character: 116 + selected_character.is_selected = false 117 + 118 + selected_character = result.collider 119 + selected_character.is_selected = true 120 + else: 121 + if selected_character: 122 + selected_character.target_position = result.position 123 + selected_character.state = GameCharacter.State.STATE_TARGET 124 + character_marker = load("res://CharacterMarker.tscn").instantiate() 125 + var marker_position: Vector3 = result.position 126 + marker_position.y = 0.0 127 + $"..".add_child(character_marker) 128 + character_marker.global_scale(Vector3(0.61, 0.61, 0.61)) 129 + character_marker.global_translate(marker_position) 130 + 131 + $Path3D/PathFollow3D.progress = zoom_percent 132 + 133 + func _unhandled_input(event: InputEvent) -> void: 134 + if event is InputEventMouseButton: 135 + var emb: InputEventMouseButton = event 136 + 137 + if emb.is_pressed(): 138 + if emb.button_index == int(MOUSE_BUTTON_WHEEL_UP): 139 + zoom_percent = clamp(zoom_percent - (zoom_speed / 40.0), 0.0, 1.0) 140 + 141 + if emb.button_index == int(MOUSE_BUTTON_WHEEL_DOWN): 142 + zoom_percent = clamp(zoom_percent + (zoom_speed / 40.0), 0.0, 1.0) 143 + 144 + func adsr(attack: float, decay: float, sustain: float, release: float, held: bool, time: float, pressed: float, released: float) -> float: 145 + var p: float 146 + var r: float 147 + 148 + if (time - pressed) > 1000.0: 149 + p = 0.0 150 + else: 151 + 152 + p = min(round((time - pressed) * 100) / 100, attack) 153 + if (time - released) > 1000.0: 154 + r = 0.0 155 + else: 156 + r = min(round((time - released) * 100) / 100, release) 157 + 158 + if held: 159 + var t = time - pressed 160 + 161 + if t < attack: 162 + return t / attack 163 + elif t < (attack + decay): 164 + var d = (t - attack) / decay 165 + return 1.0 - d * (1.0 - sustain) 166 + else: 167 + return sustain 168 + else: 169 + if released < 0: 170 + return 0.0 171 + 172 + var t = time - released 173 + 174 + if t < release: 175 + return sustain * (1.0 - t / release) 176 + else: 177 + return 0.0 178 + 179 + 180 + func _on_character_done_moving() -> void: 181 + character_marker.queue_free()
+1
camera/camera.gd.uid
··· 1 + uid://dvrq0yxv1wk2x
+30
camera/camera.tscn
··· 1 + [gd_scene load_steps=3 format=3 uid="uid://bby3edcc724cg"] 2 + 3 + [ext_resource type="Script" uid="uid://dvrq0yxv1wk2x" path="res://camera/camera.gd" id="1_lw1ob"] 4 + 5 + [sub_resource type="Curve3D" id="Curve3D_lw1ob"] 6 + _data = { 7 + "points": PackedVector3Array(0, 0, 0, 0, -0.17, 1.015, 0, 0, 0, 0, -0.67, 0, 0, 0, 0, 0, 2.17585, 2.40763), 8 + "tilts": PackedFloat32Array(0, 0) 9 + } 10 + point_count = 2 11 + 12 + [node name="Camera" type="Node3D"] 13 + script = ExtResource("1_lw1ob") 14 + move_speed = 0.5 15 + rotate_speed = 1.0 16 + attack_move_time = 0.5 17 + release_move_time = 0.5 18 + 19 + [node name="Path3D" type="Path3D" parent="."] 20 + curve = SubResource("Curve3D_lw1ob") 21 + 22 + [node name="PathFollow3D" type="PathFollow3D" parent="Path3D"] 23 + transform = Transform3D(-1, 1.44411e-08, -8.62217e-08, 0, 0.986261, 0.165187, 8.74228e-08, 0.165187, -0.986261, 0, 0, 0) 24 + 25 + [node name="SpringArm3D" type="SpringArm3D" parent="Path3D/PathFollow3D"] 26 + transform = Transform3D(-1, 0, 8.74228e-08, 1.44411e-08, 0.986262, 0.165187, -8.62218e-08, 0.165187, -0.986262, 9.5144e-08, 0.179776, -1.07337) 27 + spring_length = 1.9 28 + margin = 0.04 29 + 30 + [node name="Camera3D" type="Camera3D" parent="Path3D/PathFollow3D/SpringArm3D"]
-2
characters/character_material.tres
··· 22 22 shader_parameter/color_ramp3 = ExtResource("3_bpphy") 23 23 shader_parameter/outline_color = Color(0, 1, 0, 1) 24 24 shader_parameter/outline_factor = 0.315 25 - shader_parameter/player_pos = Vector3(0, 0, 0) 26 - shader_parameter/camera_pos = Vector3(0, 0, 0)
+126
dungeon.gd
··· 1 + class_name Dungeon 2 + 3 + extends Node 4 + 5 + @export var grid: PackedByteArray = [] 6 + @export var width: int = 6 7 + @export var height: int = 6 8 + @export var entrance: int = -1 9 + @export var init: bool = false 10 + @export var currentRoom: int = -1 11 + 12 + const BitUsedRoom: int = 0x01 13 + const BitEntrance: int = 0x02 14 + const BitDoorNorth: int = 0x04 15 + const BitDoorEast: int = 0x08 16 + const BitDoorSouth: int = 0x10 17 + const BitDoorWest: int = 0x20 18 + const BitStairBelow: int = 0x40 19 + const BitStairUp: int = 0x80 20 + 21 + const Neighbors: int = BitDoorNorth | BitDoorEast | BitDoorSouth | BitDoorWest 22 + 23 + var rng: RandomNumberGenerator = RandomNumberGenerator.new() 24 + 25 + func _ready() -> void: 26 + if init: 27 + generate() 28 + currentRoom = entrance 29 + var nextScene: Node3D = preload("res://dungeonRoom/dungeonRoom.tscn").instantiate() 30 + get_node("/root/Main").call_deferred("add_child", nextScene) 31 + 32 + func fillArray(r: Array, size: int): 33 + for i in range(size): 34 + r.append(0) 35 + 36 + func fillByteArray(r: PackedByteArray, size: int): 37 + for i in range(size): 38 + r.append(0) 39 + 40 + func generate(): 41 + var dungeonArea: int = width * height 42 + fillByteArray(grid, dungeonArea) 43 + var generatedCellsNum: int = 0 44 + var generatedCells: Array[int] 45 + fillArray(generatedCells, dungeonArea) 46 + var i = 0 47 + 48 + while ((generatedCellsNum < dungeonArea) and ((i == 0) or (i < generatedCellsNum))): 49 + if (i == 0) and (generatedCellsNum == 0): 50 + entrance = rng.randi_range(0, dungeonArea - 1) 51 + generatedCells[0] = entrance 52 + grid[entrance] = BitEntrance | BitUsedRoom 53 + generatedCellsNum = 1 54 + 55 + var generatedCellsRef: Array[int] = [generatedCellsNum] 56 + generateRoom(i, generatedCells, generatedCellsRef) 57 + generatedCellsNum = generatedCellsRef[0] 58 + 59 + if !(grid[generatedCells[i]] & BitUsedRoom): 60 + grid[generatedCells[i]] |= BitUsedRoom 61 + 62 + if (i == (generatedCellsNum - 1)) and (generatedCellsNum < (dungeonArea * 0.75)): 63 + i = -1 64 + 65 + i += 1 66 + 67 + func generateRoom(cellIndexQueue: int, cellsQueue: Array[int], queueSize: Array[int]) -> void: 68 + var potentialDoors: int = rng.randi_range(0, Neighbors - 1) 69 + var cellIndex: int = cellsQueue[cellIndexQueue] 70 + 71 + var door: int = 1 72 + var oppositeDoor: int 73 + 74 + while door <= Neighbors: 75 + if ((door & Neighbors) != door) or (grid[cellIndex] & door): 76 + door <<= 1 77 + continue 78 + 79 + var neighborRoom: int = getNeighborRoomIndex(cellIndex, door) 80 + 81 + if (!~neighborRoom) or (grid[neighborRoom] & BitUsedRoom): 82 + door <<= 1 83 + continue 84 + 85 + oppositeDoor = getOppositeDirectionBit(door) 86 + 87 + if (door & potentialDoors) == door: 88 + grid[cellIndex] |= door 89 + grid[neighborRoom] |= oppositeDoor 90 + 91 + if grid[neighborRoom] == oppositeDoor: 92 + cellsQueue[queueSize[0]] = neighborRoom 93 + queueSize[0] += 1 94 + 95 + door <<= 1 96 + 97 + func getNeighborRoomIndex(currRoom: int, direction: int) -> int: 98 + var neighborRoom: int 99 + 100 + if direction == BitDoorNorth: 101 + neighborRoom = currRoom - width 102 + elif direction == BitDoorEast: 103 + neighborRoom = currRoom + 1 104 + elif direction == BitDoorSouth: 105 + neighborRoom = currRoom + width 106 + elif direction == BitDoorWest: 107 + neighborRoom = currRoom - 1 108 + 109 + if ((direction == BitDoorNorth) and (neighborRoom >= 0)) or ((direction == BitDoorSouth) and (neighborRoom < (width * height))) or ((direction == BitDoorEast) and ((neighborRoom % width) > 0)) or ((direction == BitDoorWest) and ((neighborRoom % width) < (width - 1))): 110 + return neighborRoom 111 + 112 + return -1 113 + 114 + func getOppositeDirectionBit(direction: int) -> int: 115 + var oppositeDirection: int = -1 116 + 117 + if direction == BitDoorNorth: 118 + oppositeDirection = BitDoorSouth 119 + elif direction == BitDoorEast: 120 + oppositeDirection = BitDoorWest 121 + elif direction == BitDoorSouth: 122 + oppositeDirection = BitDoorNorth 123 + elif direction == BitDoorWest: 124 + oppositeDirection = BitDoorEast 125 + 126 + return oppositeDirection
+1
dungeon.gd.uid
··· 1 + uid://bj1iov1sgi7bo
-12
go.mod
··· 1 - module tangled.org/cass.cityboundforest.com/dungeoner 2 - 3 - go 1.25.0 4 - 5 - require github.com/g3n/engine v0.2.0 6 - 7 - require ( 8 - github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb // indirect 9 - github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect 10 - golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9 // indirect 11 - gopkg.in/yaml.v2 v2.4.0 // indirect 12 - )
-14
go.sum
··· 1 - github.com/g3n/engine v0.2.0 h1:7dmj4c+3xHcBnYrVmRuVf/oZ2JycxJU9Y+2FQj1Af2Y= 2 - github.com/g3n/engine v0.2.0/go.mod h1:rnj8jiLdKEDI8VbveKhmdL4rovjjy+uxNP5YROg2x8g= 3 - github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb h1:T6gaWBvRzJjuOrdCtg8fXXjKai2xSDqWTcKFUPuw8Tw= 4 - github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 5 - github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= 6 - github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= 7 - golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9 h1:D0iM1dTCbD5Dg1CbuvLC/v/agLc79efSj/L35Q3Vqhs= 8 - golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= 9 - golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 10 - golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 11 - gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 12 - gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 13 - gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 14 - gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
+1
icon.svg
··· 1 + <svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
+37
icon.svg.import
··· 1 + [remap] 2 + 3 + importer="texture" 4 + type="CompressedTexture2D" 5 + uid="uid://c3gihvabedr76" 6 + path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" 7 + metadata={ 8 + "vram_texture": false 9 + } 10 + 11 + [deps] 12 + 13 + source_file="res://icon.svg" 14 + dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] 15 + 16 + [params] 17 + 18 + compress/mode=0 19 + compress/high_quality=false 20 + compress/lossy_quality=0.7 21 + compress/hdr_compression=1 22 + compress/normal_map=0 23 + compress/channel_pack=0 24 + mipmaps/generate=false 25 + mipmaps/limit=-1 26 + roughness/mode=0 27 + roughness/src_normal="" 28 + process/fix_alpha_border=true 29 + process/premult_alpha=false 30 + process/normal_map_invert_y=false 31 + process/hdr_as_srgb=false 32 + process/hdr_clamp_exposure=false 33 + process/size_limit=0 34 + detect_3d/compress_to=1 35 + svg/scale=1.0 36 + editor/scale_with_editor_scale=false 37 + editor/convert_colors_with_editor_theme=false
-81
main.go
··· 1 - package main 2 - 3 - import ( 4 - "time" 5 - 6 - "github.com/g3n/engine/app" 7 - "github.com/g3n/engine/camera" 8 - "github.com/g3n/engine/core" 9 - "github.com/g3n/engine/geometry" 10 - "github.com/g3n/engine/gls" 11 - "github.com/g3n/engine/graphic" 12 - "github.com/g3n/engine/gui" 13 - "github.com/g3n/engine/light" 14 - "github.com/g3n/engine/material" 15 - "github.com/g3n/engine/math32" 16 - "github.com/g3n/engine/renderer" 17 - "github.com/g3n/engine/util/helper" 18 - "github.com/g3n/engine/window" 19 - ) 20 - 21 - func main() { 22 - // Create the application and scene 23 - a := app.App() 24 - scene := core.NewNode() 25 - 26 - // Set the scene to be managed by the gui manager 27 - gui.Manager().Set(scene) 28 - 29 - // Create perspective camera 30 - cam := camera.New(1) 31 - cam.SetPosition(0, 0, 3) 32 - scene.Add(cam) 33 - 34 - // Set up orbit control for the camera 35 - camera.NewOrbitControl(cam) 36 - 37 - // Set up callback to update viewport and camera aspect ratio when the window is resized 38 - onResize := func(evname string, ev interface{}) { 39 - // Get framebuffer size and update viewport accordingly 40 - width, height := a.GetSize() 41 - a.Gls().Viewport(0, 0, int32(width), int32(height)) 42 - // Update the camera's aspect ratio 43 - cam.SetAspect(float32(width) / float32(height)) 44 - } 45 - 46 - a.Subscribe(window.OnWindowSize, onResize) 47 - onResize("", nil) 48 - 49 - // Create a blue torus and add it to the scene 50 - geom := geometry.NewTorus(1, 0.4, 12, 32, math32.Pi*2) 51 - mat := material.NewStandard(math32.NewColor("DarkBlue")) 52 - mesh := graphic.NewMesh(geom, mat) 53 - scene.Add(mesh) 54 - 55 - // Create and add a button to the scene 56 - btn := gui.NewButton("Make Red") 57 - btn.SetPosition(100, 40) 58 - btn.SetSize(40, 40) 59 - btn.Subscribe(gui.OnClick, func(name string, ev interface{}) { 60 - mat.SetColor(math32.NewColor("DarkRed")) 61 - }) 62 - scene.Add(btn) 63 - 64 - // Create and add lights to the scene 65 - scene.Add(light.NewAmbient(&math32.Color{1.0, 1.0, 1.0}, 0.8)) 66 - pointLight := light.NewPoint(&math32.Color{1, 1, 1}, 5.0) 67 - pointLight.SetPosition(1, 0, 2) 68 - scene.Add(pointLight) 69 - 70 - // Create and add an axis helper to the scene 71 - scene.Add(helper.NewAxes(0.5)) 72 - 73 - // Set background color to gray 74 - a.Gls().ClearColor(0.5, 0.5, 0.5, 1.0) 75 - 76 - // Run the application 77 - a.Run(func(renderer *renderer.Renderer, deltaTime time.Duration) { 78 - a.Gls().Clear(gls.DEPTH_BUFFER_BIT | gls.STENCIL_BUFFER_BIT | gls.COLOR_BUFFER_BIT) 79 - renderer.Render(scene, cam) 80 - }) 81 - }
+113
project.godot
··· 1 + ; Engine configuration file. 2 + ; It's best edited using the editor UI and not directly, 3 + ; since the parameters that go here are not all obvious. 4 + ; 5 + ; Format: 6 + ; [section] ; section goes between [] 7 + ; param=value ; assign values to parameters 8 + 9 + config_version=5 10 + 11 + [application] 12 + 13 + config/name="Pathdelver" 14 + run/main_scene="uid://dk700xxolt8x6" 15 + config/features=PackedStringArray("4.4", "Forward Plus") 16 + config/icon="res://icon.svg" 17 + 18 + [autoload] 19 + 20 + dungeon="*res://dungeon.gd" 21 + 22 + [editor] 23 + 24 + version_control/plugin_name="GitPlugin" 25 + version_control/autoload_on_startup=true 26 + 27 + [filesystem] 28 + 29 + import/blender/enabled=false 30 + 31 + [input] 32 + 33 + ui_left={ 34 + "deadzone": 0.5, 35 + "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":4194319,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) 36 + , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null) 37 + , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null) 38 + , 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":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null) 39 + ] 40 + } 41 + ui_right={ 42 + "deadzone": 0.5, 43 + "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":4194321,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) 44 + , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null) 45 + , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null) 46 + , 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":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null) 47 + ] 48 + } 49 + ui_up={ 50 + "deadzone": 0.5, 51 + "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":4194320,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) 52 + , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null) 53 + , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null) 54 + , 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":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null) 55 + ] 56 + } 57 + ui_down={ 58 + "deadzone": 0.5, 59 + "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":4194322,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) 60 + , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null) 61 + , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null) 62 + , 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":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null) 63 + ] 64 + } 65 + Left={ 66 + "deadzone": 0.2, 67 + "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":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null) 68 + , 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":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) 69 + , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null) 70 + , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":13,"pressure":0.0,"pressed":false,"script":null) 71 + ] 72 + } 73 + Right={ 74 + "deadzone": 0.2, 75 + "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":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null) 76 + , 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":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) 77 + , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null) 78 + , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":14,"pressure":0.0,"pressed":false,"script":null) 79 + ] 80 + } 81 + Up={ 82 + "deadzone": 0.2, 83 + "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":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null) 84 + , 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":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) 85 + , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":-1.0,"script":null) 86 + , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":11,"pressure":0.0,"pressed":false,"script":null) 87 + ] 88 + } 89 + Down={ 90 + "deadzone": 0.2, 91 + "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":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null) 92 + , 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":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) 93 + , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null) 94 + , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":12,"pressure":0.0,"pressed":false,"script":null) 95 + ] 96 + } 97 + RotateLeft={ 98 + "deadzone": 0.2, 99 + "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":81,"key_label":0,"unicode":113,"location":0,"echo":false,"script":null) 100 + , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":9,"pressure":0.0,"pressed":false,"script":null) 101 + ] 102 + } 103 + RotateRight={ 104 + "deadzone": 0.2, 105 + "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) 106 + , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":10,"pressure":0.0,"pressed":false,"script":null) 107 + ] 108 + } 109 + Select={ 110 + "deadzone": 0.2, 111 + "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(114, 33),"global_position":Vector2(128, 106),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null) 112 + ] 113 + }
+10
start/start.gd
··· 1 + extends Node 2 + 3 + 4 + func _on_new_game_pressed() -> void: 5 + dungeon.generate() 6 + dungeon.currentRoom = dungeon.entrance 7 + get_tree().change_scene_to_file("res://dungeonRoom/dungeonRoom.tscn") 8 + 9 + func _on_quit_pressed() -> void: 10 + get_tree().quit()
+1
start/start.gd.uid
··· 1 + uid://drdqx5u4ful3g
+42
start/start.tscn
··· 1 + [gd_scene load_steps=2 format=3 uid="uid://dk700xxolt8x6"] 2 + 3 + [ext_resource type="Script" uid="uid://drdqx5u4ful3g" path="res://start/start.gd" id="1_hdi1w"] 4 + 5 + [node name="Main" type="Control"] 6 + layout_mode = 3 7 + anchors_preset = 15 8 + anchor_right = 1.0 9 + anchor_bottom = 1.0 10 + grow_horizontal = 2 11 + grow_vertical = 2 12 + script = ExtResource("1_hdi1w") 13 + 14 + [node name="Title" type="Label" parent="."] 15 + layout_mode = 1 16 + anchors_preset = -1 17 + anchor_top = 0.285 18 + anchor_right = 1.0 19 + anchor_bottom = 0.32 20 + text = "Dungeoner" 21 + horizontal_alignment = 1 22 + 23 + [node name="New Game" type="Button" parent="."] 24 + layout_mode = 1 25 + anchors_preset = -1 26 + anchor_left = 0.232 27 + anchor_top = 0.345 28 + anchor_right = 0.768 29 + anchor_bottom = 0.393 30 + text = "New Game" 31 + 32 + [node name="Quit" type="Button" parent="."] 33 + layout_mode = 1 34 + anchors_preset = -1 35 + anchor_left = 0.232 36 + anchor_top = 0.418 37 + anchor_right = 0.768 38 + anchor_bottom = 0.418 39 + text = "Quit" 40 + 41 + [connection signal="pressed" from="New Game" to="." method="_on_new_game_pressed"] 42 + [connection signal="pressed" from="Quit" to="." method="_on_quit_pressed"]