Added icons, a lot of refactoring and optimising
This commit is contained in:
11
Player.gd
11
Player.gd
@@ -1,3 +1,4 @@
|
||||
class_name Player
|
||||
extends Control
|
||||
|
||||
@onready
|
||||
@@ -24,18 +25,18 @@ signal player_removed
|
||||
@export
|
||||
var player_name: String
|
||||
|
||||
@export
|
||||
var player_score: String
|
||||
|
||||
var is_first_point: bool = true
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
func _ready() -> void:
|
||||
add.pressed.connect(add_point)
|
||||
minus.pressed.connect(minus_point)
|
||||
character.pressed.connect(change_character)
|
||||
remove_player.pressed.connect(func(): player_removed.emit())
|
||||
player_name_field.text = player_name
|
||||
|
||||
func new_player_name(new_name: String):
|
||||
player_name = new_name
|
||||
player_name_field.text = player_score
|
||||
|
||||
func add_point():
|
||||
if is_first_point:
|
||||
|
||||
Reference in New Issue
Block a user