added vertical indicators to minimap
This commit is contained in:
@@ -464,7 +464,6 @@ size = Vector2(2, 2)
|
|||||||
|
|
||||||
[node name="TextureCatcher" type="Node3D"]
|
[node name="TextureCatcher" type="Node3D"]
|
||||||
script = ExtResource("1_x3mk2")
|
script = ExtResource("1_x3mk2")
|
||||||
path = null
|
|
||||||
|
|
||||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||||
environment = SubResource("Environment_w2vw8")
|
environment = SubResource("Environment_w2vw8")
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ config_version=5
|
|||||||
|
|
||||||
config/name="First Person Test"
|
config/name="First Person Test"
|
||||||
config/tags=PackedStringArray("fps")
|
config/tags=PackedStringArray("fps")
|
||||||
run/main_scene="uid://f7e0v1r6ra6c"
|
run/main_scene="uid://b55ukxds1s7ih"
|
||||||
config/features=PackedStringArray("4.4", "Forward Plus")
|
config/features=PackedStringArray("4.4", "Forward Plus")
|
||||||
config/icon="uid://6svuq1l83al5"
|
config/icon="uid://6svuq1l83al5"
|
||||||
|
|
||||||
|
|||||||
21
scenes/01_scene_tester.tscn
Normal file
21
scenes/01_scene_tester.tscn
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
[gd_scene load_steps=6 format=3 uid="uid://dsw00ml8rv6xo"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://bkii8jwf0k7tq" path="res://scripts/LevelManager.gd" id="1_u5qw2"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://drwae3loscbw7" path="res://assets/player.tscn" id="2_ex268"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dsnddbrlqkav2" path="res://scenes/enemy_working_scene.tscn" id="2_u5qw2"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cwy8iv8nlwqrc" path="res://assets/realtime_day_night_cycle.tscn" id="3_fj0pb"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bj1y0fbjtul4a" path="res://post_processing.tscn" id="4_7toka"]
|
||||||
|
|
||||||
|
[node name="SceneTester" type="Node3D"]
|
||||||
|
script = ExtResource("1_u5qw2")
|
||||||
|
|
||||||
|
[node name="EnemyWork" parent="." instance=ExtResource("2_u5qw2")]
|
||||||
|
|
||||||
|
[node name="Player" parent="." instance=ExtResource("2_ex268")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.404936, 2.07023, 0)
|
||||||
|
|
||||||
|
[node name="Realtime Day Night Cycle" parent="." instance=ExtResource("3_fj0pb")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -23.11, 0.822842, -32.3024)
|
||||||
|
|
||||||
|
[node name="PostProcessing" parent="." instance=ExtResource("4_7toka")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.12741, -1.19209e-07, 2.36528)
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=18 format=3 uid="uid://dsnddbrlqkav2"]
|
[gd_scene load_steps=17 format=3 uid="uid://dsnddbrlqkav2"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://pm8n67yhip1p" path="res://scripts/sublevel.gd" id="1_8cuhv"]
|
[ext_resource type="Script" uid="uid://pm8n67yhip1p" path="res://scripts/sublevel.gd" id="1_8cuhv"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c7dhavrt11u55" path="res://enemy_spawner.tscn" id="3_q77vb"]
|
[ext_resource type="PackedScene" uid="uid://c7dhavrt11u55" path="res://enemy_spawner.tscn" id="3_q77vb"]
|
||||||
@@ -12,7 +12,6 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://bj1y0fbjtul4a" path="res://post_processing.tscn" id="16_p7sg0"]
|
[ext_resource type="PackedScene" uid="uid://bj1y0fbjtul4a" path="res://post_processing.tscn" id="16_p7sg0"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dc0fxhbw6x1h3" path="res://tube_top.tscn" id="17_2h4hu"]
|
[ext_resource type="PackedScene" uid="uid://dc0fxhbw6x1h3" path="res://tube_top.tscn" id="17_2h4hu"]
|
||||||
[ext_resource type="PackedScene" uid="uid://20csd6dmwj4y" path="res://assets/jump_platform.tscn" id="17_8q5j4"]
|
[ext_resource type="PackedScene" uid="uid://20csd6dmwj4y" path="res://assets/jump_platform.tscn" id="17_8q5j4"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bessq6hl7qsh8" path="res://assets/stats.tscn" id="18_e13cr"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://hp4xn8oqdxnd" path="res://assets/machete_pickup.tscn" id="18_jev3u"]
|
[ext_resource type="PackedScene" uid="uid://hp4xn8oqdxnd" path="res://assets/machete_pickup.tscn" id="18_jev3u"]
|
||||||
|
|
||||||
[sub_resource type="NavigationMesh" id="NavigationMesh_8aw3d"]
|
[sub_resource type="NavigationMesh" id="NavigationMesh_8aw3d"]
|
||||||
@@ -336,9 +335,6 @@ jump_amount = 15
|
|||||||
[node name="JumpPlatform2" parent="." instance=ExtResource("17_8q5j4")]
|
[node name="JumpPlatform2" parent="." instance=ExtResource("17_8q5j4")]
|
||||||
transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, -48.8083, 20.0922, 71.9636)
|
transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, -48.8083, 20.0922, 71.9636)
|
||||||
|
|
||||||
[node name="Stats" parent="." instance=ExtResource("18_e13cr")]
|
|
||||||
transform = Transform3D(-0.98212, 0, 0.188255, 0, 1, 0, -0.188255, 0, -0.98212, -9.74921, 1.4638, 18.3839)
|
|
||||||
|
|
||||||
[node name="machete_pickup" parent="." instance=ExtResource("18_jev3u")]
|
[node name="machete_pickup" parent="." instance=ExtResource("18_jev3u")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -12.2403, 0.327792, 14.4257)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -12.2403, 0.327792, 14.4257)
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ tube_top = NodePath("TubeTop")
|
|||||||
|
|
||||||
[node name="Assassinate VIP" type="Node" parent="Mods"]
|
[node name="Assassinate VIP" type="Node" parent="Mods"]
|
||||||
script = ExtResource("2_qmrvu")
|
script = ExtResource("2_qmrvu")
|
||||||
time_to_kill = 20.0
|
time_to_kill = 20000.0
|
||||||
|
|
||||||
[node name="Level" type="Node3D" parent="."]
|
[node name="Level" type="Node3D" parent="."]
|
||||||
script = ExtResource("3_25f4w")
|
script = ExtResource("3_25f4w")
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ func update_timer(label):
|
|||||||
SignalBus.emit_signal("ui_timer_update",label,rounded_timer)
|
SignalBus.emit_signal("ui_timer_update",label,rounded_timer)
|
||||||
|
|
||||||
func check_killed_target(enemy):
|
func check_killed_target(enemy):
|
||||||
print("ENEMY KILLED : ",enemy)
|
|
||||||
if enemy == target_enemy:
|
if enemy == target_enemy:
|
||||||
timer = time_to_kill
|
timer = time_to_kill
|
||||||
target_enemy = null
|
target_enemy = null
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
@export var hud : Node
|
@export var hud : Node
|
||||||
|
@export var redraw_time : float = 1.0
|
||||||
|
@export var show_vertical_difference : bool = true
|
||||||
|
|
||||||
## SETTINGS
|
## SETTINGS
|
||||||
const MINIMAP_POINT_RADIUS :float = 10.0
|
const MINIMAP_POINT_RADIUS :float = 10.0
|
||||||
@@ -9,7 +10,9 @@ const MINIMAP_DISPLAY_RADIUS : float = 200.0
|
|||||||
const MINIMAP_MAX_OPACITY : float = .75
|
const MINIMAP_MAX_OPACITY : float = .75
|
||||||
const ERASE_BUFFER_TIME = -10.0
|
const ERASE_BUFFER_TIME = -10.0
|
||||||
const MAX_PRIORITY_SIZE = 4
|
const MAX_PRIORITY_SIZE = 4
|
||||||
|
const MAX_VERTICAL_TICK_LENGTH = 20
|
||||||
|
|
||||||
|
var redraw_timer = redraw_time
|
||||||
var draw_delta_time
|
var draw_delta_time
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
@@ -31,6 +34,8 @@ func update_minimap():
|
|||||||
var player_pos_h = Vector2(player.global_position.x,player.global_position.z)
|
var player_pos_h = Vector2(player.global_position.x,player.global_position.z)
|
||||||
var point_pos_h = Vector2(point["position"].x,point["position"].z)
|
var point_pos_h = Vector2(point["position"].x,point["position"].z)
|
||||||
var h_direction = player.global_transform.looking_at(point["position"],Vector3.UP).basis.get_euler().y
|
var h_direction = player.global_transform.looking_at(point["position"],Vector3.UP).basis.get_euler().y
|
||||||
|
var v_direction = player.global_position.y - point["position"].y
|
||||||
|
|
||||||
|
|
||||||
var alpha_fade = clamp(MINIMAP_MAX_OPACITY * clamp(point["timer"],0,1),0,MINIMAP_MAX_OPACITY)
|
var alpha_fade = clamp(MINIMAP_MAX_OPACITY * clamp(point["timer"],0,1),0,MINIMAP_MAX_OPACITY)
|
||||||
var color_modified = Color(point["color"].r,point["color"].g,point["color"].b,alpha_fade)
|
var color_modified = Color(point["color"].r,point["color"].g,point["color"].b,alpha_fade)
|
||||||
@@ -42,8 +47,18 @@ func update_minimap():
|
|||||||
var point_pos = Vector2(x,y)
|
var point_pos = Vector2(x,y)
|
||||||
|
|
||||||
var priority_clamped = clamp(point["priority"],1,MAX_PRIORITY_SIZE)
|
var priority_clamped = clamp(point["priority"],1,MAX_PRIORITY_SIZE)
|
||||||
|
var v_indicator_clamped = Vector2(0,clamp(v_direction * 5,-MAX_VERTICAL_TICK_LENGTH * priority_clamped,MAX_VERTICAL_TICK_LENGTH * priority_clamped))
|
||||||
|
var line_offset_dir
|
||||||
|
if v_indicator_clamped.y > 0:
|
||||||
|
line_offset_dir = 1
|
||||||
|
else:
|
||||||
|
line_offset_dir = -1
|
||||||
|
|
||||||
draw_circle(point_pos,MINIMAP_POINT_RADIUS * priority_clamped,color_modified,true)
|
draw_circle(point_pos,MINIMAP_POINT_RADIUS * priority_clamped,color_modified,true)
|
||||||
|
var line_offset = Vector2(0,line_offset_dir * MINIMAP_POINT_RADIUS * priority_clamped)
|
||||||
|
if show_vertical_difference:
|
||||||
|
draw_line(point_pos + line_offset,point_pos + v_indicator_clamped,color_modified,4)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if point["timer"] > ERASE_BUFFER_TIME:
|
if point["timer"] > ERASE_BUFFER_TIME:
|
||||||
point["timer"] -= draw_delta_time
|
point["timer"] -= draw_delta_time
|
||||||
|
|||||||
Reference in New Issue
Block a user