mirror of
https://github.com/cyberarm/i-mic-rts.git
synced 2025-12-15 07:42:34 +00:00
Added team colors hash
This commit is contained in:
@@ -18,6 +18,7 @@ require_relative "lib/errors"
|
|||||||
require_relative "lib/window"
|
require_relative "lib/window"
|
||||||
require_relative "lib/camera"
|
require_relative "lib/camera"
|
||||||
require_relative "lib/setting"
|
require_relative "lib/setting"
|
||||||
|
require_relative "lib/team_colors"
|
||||||
|
|
||||||
require_relative "lib/states/boot"
|
require_relative "lib/states/boot"
|
||||||
require_relative "lib/states/game"
|
require_relative "lib/states/game"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ class IMICRTS
|
|||||||
class Player
|
class Player
|
||||||
attr_reader :id, :name, :color, :team, :entities, :orders, :camera, :spawnpoint
|
attr_reader :id, :name, :color, :team, :entities, :orders, :camera, :spawnpoint
|
||||||
attr_reader :selected_entities
|
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
|
@id = id
|
||||||
@spawnpoint = spawnpoint
|
@spawnpoint = spawnpoint
|
||||||
@name = name ? name : "Novice-#{id}"
|
@name = name ? name : "Novice-#{id}"
|
||||||
|
|||||||
16
lib/team_colors.rb
Normal file
16
lib/team_colors.rb
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
class IMICRTS
|
||||||
|
TeamColors = {
|
||||||
|
lightred: Gosu::Color.rgb(255, 100, 100),
|
||||||
|
red: Gosu::Color::RED,
|
||||||
|
lightblue: Gosu::Color.rgb(100, 100, 255),
|
||||||
|
blue: Gosu::Color::BLUE,
|
||||||
|
lime: Gosu::Color::GREEN,
|
||||||
|
lightgreen: Gosu::Color.rgb(50, 200, 50),
|
||||||
|
green: Gosu::Color.rgb(0, 200, 0),
|
||||||
|
orange: Gosu::Color.rgb(255, 127, 0),
|
||||||
|
gold: Gosu::Color::YELLOW,
|
||||||
|
lightgray: Gosu::Color::WHITE,
|
||||||
|
gray: Gosu::Color::GRAY,
|
||||||
|
black: Gosu::Color.rgb(25, 25, 25),
|
||||||
|
}
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user