Compare commits

..

14 Commits

Author SHA1 Message Date
Ishaan Bhardwaj
7c3cf0b1bd Merge pull request #79 from aur9ra/feat-save-replay-once-per-game-only
Ensure replays are only saved once per game
2023-08-25 19:28:34 -04:00
aur9ra
52ddbbc174 Ensure replays are only saved once per game 2023-08-20 22:22:36 -07:00
Ishaan Bhardwaj
5f81c35677 Merge pull request #78 from Tetro48/replay-qol
Replay frame stepping
2023-08-14 11:26:56 -04:00
Tetro48
635ef6270f Changed frame step input to rotate_left 2023-08-14 21:52:22 +07:00
Tetro48
649dd5f31d Added frame stepping for replays
`menu_decide` for frame step action is temporary
2023-08-14 21:46:00 +07:00
Ishaan Bhardwaj
34fcc3f659 Merge pull request #77 from Kirby703/master-1
easter egg
2023-08-13 15:49:56 -04:00
Kirby703
4caa268adc easter egg
scholars remain divided on whether 15640 frames should also be rounded up so as to never jump by .03, or whether it should remain rounded down so as to only have one exceptional timestamp rather than two
2023-08-13 13:51:36 -04:00
Ishaan Bhardwaj
a79552a6f3 Pitching BGM added and implemented in replays 2023-07-30 04:53:23 -04:00
Ishaan Bhardwaj
cd90405865 Simplified Big A2 code 2023-07-27 06:00:48 -04:00
Ishaan Bhardwaj
e69659b2ad Changed the order of the image extensions list
To avoid Funny Stuff
2023-07-26 05:20:55 -04:00
Ishaan Bhardwaj
d90e382037 Merge pull request #76 from infinifen/survival-2020-math-fix
Fix a typo causing crashes in Survival 2020 level 1500+
2023-07-22 11:29:39 -04:00
infinifen
ba6f5bb837 Fix a typo causing crashes in Survival 2020 level 1500+ 2023-07-22 13:21:21 +02:00
Ishaan Bhardwaj
39e9dc3303 Fixed pressing F8 twice at the title screen 2023-07-21 22:55:00 -04:00
Ishaan Bhardwaj
a1f0dfd9f2 Hotfix: Key config screen draws the correct background 2023-07-16 18:40:10 -04:00
11 changed files with 36 additions and 41 deletions

View File

@@ -60,6 +60,9 @@ function formatTime(frames)
min = math.floor(frames/3600) min = math.floor(frames/3600)
sec = math.floor(frames/60) % 60 sec = math.floor(frames/60) % 60
hund = math.floor(frames/.6) % 100 hund = math.floor(frames/.6) % 100
if frames == 15641 then
hund = math.ceil(frames/.6) % 100
end
str = string.format("%02d:%02d.%02d", min, sec, hund) str = string.format("%02d:%02d.%02d", min, sec, hund)
return str return str
end end

View File

@@ -6,6 +6,7 @@ bgm = {
} }
local current_bgm = nil local current_bgm = nil
local pitch = 1
local bgm_locked = false local bgm_locked = false
function switchBGM(sound, subsound) function switchBGM(sound, subsound)
@@ -84,5 +85,13 @@ end
function resumeBGM() function resumeBGM()
if current_bgm ~= nil then if current_bgm ~= nil then
current_bgm:play() current_bgm:play()
current_bgm:setPitch(pitch)
end
end
function pitchBGM(new_pitch)
pitch = new_pitch
if current_bgm ~= nil then
current_bgm:setPitch(pitch)
end end
end end

View File

@@ -4,7 +4,7 @@ named_backgrounds = {
} }
current_playing_bgs = {} current_playing_bgs = {}
extended_bgs = {} extended_bgs = {}
image_formats = {".png", ".jpg"} image_formats = {".jpg", ".png"}
bgpath = "res/backgrounds/" bgpath = "res/backgrounds/"
dir = love.filesystem.getDirectoryItems(bgpath) dir = love.filesystem.getDirectoryItems(bgpath)

