Compare commits

..

38 Commits

Author SHA1 Message Date
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
Ishaan Bhardwaj
2a21484137 Bump version to v0.3.4 2023-07-16 02:02:55 -04:00
Ishaan Bhardwaj
50410958f0 Re-add clamp for backgrounds beyond the limit 2023-07-16 01:54:20 -04:00
Ishaan Bhardwaj
6fb583e463 Typo fix 2023-07-16 01:52:02 -04:00
Ishaan Bhardwaj
91c8dc3dcc Bump version to v0.3.3.3 2023-07-16 01:50:42 -04:00
Ishaan Bhardwaj
2166a3c6d8 Added support for backgrounds that are not 1280x960 2023-07-16 01:49:26 -04:00
Ishaan Bhardwaj
1556b247fe Style fixes for last pull request 2023-07-16 01:06:06 -04:00
Ishaan Bhardwaj
23d9feb357 Merge pull request #74 from aur9ra/add-video-background-support
Add video background support
2023-07-16 00:48:35 -04:00
Ishaan Bhardwaj
c693871621 Added error handling in the case of a corrupt replay 2023-07-16 00:46:45 -04:00
aur9ra
2ba3611c56 Added support for video backgrounds 2023-07-15 21:28:03 -07:00
aur9ra
602e7105ab Merge branch 'master' into add-video-background-support 2023-07-14 23:23:49 -07:00
Ishaan Bhardwaj
7199aa7ef6 BGM playing changes and bugfixes 2023-07-15 02:18:43 -04:00
Ishaan Bhardwaj
a972c31d9a Merge pull request #73 from aur9ra/feat-show-invis-in-replay-option
show invis in replay
2023-07-15 01:59:07 -04:00
aur9ra
02f314997d Removed unnecessary change 2023-07-14 22:55:10 -07:00
aur9ra
4769daedf4 Added show invis support to replays. 2023-07-14 22:50:16 -07:00
aur9ra
4478c07acf First commit, WIP 2023-07-14 17:54:35 -07:00
Ishaan Bhardwaj
52d4aeb3d0 Merge branch 'Tetro48-replay-qol' 2023-07-10 20:51:02 -04:00
Ishaan Bhardwaj
91279c9f38 Merge branch 'replay-qol' of https://github.com/Tetro48/cambridge into Tetro48-replay-qol 2023-07-10 20:50:44 -04:00
Ishaan Bhardwaj
0572803627 Fixed a slight indentation error 2023-07-09 22:35:07 -04:00
Tetro48
1fef7b4880 Added replay fast-forwarding 2023-07-10 08:58:09 +07:00
Ishaan Bhardwaj
e09b044de4 Merge pull request #71 from Kirby703/patch-13
fix lategame levelling bug
2023-07-09 20:45:35 -04:00
Kirby703
7d6f783c40 fix lategame levelling bug 2023-07-09 20:06:27 -04:00
Ishaan Bhardwaj
9d365f61a7 Merge pull request #70 from Kirby703/patch-12
fix duplicate cool at 2000
2023-07-09 15:44:04 -04:00
Kirby703
082697c3cd fix duplicate cool at 2000
now you have to survive the roll for gm! terrifying
2023-07-09 15:41:19 -04:00
Ishaan Bhardwaj
788aa11470 Bump version to v0.3.3.2 2023-07-07 18:16:34 -04:00
Ishaan Bhardwaj
a303e82b90 Merge branch 'master' of https://github.com/millabasset/cambridge 2023-07-07 18:14:20 -04:00
Ishaan Bhardwaj
b06d03c4e6 Fix bravo detection 2023-07-07 18:14:17 -04:00
Ishaan Bhardwaj
a6b8abff6d Merge pull request #69 from Kirby703/patch-11
hotfix cool logic
2023-07-07 17:19:24 -04:00
Kirby703
bdc317c3c5 hotfix cool logic 2023-07-07 17:10:24 -04:00
Ishaan Bhardwaj
71c9147a2c Merge pull request #68 from Kirby703/patch-10
re-add 180s and IRS wallkicks after inheritance change
2023-07-04 02:38:52 -04:00
Kirby703
79d706a415 re-add 180s and IRS wallkicks after inheritance change
fixes results of 323c457809
2023-07-04 02:27:04 -04:00
Ishaan Bhardwaj
5fa144f146 Fix Marathon 2020 section cool highlighting 2023-07-02 19:47:39 -04:00
23 changed files with 240 additions and 160 deletions

View File

