Yahtzee/Player.gd

40 lines
698 B
GDScript3
Raw Normal View History

2024-08-19 09:33:32 +02:00
class_name Player
var name: String
var one : int
var two : int
var three : int
var four : int
var five : int
var six : int
var three_of_a_kind : String
var four_of_a_kind : String
2024-08-19 09:33:32 +02:00
var full_house : int
var small_straight : int
var large_straight : int
var yahtzee : int
var chance : String
2024-08-19 09:33:32 +02:00
var bonus : int
var score: int
func _init(name: String):
self.name = name
self.one = 0
self.two = 0
self.three = 0
self.four = 0
self.five = 0
self.six = 0
self.three_of_a_kind = ""
self.four_of_a_kind = ""
2024-08-19 09:33:32 +02:00
self.full_house = 0
self.small_straight = 0
self.large_straight = 0
self.yahtzee = 0
self.chance = ""
2024-08-19 09:33:32 +02:00
self.bonus = 0
self.score = 0
func change_name(name: String):
self.name = name