View File

@@ -113,7 +113,7 @@ function love.keypressed(key, scancode)
saveConfig() saveConfig()
scene.restart_message = true scene.restart_message = true
if config.secret then playSE("mode_decide") if config.secret then playSE("mode_decide")
else playSE("erase") end else playSE("erase", "single") end
-- f12 is reserved for saving screenshots -- f12 is reserved for saving screenshots
elseif scancode == "f12" then elseif scancode == "f12" then
local ss_name = os.date("ss/%Y-%m-%d_%H-%M-%S.png") local ss_name = os.date("ss/%Y-%m-%d_%H-%M-%S.png")

View File

@@ -81,6 +81,7 @@ function GameScene:onInputPress(e)
scene = e.input == "retry" and GameScene(self.retry_mode, self.retry_ruleset, self.secret_inputs) or ModeSelectScene() scene = e.input == "retry" and GameScene(self.retry_mode, self.retry_ruleset, self.secret_inputs) or ModeSelectScene()
elseif e.input == "retry" then elseif e.input == "retry" then
switchBGM(nil) switchBGM(nil)
pitchBGM(1)
self.game:onExit() self.game:onExit()
scene = GameScene(self.retry_mode, self.retry_ruleset, self.secret_inputs) scene = GameScene(self.retry_mode, self.retry_ruleset, self.secret_inputs)
elseif e.input == "pause" and not (self.game.game_over or self.game.completed) then elseif e.input == "pause" and not (self.game.game_over or self.game.completed) then

View File

@@ -45,7 +45,7 @@ end
function KeyConfigScene:render() function KeyConfigScene:render()
love.graphics.setColor(1, 1, 1, 1) love.graphics.setColor(1, 1, 1, 1)
drawBackground("input_config") drawBackground("options_input")
love.graphics.setFont(font_3x5_2) love.graphics.setFont(font_3x5_2)
for i, input in ipairs(configurable_inputs) do for i, input in ipairs(configurable_inputs) do

View File