@@ -6,14 +6,17 @@ bgm = {
} }
local current_bgm = nil local current_bgm = nil
local pitch = 1
local bgm_locked = false local bgm_locked = false
local unfocused = false
function switchBGM(sound, subsound) function switchBGM(sound, subsound)
if bgm_locked then
return
end
if current_bgm ~= nil then if current_bgm ~= nil then
current_bgm:stop() current_bgm:stop()
end end
if bgm_locked or config.bgm_volume <= 0 then if config.bgm_volume <= 0 then
current_bgm = nil current_bgm = nil
elseif sound ~= nil then elseif sound ~= nil then
if subsound ~= nil then if subsound ~= nil then
@@ -67,25 +70,28 @@ function processBGMFadeout(dt)
fadeout_time = 0 fadeout_time = 0
fading_bgm = false fading_bgm = false
end end
current_bgm:setVolume(fadeout_time * config.bgm_volume / total_fadeout_time) current_bgm:setVolume(
fadeout_time * config.bgm_volume / total_fadeout_time
)
end end
end end
function pauseBGM(f) function pauseBGM()
if f then
unfocused = true
end
if current_bgm ~= nil then if current_bgm ~= nil then
current_bgm:pause() current_bgm:pause()
end end
end end
function resumeBGM(f) function resumeBGM()
if f and scene.paused and unfocused then
unfocused = false
return
end
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

@@ -1,17 +1,105 @@
backgrounds = { named_backgrounds = {
title = love.graphics.newImage("res/backgrounds/title.png"), "title", "title_no_icon", "title_night",
title_no_icon = love.graphics.newImage("res/backgrounds/title-no-icon.jpg"), "snow", "options_input", "options_game"
title_night = love.graphics.newImage("res/backgrounds/title-night.jpg"),
snow = love.graphics.newImage("res/backgrounds/snow.png"),
input_config = love.graphics.newImage("res/backgrounds/options-input.png"),
game_config = love.graphics.newImage("res/backgrounds/options-game.png"),
} }
current_playing_bgs = {}
extended_bgs = {}
image_formats = {".jpg", ".png"}
bgpath = "res/backgrounds/"
dir = love.filesystem.getDirectoryItems(bgpath)
local i = 0 backgrounds = {}
local bgpath = "res/backgrounds/%d.png"
while love.filesystem.getInfo(bgpath:format(i*100)) do local function loadExtendedBgs()
backgrounds[i] = love.graphics.newImage(bgpath:format(i*100)) extended_bgs = require("res.backgrounds.extend_section_bg")
i = i + 1 end
-- error handling for if there is no extend_section_bg
if pcall(loadExtendedBgs) then end
-- helper method to populate backgrounds
local function createBackgroundIfExists(name, file_name)
local format_index = 1
-- see if background is an extension of another background
if extended_bgs[file_name] ~= nil then
copy_bg = extended_bgs[file_name]
copy_bg = copy_bg / 100
backgrounds[name] = backgrounds[copy_bg]
return true
end
-- try creating image backgrounds
while format_index <= #image_formats do
for num, existing_file in pairs(dir) do
if existing_file == (file_name..image_formats[format_index]) then
local tempBgPath = bgpath .. file_name .. image_formats[format_index]
backgrounds[name] = love.graphics.newImage(tempBgPath)
return true
end
end
format_index = format_index + 1
end
-- try creating video background
if love.filesystem.getInfo(bgpath .. file_name .. ".ogv") then
for num, existing_file in pairs(dir) do
if existing_file == (file_name..".ogv") then
local tempBgPath = bgpath .. file_name .. ".ogv"
backgrounds[name] = love.graphics.newVideo(
tempBgPath, {["audio"] = false}
)
-- you can set audio to true, but the video will not loop
-- properly if audio extends beyond video frames
return true
end
end
end
return false
end
local function stopOtherBgs(bg)
if #current_playing_bgs == 0 and bg:typeOf("Video") then
current_playing_bgs[#current_playing_bgs+1] = bg
end
if #current_playing_bgs >= 1 then
while current_playing_bgs[1] ~= bg and #current_playing_bgs >= 1 do
current_playing_bgs[1]:pause()
current_playing_bgs[1]:rewind()
table.remove(current_playing_bgs, 1)
end
end
end
function fetchBackgroundAndLoop(id)
bg = backgrounds[id]
if bg:typeOf("Video") and not bg:isPlaying() then
bg:rewind()
bg:play()
end
stopOtherBgs(bg)
return bg
end
-- create section backgrounds
local section = 0
while (createBackgroundIfExists(section, section*100)) do
section = section + 1
end
-- create named backgrounds
local nbgIndex = 1
while nbgIndex <= #named_backgrounds do
createBackgroundIfExists(
named_backgrounds[nbgIndex],
string.gsub(named_backgrounds[nbgIndex], "_", "-")
)
nbgIndex = nbgIndex + 1
end end
-- in order, the colors are: -- in order, the colors are:
@@ -110,3 +198,16 @@ misc_graphics = {
santa = love.graphics.newImage("res/img/santa.png"), santa = love.graphics.newImage("res/img/santa.png"),
icon = love.graphics.newImage("res/img/cambridge_transparent.png") icon = love.graphics.newImage("res/img/cambridge_transparent.png")
} }
-- utility function to allow any size background to be used
-- this will stretch the background to 4:3 aspect ratio
function drawBackground(id)
local bg_object = fetchBackgroundAndLoop(id)
local width = bg_object:getWidth()
local height = bg_object:getHeight()
love.graphics.draw(
bg_object,
0, 0, 0,
640 / width, 480 / height
)
end

