Commit fdaa3517 authored by Gavin An's avatar Gavin An

맵 크기 변경

parent 98017115
...@@ -4,20 +4,20 @@ ...@@ -4,20 +4,20 @@
[ext_resource type="Script" uid="uid://cq7r51whh6po" path="res://src/core/stage_manager.gd" id="2_stage_mgr"] [ext_resource type="Script" uid="uid://cq7r51whh6po" path="res://src/core/stage_manager.gd" id="2_stage_mgr"]
[ext_resource type="PackedScene" path="res://src/entities/monsters/base_monster.tscn" id="3_base_monster"] [ext_resource type="PackedScene" path="res://src/entities/monsters/base_monster.tscn" id="3_base_monster"]
[ext_resource type="Script" uid="uid://dkplkt6q8e3b5" path="res://src/core/unit_controller.gd" id="4_unit_ctrl"] [ext_resource type="Script" uid="uid://dkplkt6q8e3b5" path="res://src/core/unit_controller.gd" id="4_unit_ctrl"]
[ext_resource type="PackedScene" path="res://src/ui/hud.tscn" id="5_hud"] [ext_resource type="PackedScene" uid="uid://bqga1rvcjyydy" path="res://src/ui/hud.tscn" id="5_hud"]
[sub_resource type="NavigationMesh" id="NavigationMesh_map"] [sub_resource type="NavigationMesh" id="NavigationMesh_map"]
agent_height = 1.0 agent_height = 1.0
[sub_resource type="BoxShape3D" id="BoxShape3D_ground"] [sub_resource type="BoxShape3D" id="BoxShape3D_ground"]
size = Vector3(50, 1, 50) size = Vector3(20, 1, 20)
[sub_resource type="BoxMesh" id="BoxMesh_ground"] [sub_resource type="BoxMesh" id="BoxMesh_ground"]
size = Vector3(50, 1, 50) size = Vector3(20, 1, 20)
[sub_resource type="Curve3D" id="Curve3D_path"] [sub_resource type="Curve3D" id="Curve3D_path"]
_data = { _data = {
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, -22, 0, -22, 0, 0, 0, 0, 0, 0, 22, 0, -22, 0, 0, 0, 0, 0, 0, 22, 0, 22, 0, 0, 0, 0, 0, 0, -22, 0, 22, 0, 0, 0, 0, 0, 0, -22, 0, -22), "points": PackedVector3Array(0, 0, 0, 0, 0, 0, -8.5, 0, -8.5, 0, 0, 0, 0, 0, 0, 8.5, 0, -8.5, 0, 0, 0, 0, 0, 0, 8.5, 0, 8.5, 0, 0, 0, 0, 0, 0, -8.5, 0, 8.5, 0, 0, 0, 0, 0, 0, -8.5, 0, -8.5),
"tilts": PackedFloat32Array(0, 0, 0, 0, 0) "tilts": PackedFloat32Array(0, 0, 0, 0, 0)
} }
point_count = 5 point_count = 5
...@@ -46,7 +46,7 @@ mesh = SubResource("BoxMesh_ground") ...@@ -46,7 +46,7 @@ mesh = SubResource("BoxMesh_ground")
curve = SubResource("Curve3D_path") curve = SubResource("Curve3D_path")
[node name="RTSCamera" type="Camera3D" parent="." unique_id=1379842143] [node name="RTSCamera" type="Camera3D" parent="." unique_id=1379842143]
transform = Transform3D(1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, 0, 15, 10) transform = Transform3D(1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, 0, 10, 5.77)
script = ExtResource("1_rts_cam") script = ExtResource("1_rts_cam")
[node name="StageManager" type="Node" parent="." unique_id=132524356] [node name="StageManager" type="Node" parent="." unique_id=132524356]
......
...@@ -10,21 +10,22 @@ extends Camera3D ...@@ -10,21 +10,22 @@ extends Camera3D
@export var zoom_step: float = 2.0 @export var zoom_step: float = 2.0
# 줌 범위 설정 # 줌 범위 설정
@export var min_zoom: float = 8.0 @export var min_zoom: float = 5.0
@export var max_zoom: float = 35.0 @export var max_zoom: float = 18.0
# 화면 가장자리 마우스 감지 여백 (픽셀 단위) # 화면 가장자리 마우스 감지 여백 (픽셀 단위)
@export var edge_margin: float = 15.0 @export var edge_margin: float = 15.0
@export var enable_edge_scroll: bool = true @export var enable_edge_scroll: bool = true
# 맵 카메라 이동 한계 설정 (바닥 크기 50x50 기준) # 맵 카메라 이동 한계 설정 (바닥 크기 20x20 기준)
@export var limit_min: Vector2 = Vector2(-22.0, -22.0) @export var limit_min: Vector2 = Vector2(-8.0, -8.0)
@export var limit_max: Vector2 = Vector2(22.0, 22.0) @export var limit_max: Vector2 = Vector2(8.0, 8.0)
# 현재 카메라가 바라보고 있는 바닥의 포커스 좌표 (이곳을 중심으로 회전 및 줌이 일어남) # 현재 카메라가 바라보고 있는 바닥의 포커스 좌표 (이곳을 중심으로 회전 및 줌이 일어남)
var _target_focus: Vector3 = Vector3.ZERO var _target_focus: Vector3 = Vector3.ZERO
var _current_zoom: float = 20.0 var _current_zoom: float = 10.0
var _target_zoom: float = 20.0 var _target_zoom: float = 10.0
func _ready() -> void: func _ready() -> void:
# 초기 카메라 위치를 기준으로 포커스 좌표 역계산 # 초기 카메라 위치를 기준으로 포커스 좌표 역계산
......
...@@ -7,7 +7,7 @@ signal stage_started(stage: int) ...@@ -7,7 +7,7 @@ signal stage_started(stage: int)
@export var monster_scene: PackedScene @export var monster_scene: PackedScene
@export var spawn_interval: float = 1.0 @export var spawn_interval: float = 1.0
@export var monsters_per_stage: int = 15 # 빠른 테스트를 위해 기획보다 약간 낮추거나 15~30마리 수준 설정 @export var monsters_per_stage: int = 100 # 빠른 테스트를 위해 기획보다 약간 낮추거나 15~30마리 수준 설정
# Path3D 노드 경로 # Path3D 노드 경로
@export var path_node_path: NodePath = NodePath("../MonsterPath") @export var path_node_path: NodePath = NodePath("../MonsterPath")
......
...@@ -75,7 +75,11 @@ func _perform_selection(start: Vector2, end: Vector2) -> void: ...@@ -75,7 +75,11 @@ func _perform_selection(start: Vector2, end: Vector2) -> void:
if not camera: if not camera:
return return
# 이전 선택 유닛 비활성화 # Shift 키 입력 체크
var is_shift: bool = Input.is_key_pressed(KEY_SHIFT)
# Shift가 눌려있지 않은 경우에만 기존 선택 유닛들 초기화
if not is_shift:
for unit: Node in selected_units: for unit: Node in selected_units:
if is_instance_valid(unit) and unit.has_method("deselect"): if is_instance_valid(unit) and unit.has_method("deselect"):
unit.call("deselect") unit.call("deselect")
...@@ -90,6 +94,8 @@ func _perform_selection(start: Vector2, end: Vector2) -> void: ...@@ -90,6 +94,8 @@ func _perform_selection(start: Vector2, end: Vector2) -> void:
var hit_collider: Node = ray_result["collider"] as Node var hit_collider: Node = ray_result["collider"] as Node
var unit_node: Node = _get_unit_node(hit_collider) var unit_node: Node = _get_unit_node(hit_collider)
if unit_node and unit_node.is_in_group("units"): if unit_node and unit_node.is_in_group("units"):
# Shift 추가 선택 모드 시 이미 선택 리스트에 없는 경우에만 누적
if not selected_units.has(unit_node):
selected_units.append(unit_node) selected_units.append(unit_node)
if unit_node.has_method("select"): if unit_node.has_method("select"):
unit_node.call("select") unit_node.call("select")
...@@ -99,6 +105,7 @@ func _perform_selection(start: Vector2, end: Vector2) -> void: ...@@ -99,6 +105,7 @@ func _perform_selection(start: Vector2, end: Vector2) -> void:
else: else:
var selection_rect: Rect2 = Rect2(start, end - start).abs() var selection_rect: Rect2 = Rect2(start, end - start).abs()
var all_units: Array[Node] = get_tree().get_nodes_in_group("units") var all_units: Array[Node] = get_tree().get_nodes_in_group("units")
var newly_selected_count: int = 0
for unit: Node in all_units: for unit: Node in all_units:
if is_instance_valid(unit) and unit is Node3D: if is_instance_valid(unit) and unit is Node3D:
...@@ -107,10 +114,13 @@ func _perform_selection(start: Vector2, end: Vector2) -> void: ...@@ -107,10 +114,13 @@ func _perform_selection(start: Vector2, end: Vector2) -> void:
# 화면 뷰포트 영역 내부 및 드래그 사각형 안에 포함되는지 판정 # 화면 뷰포트 영역 내부 및 드래그 사각형 안에 포함되는지 판정
if selection_rect.has_point(screen_pos): if selection_rect.has_point(screen_pos):
# 중복 선택 추가 방지
if not selected_units.has(unit):
selected_units.append(unit) selected_units.append(unit)
if unit.has_method("select"): if unit.has_method("select"):
unit.call("select") unit.call("select")
print("UnitController: Selected ", selected_units.size(), " units via drag.") newly_selected_count += 1
print("UnitController: Selected ", newly_selected_count, " new units via drag. Total: ", selected_units.size())
## 우클릭 액션 (이동 목적지 지정 또는 적 공격 타겟팅) ## 우클릭 액션 (이동 목적지 지정 또는 적 공격 타겟팅)
func _perform_action(mouse_pos: Vector2) -> void: func _perform_action(mouse_pos: Vector2) -> void:
......
[gd_scene load_steps=5 format=3] [gd_scene format=3 uid="uid://bslqp550s3j0s"]
[ext_resource type="Script" path="res://src/entities/monsters/base_monster.gd" id="1_base_monster"] [ext_resource type="Script" uid="uid://bj0j32wc3fvkg" path="res://src/entities/monsters/base_monster.gd" id="1_base_monster"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_red"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_red"]
albedo_color = Color(0.901961, 0.098039, 0.098039, 1) albedo_color = Color(0.901961, 0.098039, 0.098039, 1)
...@@ -8,21 +8,19 @@ roughness = 0.5 ...@@ -8,21 +8,19 @@ roughness = 0.5
[sub_resource type="SphereMesh" id="SphereMesh_monster"] [sub_resource type="SphereMesh" id="SphereMesh_monster"]
material = SubResource("StandardMaterial3D_red") material = SubResource("StandardMaterial3D_red")
radius = 0.5
height = 1.0
[sub_resource type="SphereShape3D" id="SphereShape3D_collision"] [sub_resource type="SphereShape3D" id="SphereShape3D_collision"]
radius = 0.6 radius = 0.6
[node name="BaseMonster" type="PathFollow3D"] [node name="BaseMonster" type="PathFollow3D" unique_id=979648792]
script = ExtResource("1_base_monster") script = ExtResource("1_base_monster")
[node name="VisualMesh" type="MeshInstance3D" parent="."] [node name="VisualMesh" type="MeshInstance3D" parent="." unique_id=1944106965]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
mesh = SubResource("SphereMesh_monster") mesh = SubResource("SphereMesh_monster")
[node name="MonsterArea" type="Area3D" parent="."] [node name="MonsterArea" type="Area3D" parent="." unique_id=1629900660]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="MonsterArea"] [node name="CollisionShape3D" type="CollisionShape3D" parent="MonsterArea" unique_id=1948998971]
shape = SubResource("SphereShape3D_collision") shape = SubResource("SphereShape3D_collision")
...@@ -11,8 +11,8 @@ var is_selected: bool = false ...@@ -11,8 +11,8 @@ var is_selected: bool = false
var _target_monster: Node3D = null var _target_monster: Node3D = null
var _attack_timer: float = 0.0 var _attack_timer: float = 0.0
# 자동 탐색 범위 (맵 가장자리를 회전하는 적들을 스폰존에서 인식 가능하도록 30.0m로 확대) # 자동 탐색 범위 (맵이 소형화되었으므로 15.0m로 축소)
@export var detection_range: float = 30.0 @export var detection_range: float = 15.0
var _auto_target_cooldown: float = 0.0 var _auto_target_cooldown: float = 0.0
......
[gd_scene load_steps=2 format=3] [gd_scene format=3 uid="uid://bqga1rvcjyydy"]
[ext_resource type="Script" path="res://src/ui/hud.gd" id="1_hud"] [ext_resource type="Script" uid="uid://c4o1mw6qth7x4" path="res://src/ui/hud.gd" id="1_hud"]
[node name="HUD" type="Control"] [node name="HUD" type="Control" unique_id=214961892]
layout_mode = 3 layout_mode = 3
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
...@@ -12,7 +12,7 @@ grow_vertical = 2 ...@@ -12,7 +12,7 @@ grow_vertical = 2
mouse_filter = 2 mouse_filter = 2
script = ExtResource("1_hud") script = ExtResource("1_hud")
[node name="TopBar" type="HBoxContainer" parent="."] [node name="TopBar" type="HBoxContainer" parent="." unique_id=1508898851]
layout_mode = 1 layout_mode = 1
anchors_preset = 10 anchors_preset = 10
anchor_right = 1.0 anchor_right = 1.0
...@@ -22,7 +22,7 @@ grow_horizontal = 2 ...@@ -22,7 +22,7 @@ grow_horizontal = 2
theme_override_constants/separation = 50 theme_override_constants/separation = 50
alignment = 1 alignment = 1
[node name="GoldLabel" type="Label" parent="TopBar"] [node name="GoldLabel" type="Label" parent="TopBar" unique_id=1809453066]
layout_mode = 2 layout_mode = 2
theme_override_colors/font_color = Color(0.94902, 0.792157, 0.098039, 1) theme_override_colors/font_color = Color(0.94902, 0.792157, 0.098039, 1)
theme_override_font_sizes/font_size = 22 theme_override_font_sizes/font_size = 22
...@@ -30,14 +30,14 @@ text = "GOLD: 300 G" ...@@ -30,14 +30,14 @@ text = "GOLD: 300 G"
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
[node name="StageLabel" type="Label" parent="TopBar"] [node name="StageLabel" type="Label" parent="TopBar" unique_id=138012181]
layout_mode = 2 layout_mode = 2
theme_override_font_sizes/font_size = 22 theme_override_font_sizes/font_size = 22
text = "STAGE: 1 / 20" text = "STAGE: 1 / 20"
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
[node name="MonsterLabel" type="Label" parent="TopBar"] [node name="MonsterLabel" type="Label" parent="TopBar" unique_id=671993822]
layout_mode = 2 layout_mode = 2
theme_override_colors/font_color = Color(0.901961, 0.098039, 0.098039, 1) theme_override_colors/font_color = Color(0.901961, 0.098039, 0.098039, 1)
theme_override_font_sizes/font_size = 22 theme_override_font_sizes/font_size = 22
...@@ -45,7 +45,7 @@ text = "MONSTERS: 0 / 200" ...@@ -45,7 +45,7 @@ text = "MONSTERS: 0 / 200"
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
[node name="BottomBar" type="HBoxContainer" parent="."] [node name="BottomBar" type="HBoxContainer" parent="." unique_id=808733547]
layout_mode = 1 layout_mode = 1
anchors_preset = 7 anchors_preset = 7
anchor_left = 0.5 anchor_left = 0.5
...@@ -60,13 +60,13 @@ grow_horizontal = 2 ...@@ -60,13 +60,13 @@ grow_horizontal = 2
grow_vertical = 0 grow_vertical = 0
alignment = 1 alignment = 1
[node name="SpawnButton" type="Button" parent="BottomBar"] [node name="SpawnButton" type="Button" parent="BottomBar" unique_id=1850876631]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
theme_override_font_sizes/font_size = 20 theme_override_font_sizes/font_size = 20
text = "SPAWN UNIT (100G)" text = "SPAWN UNIT (100G)"
[node name="ResultPopup" type="Panel" parent="."] [node name="ResultPopup" type="Panel" parent="." unique_id=1545119054]
visible = false visible = false
layout_mode = 1 layout_mode = 1
anchors_preset = 8 anchors_preset = 8
...@@ -81,7 +81,7 @@ offset_bottom = 120.0 ...@@ -81,7 +81,7 @@ offset_bottom = 120.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
[node name="ResultTitle" type="Label" parent="ResultPopup"] [node name="ResultTitle" type="Label" parent="ResultPopup" unique_id=1083843212]
layout_mode = 1 layout_mode = 1
anchors_preset = 10 anchors_preset = 10
anchor_right = 1.0 anchor_right = 1.0
...@@ -93,7 +93,7 @@ text = "VICTORY!" ...@@ -93,7 +93,7 @@ text = "VICTORY!"
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
[node name="RestartButton" type="Button" parent="ResultPopup"] [node name="RestartButton" type="Button" parent="ResultPopup" unique_id=512999509]
layout_mode = 1 layout_mode = 1
anchors_preset = 7 anchors_preset = 7
anchor_left = 0.5 anchor_left = 0.5
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment