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
16
scripts/Ship/player_camera.gd
Normal file
16
scripts/Ship/player_camera.gd
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
extends Camera2D
|
||||
|
||||
## Desired value of zoom
|
||||
@export var normal_zoom: float = 0.4
|
||||
## Value of hull's scalar_velocity where zoom will be equal to normal_zoom
|
||||
@export var normal_zoom_velocity: float = 200.0
|
||||
## Maximum value of zoom
|
||||
@export var max_zoom: float = 0.5
|
||||
## Shortcut to get_parent()
|
||||
@onready var ship: PlayerShip = get_parent()
|
||||
|
||||
func _process(_delta):
|
||||
var scalar_velocity = ship.hull.scalar_velocity
|
||||
zoom = Vector2(1, 1) * normal_zoom * (normal_zoom_velocity / (scalar_velocity + 1))
|
||||
if zoom.x > max_zoom:
|
||||
zoom = Vector2(1, 1) * max_zoom
|
||||
Loading…
Add table
Add a link
Reference in a new issue