View File

@@ -1 +1 @@
version = "v0.3.3.1" version = "v0.3.4"

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")
@@ -280,14 +280,6 @@ function love.wheelmoved(x, y)
scene:onInputPress({input=nil, type="wheel", x=x, y=y}) scene:onInputPress({input=nil, type="wheel", x=x, y=y})
end end
function love.focus(f)
if f then
resumeBGM(true)
else
pauseBGM(true)
end
end
function love.resize(w, h) function love.resize(w, h)
GLOBAL_CANVAS:release() GLOBAL_CANVAS:release()
GLOBAL_CANVAS = love.graphics.newCanvas(w, h) GLOBAL_CANVAS = love.graphics.newCanvas(w, h)

View File

@@ -0,0 +1,14 @@
-- ex: extend_section_bg[100] = 0
-- extend_section_bg[200] = 0
-- the video background associated with section 0 will continue playing into 100 and 200 without restarting.
-- will also cause any existing level 100, 200 backgrounds specified to NOT render.
-- please also note that you cannot currently extend any "named" backgrounds, such as "title" and "options-input"
extend_section_bg = {}
-- extend_section_bg[100] = 0
-- extend_section_bg[200] = 0
-- remove the dashes
return extend_section_bg

View File

@@ -16,9 +16,7 @@ function CreditsScene:new()
end end
function CreditsScene:update() function CreditsScene:update()
if love.window.hasFocus() then
self.frames = self.frames + 1 self.frames = self.frames + 1
end
if self.frames >= 2100 * self.scroll_speed then if self.frames >= 2100 * self.scroll_speed then
playSE("mode_decide") playSE("mode_decide")
scene = TitleScene() scene = TitleScene()
@@ -32,11 +30,7 @@ function CreditsScene:render()
local offset = self.frames / self.scroll_speed local offset = self.frames / self.scroll_speed
love.graphics.setColor(1, 1, 1, 1) love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw( drawBackground(19)
backgrounds[19],
0, 0, 0,
0.5, 0.5
)
love.graphics.setFont(font_3x5_4) love.graphics.setFont(font_3x5_4)
love.graphics.print("Cambridge Credits", 320, 500 - offset) love.graphics.print("Cambridge Credits", 320, 500 - offset)

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,11 +45,7 @@ end
function ConfigScene:render() function ConfigScene:render()
love.graphics.setColor(1, 1, 1, 1) love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw( drawBackground("options_game")
backgrounds["game_config"],
0, 0, 0,
0.5, 0.5
)
love.graphics.setFont(font_3x5_4) love.graphics.setFont(font_3x5_4)
love.graphics.print("GAME SETTINGS", 80, 40) love.graphics.print("GAME SETTINGS", 80, 40)

View File

@@ -20,11 +20,7 @@ function ConfigScene:update() end
function ConfigScene:render() function ConfigScene:render()
love.graphics.setColor(1, 1, 1, 1) love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw( drawBackground("options_input")
backgrounds["input_config"],
0, 0, 0,
0.5, 0.5
)
love.graphics.setFont(font_3x5_4) love.graphics.setFont(font_3x5_4)
love.graphics.print("INPUT CONFIG", 80, 40) love.graphics.print("INPUT CONFIG", 80, 40)

View File

@@ -45,11 +45,7 @@ end
function KeyConfigScene:render() function KeyConfigScene:render()
love.graphics.setColor(1, 1, 1, 1) love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw( drawBackground("options_input")
backgrounds["input_config"],
0, 0, 0,
0.5, 0.5
)
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

