Compare commits

...

16 Commits

Author SHA1 Message Date
Ishaan Bhardwaj d0fdaf30ab
Merge pull request #81 from Tetro48/std-rs-lockpatch
Patch standard.lua to prevent midair lock
2023-10-19 04:27:06 -04:00
Aymir Dmitrievich Danilov 8062f6e3fa
Patch standard.lua to prevent midair lock 2023-10-19 14:33:25 +07:00
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
12 changed files with 38 additions and 41 deletions

View File

@ -60,6 +60,9 @@ function formatTime(frames)
min = math.floor(frames/3600)
sec = math.floor(frames/60) % 60
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)
return str
end

View File

@ -6,6 +6,7 @@ bgm = {
}
local current_bgm = nil
local pitch = 1
local bgm_locked = false
function switchBGM(sound, subsound)
@ -84,5 +85,13 @@ end
function resumeBGM()
if current_bgm ~= nil then
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

View File

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

View File

@ -113,7 +113,7 @@ function love.keypressed(key, scancode)
saveConfig()
scene.restart_message = true
if config.secret then playSE("mode_decide")
else playSE("erase") end
else playSE("erase", "single") end
-- f12 is reserved for saving screenshots
elseif scancode == "f12" then
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()
elseif e.input == "retry" then
switchBGM(nil)
pitchBGM(1)
self.game:onExit()
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

View File

@ -45,7 +45,7 @@ end
function KeyConfigScene:render()
love.graphics.setColor(1, 1, 1, 1)
drawBackground("input_config")
drawBackground("options_input")
love.graphics.setFont(font_3x5_2)
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_speed = 1
self.show_invisible = false
self.frame_steps = 0
DiscordRPC:update({
details = "Viewing a replay",
state = self.game.name,
@ -47,7 +48,10 @@ end
function ReplayScene:update()
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
frames_left = frames_left - 1
self.inputs = self.replay["inputs"][self.replay_index]["inputs"]
@ -107,6 +111,8 @@ function ReplayScene:onInputPress(e)
e.input == "menu_decide" or
e.input == "retry"
) then
switchBGM(nil)
pitchBGM(1)
self.game:onExit()
loadSave()
love.math.setRandomSeed(os.time())
@ -121,16 +127,21 @@ function ReplayScene:onInputPress(e)
self.paused = not self.paused
if self.paused then pauseBGM()
else resumeBGM() end
--frame step
elseif e.input == "rotate_left" then
self.frame_steps = self.frame_steps + 1
elseif e.input == "left" then
self.replay_speed = self.replay_speed - 1
if self.replay_speed < 1 then
self.replay_speed = 1
end
pitchBGM(self.replay_speed)
elseif e.input == "right" then
self.replay_speed = self.replay_speed + 1
if self.replay_speed > 99 then
self.replay_speed = 99
end
pitchBGM(self.replay_speed)
elseif e.input == "hold" then
self.show_invisible = not self.show_invisible
end

View File

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

View File

@ -10,41 +10,10 @@ BigA2Game.tagline = "Big blocks in the most celebrated TGM mode!"
function BigA2Game:new()
BigA2Game.super:new()
self.big_mode = true
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
local getClearedRowCount = self.grid.getClearedRowCount
self.grid.getClearedRowCount = function(self)
return getClearedRowCount(self) / 2
end
self.lock_drop = self.level >= 900
self.lock_hard_drop = self.level >= 900
end
return BigA2Game

View File

@ -179,6 +179,9 @@ function GameMode:update(inputs, ruleset)
if self.game_over or self.completed then
if self.save_replay and self.game_over_frames == 0 then
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
self.game_over_frames = self.game_over_frames + 1
return
@ -400,6 +403,7 @@ end
function GameMode:onGameOver()
switchBGM(nil)
pitchBGM(1)
local alpha = 0
local animation_length = 120
if self.game_over_frames < animation_length then

View File

@ -201,7 +201,7 @@ end
Survival2020Game.opacityFunction = function(age)
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
function Survival2020Game:drawGrid()

View File

@ -93,6 +93,8 @@ function SRS:onPieceMove(piece, grid)
if piece.manipulations >= SRS.MANIPULATIONS_MAX then
piece.locked = true
end
else
piece.locked = false
end
end