Initial commit (1/2)
This commit is contained in:
commit
3411c5796d
66 changed files with 2261 additions and 0 deletions
21
scripts/MinimapMarker.gd
Normal file
21
scripts/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 Scale = 1024 / clamp(Ship.global_position.distance_to(Target.global_position), 512, 2048)
|
||||
Marker.scale = Vector2(Scale, Scale)
|
||||
modulate = Target.modulate
|
||||
Loading…
Add table
Add a link
Reference in a new issue