Compare commits
16 Commits
Author | SHA1 | Date |
---|---|---|
Ishaan Bhardwaj | d0fdaf30ab | |
Aymir Dmitrievich Danilov | 8062f6e3fa | |
Ishaan Bhardwaj | 7c3cf0b1bd | |
aur9ra | 52ddbbc174 | |
Ishaan Bhardwaj | 5f81c35677 | |
Tetro48 | 635ef6270f | |
Tetro48 | 649dd5f31d | |
Ishaan Bhardwaj | 34fcc3f659 | |
Kirby703 | 4caa268adc | |
Ishaan Bhardwaj | a79552a6f3 | |
Ishaan Bhardwaj | cd90405865 | |
Ishaan Bhardwaj | e69659b2ad | |
Ishaan Bhardwaj | d90e382037 | |
infinifen | ba6f5bb837 | |
Ishaan Bhardwaj | 39e9dc3303 | |
Ishaan Bhardwaj | a1f0dfd9f2 |
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
2
main.lua
2
main.lua
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue