mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-12-22 07:19:02 -06:00
Fixed the replay system's interaction with secret inputs
This commit is contained in:
parent
06225bd35a
commit
d4360b3662
@ -9,6 +9,7 @@ function GameScene:new(game_mode, ruleset, inputs)
|
||||
self.retry_ruleset = ruleset
|
||||
self.secret_inputs = inputs
|
||||
self.game = game_mode(self.secret_inputs)
|
||||
self.game.secret_inputs = inputs
|
||||
self.ruleset = ruleset(self.game)
|
||||
self.game:initialize(self.ruleset)
|
||||
self.inputs = {
|
||||
|
@ -4,14 +4,14 @@ local ReplayScene = Scene:extend()
|
||||
|
||||
ReplayScene.title = "Replay"
|
||||
|
||||
function ReplayScene:new(replay, game_mode, ruleset, inputs)
|
||||
function ReplayScene:new(replay, game_mode, ruleset)
|
||||
config.gamesettings = replay["gamesettings"]
|
||||
love.math.setRandomSeed(replay["random_low"], replay["random_high"])
|
||||
love.math.setRandomState(replay["random_state"])
|
||||
self.retry_replay = replay
|
||||
self.retry_mode = game_mode
|
||||
self.retry_ruleset = ruleset
|
||||
self.secret_inputs = inputs
|
||||
self.secret_inputs = replay["secret_inputs"]
|
||||
self.game = game_mode(self.secret_inputs)
|
||||
self.game.save_replay = false
|
||||
self.ruleset = ruleset(self.game)
|
||||
|
@ -170,8 +170,7 @@ function ReplaySelectScene:onInputPress(e)
|
||||
scene = ReplayScene(
|
||||
replays[self.menu_state.replay],
|
||||
mode,
|
||||
rules,
|
||||
replays[self.menu_state.replay]["secret_inputs"]
|
||||
rules
|
||||
)
|
||||
elseif e.input == "up" or e.scancode == "up" then
|
||||
self:changeOption(-1)
|
||||
|
@ -16,11 +16,10 @@ GameMode.hash = ""
|
||||
GameMode.tagline = ""
|
||||
GameMode.rollOpacityFunction = function(age) return 0 end
|
||||
|
||||
function GameMode:new(secret_inputs)
|
||||
function GameMode:new()
|
||||
self.replay_inputs = {}
|
||||
self.random_low, self.random_high = love.math.getRandomSeed()
|
||||
self.random_state = love.math.getRandomState()
|
||||
self.secret_inputs = secret_inputs
|
||||
self.save_replay = config.gamesettings.save_replay == 1
|
||||
|
||||
self.grid = Grid(10, 24)
|
||||
|
Loading…
Reference in New Issue
Block a user