Added pause menu, refreshed solo lobby menu, added settings for storing player's color and team, misc.

This commit is contained in:
2021-01-01 19:20:05 -06:00
parent 5f301337b4
commit f3fccc8b24
13 changed files with 145 additions and 54 deletions

View File

@@ -2,19 +2,24 @@ class IMICRTS
class Director
attr_reader :current_tick, :map, :game, :players
def initialize(game:, map:, players: [], networking_mode:, tick_rate: 10)
def initialize(game:, map:, players: [], networking_mode:, tick_rate: 10, local_game: true)
@game = game
@map = map
@players = players
@connection = IMICRTS::Connection.new(director: self, mode: networking_mode)
@networking_mode = networking_mode
@tick_rate = tick_rate
@local_game = local_game
@last_tick_at = Gosu.milliseconds
@tick_time = 1000.0 / @tick_rate
@current_tick = 0
end
def local_game?
@local_game
end
def add_player(player)
@players << player
end
@@ -145,7 +150,8 @@ class IMICRTS
end
def finalize
@connection.finalize
@server&.stop
@connection&.finalize
end
end
end