@@ -58,11 +58,7 @@ function ModeSelectScene:update()
end end
function ModeSelectScene:render() function ModeSelectScene:render()
love.graphics.draw( drawBackground(0)
backgrounds[0],
0, 0, 0,
0.5, 0.5
)
love.graphics.draw(misc_graphics["select_mode"], 20, 40) love.graphics.draw(misc_graphics["select_mode"], 20, 40)

View File

@@ -36,6 +36,8 @@ 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
self.show_invisible = false
DiscordRPC:update({ DiscordRPC:update({
details = "Viewing a replay", details = "Viewing a replay",
state = self.game.name, state = self.game.name,
@@ -44,7 +46,10 @@ 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
@@ -56,6 +61,7 @@ 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,
@@ -69,6 +75,11 @@ 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
@@ -77,10 +88,16 @@ 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, 23, 635, "right") ), 0, pauses_y_coordinate, 635, "right")
end end
else else
love.graphics.printf("?? PAUSES (--:--.--)", 0, 23, 635, "right") love.graphics.printf("?? PAUSES (--:--.--)", 0, pauses_y_coordinate, 635, "right")
end
if self.show_invisible then
self.game.grid:draw()
love.graphics.setColor(1, 1, 1, 1)
love.graphics.setFont(font_3x5_3)
love.graphics.printf("SHOW INVIS", 64, 60, 160, "center")
end end
end end
@@ -90,6 +107,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())
@@ -104,6 +123,20 @@ 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
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 end
end end

View File

