Rewriting ships: Added some player interface and started rewriting star system
This commit is contained in:
parent
6957169ba5
commit
4172b336c1
20 changed files with 300 additions and 139 deletions
|
|
@ -1,11 +1,15 @@
|
|||
extends ColorRect
|
||||
|
||||
@onready var ship = get_tree().current_scene.get_node("MainShip")
|
||||
@onready var space = get_tree().current_scene
|
||||
## Node which will change offset. If null, offset is constant
|
||||
@export var tracked_node: Node2D
|
||||
## Shortcut to get_parent()
|
||||
@onready var star_system = get_parent()
|
||||
## Color of nebula.
|
||||
@export var color_background: Color
|
||||
|
||||
func _ready():
|
||||
material.set_shader_parameter("nebula_color", color_background)
|
||||
|
||||
func _physics_process(_delta):
|
||||
material.set_shader_parameter("offset",ship.global_position)
|
||||
|
||||
|
||||
func _on_space_updated_colors():
|
||||
material.set_shader_parameter("nebula_color",space.color_background)
|
||||
if tracked_node != null:
|
||||
material.set_shader_parameter("offset", tracked_node.global_position)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue