much better field edit tool, camera specifically
This commit is contained in:
@@ -4,11 +4,11 @@ extends Node3D
|
||||
signal path_updated()
|
||||
|
||||
@export var data_file: FlowFieldData
|
||||
@export var flow_node_scene: PackedScene
|
||||
@export var start_points: Array[Node3D]
|
||||
@export var goal_points: Array[Node3D]
|
||||
@export var nodes_visible: bool = false
|
||||
|
||||
var flow_node_scene: PackedScene = preload("res://Scenes/FlowField/flow_node.tscn")
|
||||
var nodes: Array[FlowNode] = []
|
||||
var start_nodes: Array[FlowNode] = []
|
||||
var goal_nodes: Array[FlowNode] = []
|
||||
@@ -29,6 +29,9 @@ func load_from_data(data: FlowFieldData = data_file) -> void:
|
||||
var dict: Dictionary[FlowNodeData, FlowNode] = {}
|
||||
for node_data: FlowNodeData in data_file.nodes:
|
||||
var new_flow_node: FlowNode = create_node(node_data.position)
|
||||
new_flow_node.grid_id = node_data.grid_id
|
||||
new_flow_node.grid_x = node_data.grid_x
|
||||
new_flow_node.grid_y = node_data.grid_y
|
||||
new_flow_node.buildable = node_data.buildable
|
||||
dict[node_data] = new_flow_node
|
||||
nodes.append(new_flow_node)
|
||||
@@ -186,8 +189,11 @@ func toggle_buildable(node: FlowNode) -> void:
|
||||
node.buildable = !node.buildable
|
||||
|
||||
|
||||
func create_node(pos: Vector3 = Vector3.ZERO) -> FlowNode:
|
||||
func create_node(pos: Vector3 = Vector3.ZERO, grid_id: int = -1, grid_x: int = 0, grid_y: int = 0) -> FlowNode:
|
||||
var node: FlowNode = flow_node_scene.instantiate()
|
||||
node.grid_id = grid_id
|
||||
node.grid_x = grid_x
|
||||
node.grid_y = grid_y
|
||||
node.position = pos
|
||||
node.set_color(Color.WEB_GRAY)
|
||||
nodes.append(node)
|
||||
@@ -216,6 +222,8 @@ func disconnect_nodes(node1: FlowNode, node2: FlowNode) -> void:
|
||||
|
||||
|
||||
func create_grid(x_size: int, y_size: int, gap: float) -> void:
|
||||
data_file.grids += 1
|
||||
var grid_id: int = data_file.grids
|
||||
var grid: Array[Array] = []
|
||||
for x: int in x_size:
|
||||
var row: Array[FlowNode] = []
|
||||
@@ -224,7 +232,7 @@ func create_grid(x_size: int, y_size: int, gap: float) -> void:
|
||||
var point_position: Vector3 = Vector3((x - floori(x_size / 2.0)) * gap, 0, (y - floori(y_size / 2.0)) * gap)
|
||||
#point_position += global_position
|
||||
#row.append(create_node(start_pos + Vector3(gap * x, 0, gap * y)))
|
||||
row.append(create_node(point_position))
|
||||
row.append(create_node(point_position, grid_id, x, y))
|
||||
grid.append(row)
|
||||
for x: int in grid.size():
|
||||
for y: int in grid[x].size():
|
||||
|
||||
@@ -2,3 +2,4 @@ class_name FlowFieldData
|
||||
extends Resource
|
||||
|
||||
@export var nodes: Array[FlowNodeData]
|
||||
@export var grids: int = 0
|
||||
@@ -1,6 +1,11 @@
|
||||
class_name FlowFieldTool
|
||||
extends Node
|
||||
|
||||
@export_group("Basic Function")
|
||||
@export var zone_list: Array[PackedScene]
|
||||
@export var zone_holder: Node3D
|
||||
|
||||
@export_group("Flow Field Editor")
|
||||
@export var flow_field: FlowField
|
||||
@export var raycast: RayCast3D
|
||||
@export var project_raycast: RayCast3D
|
||||
@@ -18,13 +23,41 @@ extends Node
|
||||
var hover: FlowNode = null
|
||||
var selected: Array[FlowNode] = []
|
||||
var vector_dirty: bool = false
|
||||
var editing: bool = false
|
||||
var selected_zone: int = -1
|
||||
var level: Level
|
||||
var radius: float = 0
|
||||
var up_angle: float = 0
|
||||
var rotate_held: bool = false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
var i: int = 0
|
||||
for zone: PackedScene in zone_list:
|
||||
i += 1
|
||||
$VBoxContainer2/OptionButton.add_item("Zone " + str(i))
|
||||
$VBoxContainer2/OptionButton.select(0)
|
||||
$VBoxContainer2/OptionButton.item_selected.connect(select_zone)
|
||||
_on_trash_button_pressed()
|
||||
|
||||
|
||||
func select_zone(zone_index: int) -> void:
|
||||
selected_zone = zone_index
|
||||
|
||||
|
||||
func load_zone() -> void:
|
||||
_on_trash_button_pressed()
|
||||
if level:
|
||||
level.queue_free()
|
||||
level = zone_list[selected_zone].instantiate() as Level
|
||||
zone_holder.add_child(level)
|
||||
camera.make_current()
|
||||
editing = true
|
||||
print("set editing true")
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if editing:
|
||||
if raycast.is_colliding() and (!hover or hover != raycast.get_collider()):
|
||||
hover = raycast.get_collider()
|
||||
if hover and !raycast.is_colliding():
|
||||
@@ -38,6 +71,24 @@ func _process(delta: float) -> void:
|
||||
elif selected.size() != 1:
|
||||
position_field.visible = false
|
||||
|
||||
set_node_colors()
|
||||
|
||||
if Input.is_action_just_pressed("Secondary Fire"):
|
||||
rotate_held = true
|
||||
if Input.is_action_just_released("Secondary Fire"):
|
||||
rotate_held = false
|
||||
|
||||
var y: float = Input.get_axis("Move Forward", "Move Backward")
|
||||
var x: float = Input.get_axis("Move Left", "Move Right")
|
||||
var input_vector: Vector2 = Input.get_vector("Move Left", "Move Right", "Move Forward", "Move Backward")
|
||||
#camera_pivot.position += Vector3(x, 0, y) * delta * 30
|
||||
#set_cam_position()
|
||||
var movement: Vector3 = ((camera_pivot.transform.basis.z * input_vector.y) + (camera_pivot.transform.basis.x * input_vector.x))
|
||||
var vec2: Vector2 = Vector2(movement.x, movement.z).normalized()
|
||||
camera_pivot.position += Vector3(vec2.x, 0.0, vec2.y) * delta * 30.0
|
||||
|
||||
|
||||
func set_node_colors() -> void:
|
||||
for node: FlowNode in flow_field.nodes:
|
||||
if node.traversable and node.buildable:
|
||||
node.set_color(Color.WEB_GRAY)
|
||||
@@ -54,10 +105,6 @@ func _process(delta: float) -> void:
|
||||
if node == hover:
|
||||
node.set_color(Color.RED)
|
||||
|
||||
var y: float = Input.get_axis("Move Forward", "Move Backward")
|
||||
var x: float = Input.get_axis("Move Left", "Move Right")
|
||||
camera_pivot.position += Vector3(x, 0, y) * delta * 10
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if event is InputEventMouseMotion:
|
||||
@@ -71,14 +118,26 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
vector_dirty = true
|
||||
if event is InputEventMouseButton and event.button_index == 2 and selected.size() > 0:
|
||||
selected = []
|
||||
if event is InputEventKey and event.keycode == KEY_UP:
|
||||
var vector: Vector3 = camera.position - camera_pivot.position
|
||||
vector = vector.normalized()
|
||||
camera.position += vector
|
||||
if event is InputEventKey and event.keycode == KEY_DOWN:
|
||||
var vector: Vector3 = camera.position - camera_pivot.position
|
||||
vector = vector.normalized()
|
||||
camera.position -= vector
|
||||
|
||||
if event is InputEventMouseButton and event.button_index == 5:
|
||||
zoom_in()
|
||||
|
||||
if event is InputEventMouseButton and event.button_index == 4:
|
||||
zoom_out()
|
||||
|
||||
if event is InputEventMouseMotion and rotate_held:
|
||||
camera_pivot.rotation.y -= (event.relative.x * get_viewport().get_final_transform().x.x) * (Data.preferences.mouse_sens / 10000.0) * (-1 if Data.preferences.invert_lookY else 1)
|
||||
up_angle -= (event.relative.y * get_viewport().get_final_transform().y.y) * (Data.preferences.mouse_sens / 10000.0) * (-1 if Data.preferences.invert_lookY else 1)
|
||||
up_angle = clamp(up_angle, deg_to_rad(-90), deg_to_rad(90))
|
||||
camera_pivot.rotation.x = up_angle
|
||||
|
||||
|
||||
func zoom_out() -> void:
|
||||
camera.position.z -= 0.3
|
||||
|
||||
|
||||
func zoom_in() -> void:
|
||||
camera.position.z += 0.3
|
||||
|
||||
|
||||
func _on_x_field_changed(text: String) -> void:
|
||||
@@ -165,6 +224,9 @@ func _on_save_button_pressed() -> void:
|
||||
var dict: Dictionary[FlowNode, FlowNodeData] = {}
|
||||
for node: FlowNode in flow_field.nodes:
|
||||
var new_flow_node_data: FlowNodeData = FlowNodeData.new()
|
||||
new_flow_node_data.grid_id = node.grid_id
|
||||
new_flow_node_data.grid_x = node.grid_x
|
||||
new_flow_node_data.grid_y = node.grid_y
|
||||
new_flow_node_data.position = node.global_position
|
||||
new_flow_node_data.buildable = node.buildable
|
||||
if flow_field.start_nodes.has(node):
|
||||
@@ -187,3 +249,10 @@ func _on_load_button_pressed() -> void:
|
||||
var resource: Resource = ResourceLoader.load(save_path.text)
|
||||
if resource is FlowFieldData:
|
||||
flow_field.load_from_data(resource)
|
||||
|
||||
|
||||
func _on_trash_button_pressed() -> void:
|
||||
if flow_field:
|
||||
flow_field.queue_free()
|
||||
flow_field = FlowField.new()
|
||||
add_child(flow_field)
|
||||
@@ -1,14 +1,17 @@
|
||||
[gd_scene format=3 uid="uid://cccowrgelgswj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://05c5q1v2nv8p" path="res://Scripts/flow_field_tool.gd" id="1_e7pmn"]
|
||||
[ext_resource type="Script" uid="uid://05c5q1v2nv8p" path="res://Scenes/FlowField/flow_field_tool.gd" id="1_e7pmn"]
|
||||
[ext_resource type="PackedScene" uid="uid://y1qa1g3ic8sp" path="res://Worlds/GreenPlanet/Levels/Bridge/bridge.tscn" id="2_030xf"]
|
||||
[ext_resource type="PackedScene" uid="uid://csq7if8wojp4g" path="res://Worlds/GreenPlanet/Levels/Cave/cave.tscn" id="3_xar7e"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_e7pmn"]
|
||||
ambient_light_source = 2
|
||||
ambient_light_color = Color(0.728822, 0.728822, 0.728822, 1)
|
||||
|
||||
|
||||
[node name="FlowFieldTool" type="Node" node_paths=PackedStringArray("raycast", "project_raycast", "camera", "camera_pivot", "position_field", "x_field", "y_field", "z_field", "x_size_field", "y_size_field", "gap_field", "save_path")]
|
||||
[node name="FlowFieldTool" type="Node" unique_id=897052359 node_paths=PackedStringArray("zone_holder", "raycast", "project_raycast", "camera", "camera_pivot", "position_field", "x_field", "y_field", "z_field", "x_size_field", "y_size_field", "gap_field", "save_path")]
|
||||
script = ExtResource("1_e7pmn")
|
||||
zone_list = Array[PackedScene]([ExtResource("2_030xf"), ExtResource("3_xar7e")])
|
||||
zone_holder = NodePath("ZoneHolder")
|
||||
raycast = NodePath("CameraFocus/Camera3D/RayCast3D")
|
||||
project_raycast = NodePath("RayCast3D")
|
||||
camera = NodePath("CameraFocus/Camera3D")
|
||||
@@ -24,8 +27,16 @@ save_path = NodePath("VBoxContainer/FileNameInput")
|
||||
metadata/_custom_type_script = "uid://05c5q1v2nv8p"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=1159336300]
|
||||
offset_right = 296.0
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -173.0
|
||||
offset_bottom = 572.0
|
||||
grow_horizontal = 0
|
||||
|
||||
[node name="Button" type="Button" parent="VBoxContainer" unique_id=1948996218]
|
||||
layout_mode = 2
|
||||
text = "Trash FlowField"
|
||||
|
||||
[node name="Create" type="Button" parent="VBoxContainer" unique_id=1093532280]
|
||||
layout_mode = 2
|
||||
@@ -89,24 +100,24 @@ text = "Extrude"
|
||||
layout_mode = 2
|
||||
text = "Calculate"
|
||||
|
||||
<<<<<<< HEAD
|
||||
[node name="Finalize" type="Button" parent="VBoxContainer" unique_id=1604655281]
|
||||
=======
|
||||
[node name="FileNameInput" type="LineEdit" parent="VBoxContainer"]
|
||||
>>>>>>> 48b1add (first flow field resource draft)
|
||||
layout_mode = 2
|
||||
text = "Finalize"
|
||||
|
||||
[node name="FileNameInput" type="LineEdit" parent="VBoxContainer" unique_id=1302446264]
|
||||
layout_mode = 2
|
||||
placeholder_text = "level title"
|
||||
alignment = 1
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"]
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer" unique_id=426824804]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Save" type="Button" parent="VBoxContainer/HBoxContainer2"]
|
||||
[node name="Save" type="Button" parent="VBoxContainer/HBoxContainer2" unique_id=128915038]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Save"
|
||||
|
||||
[node name="Load" type="Button" parent="VBoxContainer/HBoxContainer2"]
|
||||
[node name="Load" type="Button" parent="VBoxContainer/HBoxContainer2" unique_id=397086630]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Load"
|
||||
@@ -135,14 +146,30 @@ size_flags_horizontal = 3
|
||||
[node name="CameraFocus" type="Node3D" parent="." unique_id=1567712529]
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="CameraFocus" unique_id=1970273041]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.34202, 0.939693, 0, -0.939693, 0.34202, 0, 8.50452, 3.40739)
|
||||
transform = Transform3D(1, 0, 0, 0, 1.0000002, 0, 0, 0, 1.0000002, 0, 0, 3)
|
||||
environment = SubResource("Environment_e7pmn")
|
||||
|
||||
[node name="RayCast3D" type="RayCast3D" parent="CameraFocus/Camera3D" unique_id=1801773920]
|
||||
collision_mask = 64
|
||||
|
||||
[node name="CSGSphere3D" type="CSGSphere3D" parent="CameraFocus" unique_id=275568945]
|
||||
|
||||
[node name="RayCast3D" type="RayCast3D" parent="." unique_id=431196612]
|
||||
|
||||
[node name="ZoneHolder" type="Node3D" parent="." unique_id=1127890663]
|
||||
|
||||
[node name="VBoxContainer2" type="HBoxContainer" parent="." unique_id=1656150952]
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="OptionButton" type="OptionButton" parent="VBoxContainer2" unique_id=298744483]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Button" type="Button" parent="VBoxContainer2" unique_id=1468940506]
|
||||
layout_mode = 2
|
||||
text = "Load zone"
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/Button" to="." method="_on_trash_button_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/Create" to="." method="_on_create_button_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/Delete" to="." method="_on_create_button_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/GenerateGrid" to="." method="_on_generate_grid_button_pressed"]
|
||||
@@ -159,3 +186,4 @@ collision_mask = 64
|
||||
[connection signal="text_changed" from="Position/x" to="." method="_on_x_field_changed"]
|
||||
[connection signal="text_changed" from="Position/y" to="." method="_on_y_field_changed"]
|
||||
[connection signal="text_changed" from="Position/z" to="." method="_on_z_field_changed"]
|
||||
[connection signal="pressed" from="VBoxContainer2/Button" to="." method="load_zone"]
|
||||
|
||||
@@ -7,6 +7,9 @@ extends StaticBody3D
|
||||
@export var buildable: bool = true
|
||||
|
||||
var visual_scene: PackedScene = preload("res://Scenes/FlowField/cube2.tscn")
|
||||
var grid_id: int = -1
|
||||
var grid_x: int = 0
|
||||
var grid_y: int = 0
|
||||
var best_path: FlowNode :
|
||||
get():
|
||||
return best_path
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene format=3 uid="uid://bssfvyxv5uo1f"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c86ygtor5tksd" path="res://Scripts/flow_node.gd" id="1_ng65h"]
|
||||
[ext_resource type="Script" uid="uid://c86ygtor5tksd" path="res://Scenes/FlowField/flow_node.gd" id="1_ng65h"]
|
||||
[ext_resource type="PackedScene" uid="uid://h7el2c2awv6" path="res://Scenes/FlowField/flow_node2.tscn" id="2_bmgs5"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_bmgs5"]
|
||||
|
||||
17
Scenes/FlowField/flow_node_data.gd
Normal file
17
Scenes/FlowField/flow_node_data.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
class_name FlowNodeData
|
||||
extends Resource
|
||||
|
||||
enum NodeType {
|
||||
STANDARD = 0,
|
||||
START = 1,
|
||||
GOAL = 2,
|
||||
}
|
||||
|
||||
@export var position: Vector3 = Vector3.ZERO
|
||||
@export var type: NodeType = NodeType.STANDARD
|
||||
@export var buildable: bool = true
|
||||
@export var connected_nodes: Array[FlowNodeData]
|
||||
@export var in_grid: bool = false
|
||||
@export var grid_id: int = -1
|
||||
@export var grid_x: int = 0
|
||||
@export var grid_y: int = 0
|
||||
@@ -1,13 +0,0 @@
|
||||
class_name FlowNodeData
|
||||
extends Resource
|
||||
|
||||
enum NodeType {
|
||||
STANDARD = 0,
|
||||
START = 1,
|
||||
GOAL = 2,
|
||||
}
|
||||
|
||||
@export var position: Vector3
|
||||
@export var type: NodeType
|
||||
@export var buildable: bool
|
||||
@export var connected_nodes: Array[FlowNodeData]
|
||||
@@ -7,20 +7,21 @@ extends Node3D
|
||||
@export var enemy_spawns: Array[EnemySpawner]
|
||||
@export var enemy_goals: Array[Node3D]
|
||||
@export var corpses: Node
|
||||
@export var flow_field: FlowField
|
||||
@export var cinematic_cam: CinematicCamManager
|
||||
@export var printer: CardPrinter
|
||||
@export var shop: ShopStand
|
||||
@export var obstacle_scenes: Array[PackedScene]
|
||||
|
||||
var walls: Dictionary[FlowNode, TowerBase] = {}
|
||||
var wall_id: int = 0
|
||||
var tower_base_scene: PackedScene = load("res://Scenes/TowerBase/tower_base.tscn")
|
||||
var tower_frame_scene: PackedScene = load("res://Scenes/tower_frame.tscn")
|
||||
var tower_frames: Dictionary[FlowNode, Node3D] = {}
|
||||
var game_manager: GameManager
|
||||
var flow_field: FlowField
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
func load_flow_field() -> void:
|
||||
flow_field.path_updated.connect(enemy_spawns[0].update_path)
|
||||
for node: FlowNode in flow_field.nodes:
|
||||
if node.buildable:
|
||||
|
||||
@@ -246,7 +246,7 @@ albedo_color = Color(0, 0, 0, 0.88400006)
|
||||
material = SubResource("StandardMaterial3D_fi8e6")
|
||||
size = Vector2(7.84, 3.69)
|
||||
|
||||
[node name="Bridge" type="Node3D" unique_id=1906077552 node_paths=PackedStringArray("tower_path", "player_spawns", "enemy_spawns", "enemy_goals", "corpses", "flow_field", "cinematic_cam", "printer", "shop")]
|
||||
[node name="Bridge" type="Node3D" unique_id=1906077552 node_paths=PackedStringArray("tower_path", "player_spawns", "enemy_spawns", "enemy_goals", "corpses", "cinematic_cam", "printer", "shop")]
|
||||
script = ExtResource("1_ws6nn")
|
||||
enemy_pool = Array[ExtResource("2_ks6qx")]([ExtResource("3_6tcu8"), ExtResource("4_uh5sr"), ExtResource("5_g08yk"), ExtResource("6_asmpj")])
|
||||
tower_path = NodePath("Towers")
|
||||
@@ -254,7 +254,6 @@ player_spawns = [NodePath("PlayerSpawnLocations/PlayerSpawn1"), NodePath("Player
|
||||
enemy_spawns = [NodePath("GroundSpawn"), NodePath("GroundSpawn2"), NodePath("GroundSpawn3"), NodePath("GroundSpawn4"), NodePath("GroundSpawn5"), NodePath("AirSpawn")]
|
||||
enemy_goals = [NodePath("EnemyGoal")]
|
||||
corpses = NodePath("Corpses")
|
||||
flow_field = NodePath("FlowField2")
|
||||
cinematic_cam = NodePath("CinemaCam")
|
||||
printer = NodePath("CardPrinter")
|
||||
shop = NodePath("ShopStand")
|
||||
|
||||
49
Worlds/GreenPlanet/Levels/Cave/cave.tscn
Normal file
49
Worlds/GreenPlanet/Levels/Cave/cave.tscn
Normal file
@@ -0,0 +1,49 @@
|
||||
[gd_scene format=3 uid="uid://csq7if8wojp4g"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cvejbo3srx8py" path="res://Scripts/level.gd" id="1_li03l"]
|
||||
[ext_resource type="Script" uid="uid://cbwxa2a4hfcy4" path="res://Scripts/Resources/enemy.gd" id="2_1sih4"]
|
||||
[ext_resource type="Resource" uid="uid://8eba45hql7bo" path="res://Enemies/EyeDog/eye_dog.tres" id="3_y5pxn"]
|
||||
[ext_resource type="PackedScene" uid="uid://bhroqr4s1qso5" path="res://Worlds/GreenPlanet/Levels/Cave/cave_level.glb" id="4_x53u6"]
|
||||
[ext_resource type="Script" uid="uid://dkuxg6ek5us4f" path="res://Scripts/enemy_spawner.gd" id="5_e8b6i"]
|
||||
[ext_resource type="Script" uid="uid://cxwtuxytavfu5" path="res://Scripts/enemy_goal.gd" id="6_n26ay"]
|
||||
[ext_resource type="PackedScene" uid="uid://1b2ikdanl66b" path="res://Scenes/CardPrinter/card_printer.tscn" id="7_y5pxn"]
|
||||
[ext_resource type="PackedScene" uid="uid://7g3jev3v6d3l" path="res://Scenes/ShopStand/shop_stand.tscn" id="8_x53u6"]
|
||||
|
||||
[node name="Node3D" type="Node3D" unique_id=1915460305 node_paths=PackedStringArray("tower_path", "player_spawns", "enemy_spawns", "enemy_goals", "corpses", "printer", "shop")]
|
||||
script = ExtResource("1_li03l")
|
||||
enemy_pool = Array[ExtResource("2_1sih4")]([ExtResource("3_y5pxn")])
|
||||
tower_path = NodePath("Parents/Towers")
|
||||
player_spawns = [NodePath("PlayerSpawn")]
|
||||
enemy_spawns = [NodePath("EnemySpawner")]
|
||||
enemy_goals = [NodePath("EnemyGoal")]
|
||||
corpses = NodePath("Parents/Corpses")
|
||||
printer = NodePath("CardPrinter")
|
||||
shop = NodePath("ShopStand")
|
||||
metadata/_custom_type_script = "uid://cvejbo3srx8py"
|
||||
|
||||
[node name="Parents" type="Node3D" parent="." unique_id=447416055]
|
||||
|
||||
[node name="Towers" type="Node3D" parent="Parents" unique_id=401225440]
|
||||
|
||||
[node name="Corpses" type="Node3D" parent="Parents" unique_id=1858487493]
|
||||
|
||||
[node name="cave_level" parent="." unique_id=430935043 instance=ExtResource("4_x53u6")]
|
||||
|
||||
[node name="PlayerSpawn" type="Node3D" parent="." unique_id=2082895124]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.7781315, 0)
|
||||
|
||||
[node name="EnemySpawner" type="Node3D" parent="." unique_id=1276116196]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.93684864, -30.9888)
|
||||
script = ExtResource("5_e8b6i")
|
||||
metadata/_custom_type_script = "uid://dkuxg6ek5us4f"
|
||||
|
||||
[node name="EnemyGoal" type="Node3D" parent="." unique_id=1902271599]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.93684864, -11.24234)
|
||||
script = ExtResource("6_n26ay")
|
||||
metadata/_custom_type_script = "uid://cxwtuxytavfu5"
|
||||
|
||||
[node name="CardPrinter" parent="." unique_id=459800869 instance=ExtResource("7_y5pxn")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.507948, 0.03549701, 5.868264)
|
||||
|
||||
[node name="ShopStand" parent="." unique_id=1287436541 instance=ExtResource("8_x53u6")]
|
||||
transform = Transform3D(-1, 0, 6.976922e-05, 0, 1, 0, -6.976922e-05, 0, -1, 4.381688, 0.5, 7.0162544)
|
||||
Binary file not shown.
@@ -15,12 +15,14 @@ dest_files=["res://.godot/imported/cave_level.glb-2f9529a411c81ae92670ed22d2cc2e
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/root_script=null
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_name_suffixes=true
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/generate_lods=false
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
@@ -32,6 +34,28 @@ animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
materials/extract=0
|
||||
materials/extract_format=0
|
||||
materials/extract_path=""
|
||||
_subresources={
|
||||
"materials": {
|
||||
"CaveWall": {
|
||||
"use_external/enabled": true,
|
||||
"use_external/fallback_path": "res://Worlds/GreenPlanet/Levels/Cave/cave_walls.tres",
|
||||
"use_external/path": "uid://d28nsq46a2hkt"
|
||||
}
|
||||
},
|
||||
"meshes": {
|
||||
"cave_level_Plane": {
|
||||
"generate/lightmap_uv": 0,
|
||||
"generate/lods": 0,
|
||||
"generate/shadow_meshes": 0,
|
||||
"lods/normal_merge_angle": 20.0,
|
||||
"save_to_file/enabled": false,
|
||||
"save_to_file/fallback_path": "",
|
||||
"save_to_file/path": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
gltf/naming_version=1
|
||||
gltf/embedded_image_handling=1
|
||||
|
||||
BIN
Worlds/GreenPlanet/Levels/Cave/cave_level_dirt.png
Normal file
BIN
Worlds/GreenPlanet/Levels/Cave/cave_level_dirt.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
43
Worlds/GreenPlanet/Levels/Cave/cave_level_dirt.png.import
Normal file
43
Worlds/GreenPlanet/Levels/Cave/cave_level_dirt.png.import
Normal file
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://d25lkxr056geo"
|
||||
path="res://.godot/imported/cave_level_dirt.png-2eea126b719a96a8033407a8418756c8.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
generator_parameters={
|
||||
"md5": "dcd74dad69b0cf175774820a45df225d"
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Worlds/GreenPlanet/Levels/Cave/cave_level_dirt.png"
|
||||
dest_files=["res://.godot/imported/cave_level_dirt.png-2eea126b719a96a8033407a8418756c8.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
12
Worlds/GreenPlanet/Levels/Cave/cave_walls.tres
Normal file
12
Worlds/GreenPlanet/Levels/Cave/cave_walls.tres
Normal file
@@ -0,0 +1,12 @@
|
||||
[gd_resource type="ShaderMaterial" format=3 uid="uid://d28nsq46a2hkt"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://dq04j2s5foo2f" path="res://Shaders/mightyduke_ps1.gdshader" id="1_hv8n5"]
|
||||
[ext_resource type="Texture2D" uid="uid://cnvndwp3q7rke" path="res://Assets/Textures/dirt.png" id="2_6xq7p"]
|
||||
|
||||
[resource]
|
||||
render_priority = 0
|
||||
shader = ExtResource("1_hv8n5")
|
||||
shader_parameter/albedo = ExtResource("2_6xq7p")
|
||||
shader_parameter/jitter_z_coordinate = true
|
||||
shader_parameter/jitter_depth_independent = true
|
||||
shader_parameter/alpha_scissor = 1.0
|
||||
35
cave.tscn
35
cave.tscn
@@ -1,35 +0,0 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://8jabmf7c6p71"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bhroqr4s1qso5" path="res://Worlds/GreenPlanet/Levels/Cave/cave_level.glb" id="1_yhhov"]
|
||||
[ext_resource type="PackedScene" uid="uid://b7dwsqfmdqr8" path="res://Scenes/FlowField/flow_field.tscn" id="2_shk3w"]
|
||||
[ext_resource type="PackedScene" uid="uid://cccowrgelgswj" path="res://Scenes/FlowField/flow_field_tool.tscn" id="3_23xot"]
|
||||
|
||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_ads45"]
|
||||
sky_horizon_color = Color(0.662243, 0.671743, 0.686743, 1)
|
||||
ground_horizon_color = Color(0.662243, 0.671743, 0.686743, 1)
|
||||
|
||||
[sub_resource type="Sky" id="Sky_shk3w"]
|
||||
sky_material = SubResource("ProceduralSkyMaterial_ads45")
|
||||
|
||||
[sub_resource type="Environment" id="Environment_23xot"]
|
||||
background_mode = 2
|
||||
sky = SubResource("Sky_shk3w")
|
||||
tonemap_mode = 2
|
||||
glow_enabled = true
|
||||
|
||||
[node name="Cave" type="Node3D"]
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_23xot")
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(-0.866023, -0.433016, 0.250001, 0, 0.499998, 0.866027, -0.500003, 0.749999, -0.43301, 0, 0, 0)
|
||||
shadow_enabled = true
|
||||
|
||||
[node name="cave_level" parent="." instance=ExtResource("1_yhhov")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.99917, 0)
|
||||
|
||||
[node name="FlowField" parent="." instance=ExtResource("2_shk3w")]
|
||||
|
||||
[node name="FlowFieldTool" parent="." node_paths=PackedStringArray("flow_field") instance=ExtResource("3_23xot")]
|
||||
flow_field = NodePath("../FlowField")
|
||||
30
sphericalcoordtest.gd
Normal file
30
sphericalcoordtest.gd
Normal file
@@ -0,0 +1,30 @@
|
||||
extends Node3D
|
||||
|
||||
var radius: float
|
||||
var inclination: float
|
||||
var azimuth: float
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
var x: float = radius * sin(deg_to_rad(inclination)) * cos(deg_to_rad(azimuth))
|
||||
var y: float = radius * sin(deg_to_rad(inclination)) * sin(deg_to_rad(azimuth))
|
||||
var z: float = radius * cos(deg_to_rad(inclination))
|
||||
$CSGSphere3D2.position = Vector3(x, y, z)
|
||||
|
||||
|
||||
func change_radius(value: float) -> void:
|
||||
radius = value
|
||||
$VBoxContainer/HBoxContainer/SpinBox.value = value
|
||||
$VBoxContainer/HBoxContainer/HSlider.value = value
|
||||
|
||||
|
||||
func change_inclination(value: float) -> void:
|
||||
inclination = value
|
||||
$VBoxContainer/HBoxContainer2/SpinBox.value = value
|
||||
$VBoxContainer/HBoxContainer2/HSlider.value = value
|
||||
|
||||
|
||||
func change_azimuth(value: float) -> void:
|
||||
azimuth = value
|
||||
$VBoxContainer/HBoxContainer3/SpinBox.value = value
|
||||
$VBoxContainer/HBoxContainer3/HSlider.value = value
|
||||
1
sphericalcoordtest.gd.uid
Normal file
1
sphericalcoordtest.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cjhqfh1vmwvg6
|
||||
113
sphericalcoordtest.tscn
Normal file
113
sphericalcoordtest.tscn
Normal file
@@ -0,0 +1,113 @@
|
||||
[gd_scene format=3 uid="uid://b4epkbabvkqjs"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cjhqfh1vmwvg6" path="res://sphericalcoordtest.gd" id="1_verwr"]
|
||||
|
||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_qypuf"]
|
||||
sky_horizon_color = Color(0.66224277, 0.6717428, 0.6867428, 1)
|
||||
ground_horizon_color = Color(0.66224277, 0.6717428, 0.6867428, 1)
|
||||
|
||||
[sub_resource type="Sky" id="Sky_ve5w1"]
|
||||
sky_material = SubResource("ProceduralSkyMaterial_qypuf")
|
||||
|
||||
[sub_resource type="Environment" id="Environment_t066q"]
|
||||
background_mode = 2
|
||||
sky = SubResource("Sky_ve5w1")
|
||||
tonemap_mode = 2
|
||||
glow_enabled = true
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_0jip7"]
|
||||
transparency = 1
|
||||
albedo_color = Color(0.1680183, 0.6636825, 0.79655224, 0.314)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1xeyl"]
|
||||
transparency = 1
|
||||
albedo_color = Color(0.8112079, 0.23061386, 0.22009245, 1)
|
||||
|
||||
[node name="Node3D" type="Node3D" unique_id=375811937]
|
||||
script = ExtResource("1_verwr")
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1621176706]
|
||||
environment = SubResource("Environment_t066q")
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=116451807]
|
||||
transform = Transform3D(-0.8660254, -0.43301278, 0.25, 0, 0.49999997, 0.86602545, -0.50000006, 0.75, -0.43301266, 0, 0, 0)
|
||||
shadow_enabled = true
|
||||
directional_shadow_max_distance = 1.0
|
||||
|
||||
[node name="CSGSphere3D" type="CSGSphere3D" parent="." unique_id=182013821]
|
||||
radius = 3.0
|
||||
radial_segments = 20
|
||||
rings = 20
|
||||
material = SubResource("StandardMaterial3D_0jip7")
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="." unique_id=56518371]
|
||||
transform = Transform3D(0.87987083, -0.13671899, 0.45512098, 0.012009842, 0.963812, 0.2663122, -0.475061, -0.22885446, 0.8496721, 6.076455, 2.9432085, 5.15343)
|
||||
|
||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="." unique_id=888461488]
|
||||
material = SubResource("StandardMaterial3D_1xeyl")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=5360877]
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.875
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -104.0
|
||||
offset_bottom = 56.0
|
||||
grow_horizontal = 0
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer" unique_id=1663359182]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer" unique_id=1797054401]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Radius"
|
||||
|
||||
[node name="SpinBox" type="SpinBox" parent="VBoxContainer/HBoxContainer" unique_id=128652701]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HSlider" type="HSlider" parent="VBoxContainer/HBoxContainer" unique_id=233001209]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 1.51
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer" unique_id=1898159364]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2" unique_id=1807937574]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Inclination"
|
||||
|
||||
[node name="SpinBox" type="SpinBox" parent="VBoxContainer/HBoxContainer2" unique_id=850210140]
|
||||
layout_mode = 2
|
||||
max_value = 400.0
|
||||
|
||||
[node name="HSlider" type="HSlider" parent="VBoxContainer/HBoxContainer2" unique_id=201433473]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 1.51
|
||||
max_value = 400.0
|
||||
|
||||
[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer" unique_id=365357689]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3" unique_id=691657505]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Azimuth"
|
||||
|
||||
[node name="SpinBox" type="SpinBox" parent="VBoxContainer/HBoxContainer3" unique_id=74971746]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HSlider" type="HSlider" parent="VBoxContainer/HBoxContainer3" unique_id=685802544]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 1.51
|
||||
|
||||
[connection signal="value_changed" from="VBoxContainer/HBoxContainer/SpinBox" to="." method="change_radius"]
|
||||
[connection signal="value_changed" from="VBoxContainer/HBoxContainer/HSlider" to="." method="change_radius"]
|
||||
[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/SpinBox" to="." method="change_inclination"]
|
||||
[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/HSlider" to="." method="change_inclination"]
|
||||
[connection signal="value_changed" from="VBoxContainer/HBoxContainer3/SpinBox" to="." method="change_azimuth"]
|
||||
[connection signal="value_changed" from="VBoxContainer/HBoxContainer3/HSlider" to="." method="change_azimuth"]
|
||||
Reference in New Issue
Block a user