@@ -14,9 +14,13 @@ function ReplaySelectScene:new()
replay_file_list = love.filesystem.getDirectoryItems("replays") replay_file_list = love.filesystem.getDirectoryItems("replays")
for i=1,#replay_file_list do for i=1,#replay_file_list do
local data = love.filesystem.read("replays/"..replay_file_list[i]) local data = love.filesystem.read("replays/"..replay_file_list[i])
local new_replay = binser.deserialize(data)[1] local success, new_replay = pcall(
function() return binser.deserialize(data)[1] end
)
if success then
replays[#replays + 1] = new_replay replays[#replays + 1] = new_replay
end end
end
table.sort(replays, function(a, b) table.sort(replays, function(a, b)
return a["timestamp"] > b["timestamp"] return a["timestamp"] > b["timestamp"]
end) end)
@@ -43,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
@@ -74,11 +76,7 @@ function ReplaySelectScene:update()
end end
function ReplaySelectScene:render() function ReplaySelectScene:render()
love.graphics.draw( drawBackground(0)
backgrounds[0],
0, 0, 0,
0.5, 0.5
)
-- Same graphic as mode select -- Same graphic as mode select
--love.graphics.draw(misc_graphics["select_mode"], 20, 40) --love.graphics.draw(misc_graphics["select_mode"], 20, 40)

View File

@@ -29,11 +29,7 @@ function SettingsScene:update() end
function SettingsScene:render() function SettingsScene:render()
love.graphics.setColor(1, 1, 1, 1) love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw( drawBackground("options_game")
backgrounds["game_config"],
0, 0, 0,
0.5, 0.5
)
love.graphics.setFont(font_3x5_4) love.graphics.setFont(font_3x5_4)
love.graphics.print("SETTINGS", 80, 40) love.graphics.print("SETTINGS", 80, 40)

View File

@@ -46,11 +46,7 @@ end
function StickConfigScene:render() function StickConfigScene:render()
love.graphics.setColor(1, 1, 1, 1) love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw( drawBackground("options_input")
backgrounds["input_config"],
0, 0, 0,
0.5, 0.5
)
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

@@ -73,11 +73,7 @@ local block_offsets = {
function TitleScene:render() function TitleScene:render()
love.graphics.setFont(font_3x5_4) love.graphics.setFont(font_3x5_4)
love.graphics.setColor(1, 1, 1, 1 - self.snow_bg_opacity) love.graphics.setColor(1, 1, 1, 1 - self.snow_bg_opacity)
love.graphics.draw( drawBackground("title_no_icon") -- title, title_night
backgrounds["title_no_icon"], -- title, title_night
0, 0, 0,
0.5, 0.5
)
-- 490, 192 -- 490, 192
for _, b in ipairs(block_offsets) do for _, b in ipairs(block_offsets) do
@@ -99,11 +95,7 @@ function TitleScene:render()
love.graphics.setFont(font_3x5_2) love.graphics.setFont(font_3x5_2)
love.graphics.setColor(1, 1, 1, self.snow_bg_opacity) love.graphics.setColor(1, 1, 1, self.snow_bg_opacity)
love.graphics.draw( drawBackground("snow")
backgrounds["snow"],
0, 0, 0,
0.5, 0.5
)
love.graphics.draw( love.graphics.draw(
misc_graphics["santa"], misc_graphics["santa"],

View File

@@ -34,11 +34,7 @@ end
function TuningScene:render() function TuningScene:render()
love.graphics.setColor(1, 1, 1, 1) love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw( drawBackground("options_game")
backgrounds["game_config"],
0, 0, 0,
0.5, 0.5
)
love.graphics.setColor(1, 1, 1, 0.5) love.graphics.setColor(1, 1, 1, 0.5)
love.graphics.rectangle("fill", 75, 98 + self.highlight * 75, 400, 33) love.graphics.rectangle("fill", 75, 98 + self.highlight * 75, 400, 33)

View File

@@ -231,12 +231,15 @@ function Grid:applyBigPiece(piece)
end end
end end
function Grid:checkForBravo(cleared_row_count) -- places where you see this take an argument used the old, buggy method
for i = 0, self.height - 1 - cleared_row_count do function Grid:checkForBravo()
for i = 0, self.height - 1 do
if not self:isRowFull(i+1) then
for j = 0, self.width - 1 do for j = 0, self.width - 1 do
if self:isOccupied(j, i) then return false end if self:isOccupied(j, i) then return false end
end end
end end
end
return true return true
end end

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
end local getClearedRowCount = self.grid.getClearedRowCount
self.grid.getClearedRowCount = function(self)
function BigA2Game:updateScore(level, drop_bonus, cleared_lines) return getClearedRowCount(self) / 2
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 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

@@ -400,6 +400,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
@@ -982,11 +983,7 @@ function GameMode:drawBackground()
local id = self:getBackground() local id = self:getBackground()
if type(id) == "number" then id = clamp(id, 0, #backgrounds) end if type(id) == "number" then id = clamp(id, 0, #backgrounds) end
love.graphics.setColor(1, 1, 1, 1) love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw( drawBackground(id)
backgrounds[id],
0, 0, 0,
0.5, 0.5
)
end end
function GameMode:drawFrame() function GameMode:drawFrame()

View File

@@ -283,7 +283,7 @@ function Marathon2020Game:sectionPassed(old_level, new_level)
) )
else else
return ( return (
(new_level < 2001 and math.floor(old_level / 100) < math.floor(new_level / 100)) or (new_level < 2000 and math.floor(old_level / 100) < math.floor(new_level / 100)) or
(new_level >= 2020) (new_level >= 2020)
) )
end end
@@ -352,9 +352,13 @@ function Marathon2020Game:updateSectionTimes(old_level, new_level)
table.insert(self.section_times, section_time) table.insert(self.section_times, section_time)
self.section_start_time = self.frames self.section_start_time = self.frames
if self.secondary_section_times[section] < cool_cutoffs[self.delay_level] and if (
(section == 1 or self.secondary_section_times[section] <= self.secondary_section_times[section - 1] + 120) then (self.secondary_section_times[section] < cool_cutoffs[self.delay_level]) and
(section == 1 or self.secondary_section_times[section] <= self.secondary_section_times[section - 1] + 120)
) then
sectionCool(section) sectionCool(section)
else
table.insert(self.section_status, "none")
end end
if section > 5 then if section > 5 then

View File

@@ -143,7 +143,7 @@ end
function Survival2020Game:onPieceEnter() function Survival2020Game:onPieceEnter()
if not self.clear and ( if not self.clear and (
(self.level < 1900 and self.level % 100 ~= 99) or (self.level < 1900 and self.level % 100 ~= 99) or
self.level == 2019 (1900 <= self.level and self.level < 2019)
) then ) then
self.level = self.level + 1 self.level = self.level + 1
end end
@@ -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()
@@ -249,7 +249,7 @@ function Survival2020Game:drawScoringInfo()
end end
function Survival2020Game:getBackground() function Survival2020Game:getBackground()
return math.floor(self.level / 100) return math.min(19, math.floor(self.level / 100))
end end
function Survival2020Game:getHighscoreData() function Survival2020Game:getHighscoreData()

View File

@@ -8,6 +8,8 @@ SRS.hash = "Standard"
SRS.softdrop_lock = false SRS.softdrop_lock = false
SRS.harddrop_lock = true SRS.harddrop_lock = true
SRS.enable_IRS_wallkicks = true
SRS.MANIPULATIONS_MAX = 15 SRS.MANIPULATIONS_MAX = 15
SRS.wallkicks_line = { SRS.wallkicks_line = {
@@ -108,4 +110,6 @@ end
function SRS:canPieceRotate() return true end function SRS:canPieceRotate() return true end
function SRS:get180RotationValue() return 2 end
return SRS return SRS