Added team colors hash

This commit is contained in:
2020-12-31 08:41:40 -06:00
parent c44ab8e66d
commit 0b3897451e
3 changed files with 18 additions and 1 deletions

View File

@@ -2,7 +2,7 @@ class IMICRTS
class Player
attr_reader :id, :name, :color, :team, :entities, :orders, :camera, :spawnpoint
attr_reader :selected_entities
def initialize(id:, spawnpoint:, name: nil, color: Gosu::Color.rgb(rand(150..200), rand(100..200), rand(150..200)), team: nil)
def initialize(id:, spawnpoint:, name: nil, color: IMICRTS::TeamColors.values.sample, team: nil)
@id = id
@spawnpoint = spawnpoint
@name = name ? name : "Novice-#{id}"