@@ -38,6 +38,7 @@ function ReplayScene:new(replay, game_mode, ruleset)
self.replay_index = 1 self.replay_index = 1
self.replay_speed = 1 self.replay_speed = 1
self.show_invisible = false self.show_invisible = false
self.frame_steps = 0
DiscordRPC:update({ DiscordRPC:update({
details = "Viewing a replay", details = "Viewing a replay",
state = self.game.name, state = self.game.name,
@@ -47,7 +48,10 @@ end
function ReplayScene:update() function ReplayScene:update()
local frames_left = self.replay_speed local frames_left = self.replay_speed
if not self.paused then if not self.paused or self.frame_steps > 0 then
if self.frame_steps > 0 then
self.frame_steps = self.frame_steps - 1
end
while frames_left > 0 do while frames_left > 0 do
frames_left = frames_left - 1 frames_left = frames_left - 1
self.inputs = self.replay["inputs"][self.replay_index]["inputs"] self.inputs = self.replay["inputs"][self.replay_index]["inputs"]
@@ -107,6 +111,8 @@ function ReplayScene:onInputPress(e)
e.input == "menu_decide" or e.input == "menu_decide" or
e.input == "retry" e.input == "retry"
) then ) then
switchBGM(nil)
pitchBGM(1)
self.game:onExit() self.game:onExit()
loadSave() loadSave()
love.math.setRandomSeed(os.time()) love.math.setRandomSeed(os.time())
@@ -121,16 +127,21 @@ 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
--frame step
elseif e.input == "rotate_left" then
self.frame_steps = self.frame_steps + 1
elseif e.input == "left" then elseif e.input == "left" then
self.replay_speed = self.replay_speed - 1 self.replay_speed = self.replay_speed - 1
if self.replay_speed < 1 then if self.replay_speed < 1 then
self.replay_speed = 1 self.replay_speed = 1
end end
pitchBGM(self.replay_speed)
elseif e.input == "right" then elseif e.input == "right" then
self.replay_speed = self.replay_speed + 1 self.replay_speed = self.replay_speed + 1
if self.replay_speed > 99 then if self.replay_speed > 99 then
self.replay_speed = 99 self.replay_speed = 99
end end
pitchBGM(self.replay_speed)
elseif e.input == "hold" then elseif e.input == "hold" then
self.show_invisible = not self.show_invisible self.show_invisible = not self.show_invisible
end end

View File

@@ -47,8 +47,6 @@ function ReplaySelectScene:new()
end end
function ReplaySelectScene:update() function ReplaySelectScene:update()
switchBGM(nil) -- experimental
if self.das_up or self.das_down or self.das_left or self.das_right then if self.das_up or self.das_down or self.das_left or self.das_right then
self.das = self.das + 1 self.das = self.das + 1
else else

View File

@@ -10,41 +10,10 @@ BigA2Game.tagline = "Big blocks in the most celebrated TGM mode!"
function BigA2Game:new() function BigA2Game:new()
BigA2Game.super:new() BigA2Game.super:new()
self.big_mode = true self.big_mode = true
local getClearedRowCount = self.grid.getClearedRowCount
self.grid.getClearedRowCount = function(self)
return getClearedRowCount(self) / 2
end end
function BigA2Game:updateScore(level, drop_bonus, cleared_lines)
cleared_lines = cleared_lines / 2
if not self.clear then
self:updateGrade(cleared_lines)
if cleared_lines >= 4 then
self.tetris_count = self.tetris_count + 1
end
if self.grid:checkForBravo(cleared_lines) then self.bravo = 4 else self.bravo = 1 end
if cleared_lines > 0 then
self.combo = self.combo + (cleared_lines - 1) * 2
self.score = self.score + (
(math.ceil((level + cleared_lines) / 4) + drop_bonus) *
cleared_lines * self.combo * self.bravo
)
else
self.combo = 1
end
self.drop_bonus = 0
else self.lines = self.lines + cleared_lines end
end
function BigA2Game:onLineClear(cleared_row_count)
cleared_row_count = cleared_row_count / 2
self:updateSectionTimes(self.level, self.level + cleared_row_count)
self.level = math.min(self.level + cleared_row_count, 999)
if self.level == 999 and not self.clear then
self.clear = true
self.grid:clear()
if self:qualifiesForMRoll() then self.grade = 32 end
self.roll_frames = -150
end
self.lock_drop = self.level >= 900
self.lock_hard_drop = self.level >= 900
end end
return BigA2Game return BigA2Game

View File

@@ -179,6 +179,9 @@ function GameMode:update(inputs, ruleset)
if self.game_over or self.completed then if self.game_over or self.completed then
if self.save_replay and self.game_over_frames == 0 then if self.save_replay and self.game_over_frames == 0 then
self:saveReplay() self:saveReplay()
-- ensure replays are only saved once per game, incase self.game_over_frames == 0 for longer than one frame
self.save_replay = false
end end
self.game_over_frames = self.game_over_frames + 1 self.game_over_frames = self.game_over_frames + 1
return return
@@ -400,6 +403,7 @@ end
function GameMode:onGameOver() function GameMode:onGameOver()
switchBGM(nil) switchBGM(nil)
pitchBGM(1)
local alpha = 0 local alpha = 0
local animation_length = 120 local animation_length = 120
if self.game_over_frames < animation_length then if self.game_over_frames < animation_length then

View File

@@ -201,7 +201,7 @@ end
Survival2020Game.opacityFunction = function(age) Survival2020Game.opacityFunction = function(age)
if age > 300 then return 0 if age > 300 then return 0
else return 1 - Math.max(age - 240, 0) / 60 end else return 1 - math.max(age - 240, 0) / 60 end
end end
function Survival2020Game:drawGrid() function Survival2020Game:drawGrid()