Done refactoring
This commit is contained in:
parent
3a136ff215
commit
2176e9d798
88 changed files with 821 additions and 880 deletions
21
scripts/objects/MinimapMarker.gd
Normal file
21
scripts/objects/MinimapMarker.gd
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
extends Node2D
|
||||
|
||||
@onready var marker = $MarkerSprite
|
||||
@onready var ship = $"../../../.."
|
||||
|
||||
var target : Node2D
|
||||
var type = "hostile"
|
||||
var tmi = {
|
||||
"hostile": 0,
|
||||
"base": 1,
|
||||
"loot": 2
|
||||
}
|
||||
|
||||
func _ready():
|
||||
marker.frame = tmi[type]
|
||||
|
||||
func _process(_delta):
|
||||
rotation = ship.global_position.angle_to_point(target.global_position)
|
||||
var sp_scale = 1024 / clamp(ship.global_position.distance_to(target.global_position), 512, 2048)
|
||||
marker.scale = Vector2(sp_scale, sp_scale)
|
||||
modulate = target.modulate
|
||||
Loading…
Add table
Add a link
Reference in a new issue