player: make spawn @onready, make gear_slots const
This commit is contained in:
parent
2067317a09
commit
d395bb6f26
1 changed files with 4 additions and 3 deletions
|
|
@ -4,13 +4,15 @@ class_name Player extends CharacterBody3D
|
||||||
@export var jump_power = 32
|
@export var jump_power = 32
|
||||||
@export var fall_speed = 86
|
@export var fall_speed = 86
|
||||||
|
|
||||||
|
const gear_slots = ["1", "2", "3"]
|
||||||
|
|
||||||
|
@onready var spawn = Vector3(position)
|
||||||
|
|
||||||
var health = 100
|
var health = 100
|
||||||
var suspended = false
|
var suspended = false
|
||||||
var spawn = Vector3.ZERO
|
|
||||||
var direction = Vector3.ZERO
|
var direction = Vector3.ZERO
|
||||||
var target_velocity = Vector3.ZERO
|
var target_velocity = Vector3.ZERO
|
||||||
var initial_gear = null
|
var initial_gear = null
|
||||||
var gear_slots = ["1", "2", "3"]
|
|
||||||
|
|
||||||
func resize_ui():
|
func resize_ui():
|
||||||
var bpui_h = 200
|
var bpui_h = 200
|
||||||
|
|
@ -134,7 +136,6 @@ func move_player(x, z):
|
||||||
direction += camera_basis.x * x
|
direction += camera_basis.x * x
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
spawn = Vector3(position)
|
|
||||||
initial_gear = $Pivot/Container/Gear.duplicate()
|
initial_gear = $Pivot/Container/Gear.duplicate()
|
||||||
get_viewport().size_changed.connect(resize_ui)
|
get_viewport().size_changed.connect(resize_ui)
|
||||||
resize_ui()
|
resize_ui()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue