mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 13:39:02 -06:00
Compare commits
No commits in common. "52d4aeb3d09d64b458ede24fed13bce8ce736c12" and "057280362713242428659594e2ba0d669af30067" have entirely different histories.
52d4aeb3d0
...
0572803627
@ -36,7 +36,6 @@ function ReplayScene:new(replay, game_mode, ruleset)
|
|||||||
self.game.pause_time = replay["pause_time"]
|
self.game.pause_time = replay["pause_time"]
|
||||||
self.replay = deepcopy(replay)
|
self.replay = deepcopy(replay)
|
||||||
self.replay_index = 1
|
self.replay_index = 1
|
||||||
self.replay_speed = 1
|
|
||||||
DiscordRPC:update({
|
DiscordRPC:update({
|
||||||
details = "Viewing a replay",
|
details = "Viewing a replay",
|
||||||
state = self.game.name,
|
state = self.game.name,
|
||||||
@ -45,10 +44,7 @@ function ReplayScene:new(replay, game_mode, ruleset)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ReplayScene:update()
|
function ReplayScene:update()
|
||||||
local frames_left = self.replay_speed
|
|
||||||
if not self.paused then
|
if not self.paused then
|
||||||
while frames_left > 0 do
|
|
||||||
frames_left = frames_left - 1
|
|
||||||
self.inputs = self.replay["inputs"][self.replay_index]["inputs"]
|
self.inputs = self.replay["inputs"][self.replay_index]["inputs"]
|
||||||
self.replay["inputs"][self.replay_index]["frames"] = self.replay["inputs"][self.replay_index]["frames"] - 1
|
self.replay["inputs"][self.replay_index]["frames"] = self.replay["inputs"][self.replay_index]["frames"] - 1
|
||||||
if self.replay["inputs"][self.replay_index]["frames"] == 0 and self.replay_index < table.getn(self.replay["inputs"]) then
|
if self.replay["inputs"][self.replay_index]["frames"] == 0 and self.replay_index < table.getn(self.replay["inputs"]) then
|
||||||
@ -60,7 +56,6 @@ function ReplayScene:update()
|
|||||||
end
|
end
|
||||||
self.game:update(input_copy, self.ruleset)
|
self.game:update(input_copy, self.ruleset)
|
||||||
self.game.grid:update()
|
self.game.grid:update()
|
||||||
end
|
|
||||||
DiscordRPC:update({
|
DiscordRPC:update({
|
||||||
details = "Viewing a replay",
|
details = "Viewing a replay",
|
||||||
state = self.game.name,
|
state = self.game.name,
|
||||||
@ -74,11 +69,6 @@ function ReplayScene:render()
|
|||||||
love.graphics.setColor(1, 1, 1, 1)
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
love.graphics.setFont(font_3x5_3)
|
love.graphics.setFont(font_3x5_3)
|
||||||
love.graphics.printf("REPLAY", 0, 0, 635, "right")
|
love.graphics.printf("REPLAY", 0, 0, 635, "right")
|
||||||
local pauses_y_coordinate = 23
|
|
||||||
if self.replay_speed > 1 then
|
|
||||||
pauses_y_coordinate = pauses_y_coordinate + 20
|
|
||||||
love.graphics.printf(self.replay_speed.."X", 0, 20, 635, "right")
|
|
||||||
end
|
|
||||||
love.graphics.setFont(font_3x5_2)
|
love.graphics.setFont(font_3x5_2)
|
||||||
if self.game.pause_time and self.game.pause_count then
|
if self.game.pause_time and self.game.pause_count then
|
||||||
if self.game.pause_time > 0 or self.game.pause_count > 0 then
|
if self.game.pause_time > 0 or self.game.pause_count > 0 then
|
||||||
@ -87,10 +77,10 @@ function ReplayScene:render()
|
|||||||
self.game.pause_count,
|
self.game.pause_count,
|
||||||
self.game.pause_count == 1 and "" or "S",
|
self.game.pause_count == 1 and "" or "S",
|
||||||
formatTime(self.game.pause_time)
|
formatTime(self.game.pause_time)
|
||||||
), 0, pauses_y_coordinate, 635, "right")
|
), 0, 23, 635, "right")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
love.graphics.printf("?? PAUSES (--:--.--)", 0, pauses_y_coordinate, 635, "right")
|
love.graphics.printf("?? PAUSES (--:--.--)", 0, 23, 635, "right")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -114,16 +104,6 @@ function ReplayScene:onInputPress(e)
|
|||||||
self.paused = not self.paused
|
self.paused = not self.paused
|
||||||
if self.paused then pauseBGM()
|
if self.paused then pauseBGM()
|
||||||
else resumeBGM() end
|
else resumeBGM() end
|
||||||
elseif e.input == "left" then
|
|
||||||
self.replay_speed = self.replay_speed - 1
|
|
||||||
if self.replay_speed < 1 then
|
|
||||||
self.replay_speed = 1
|
|
||||||
end
|
|
||||||
elseif e.input == "right" then
|
|
||||||
self.replay_speed = self.replay_speed + 1
|
|
||||||
if self.replay_speed > 99 then
|
|
||||||
self.replay_speed = 99
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user