mirror of
https://github.com/SashLilac/cambridge.git
synced 2025-05-13 20:21:25 -05:00
Compare commits
23 Commits
v0.3.3
...
7199aa7ef6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7199aa7ef6 | ||
|
|
a972c31d9a | ||
|
|
02f314997d | ||
|
|
4769daedf4 | ||
|
|
52d4aeb3d0 | ||
|
|
91279c9f38 | ||
|
|
0572803627 | ||
|
|
1fef7b4880 | ||
|
|
e09b044de4 | ||
|
|
7d6f783c40 | ||
|
|
9d365f61a7 | ||
|
|
082697c3cd | ||
|
|
788aa11470 | ||
|
|
a303e82b90 | ||
|
|
b06d03c4e6 | ||
|
|
a6b8abff6d | ||
|
|
bdc317c3c5 | ||
|
|
71c9147a2c | ||
|
|
79d706a415 | ||
|
|
5fa144f146 | ||
|
|
244e67074d | ||
|
|
4b456cf49c | ||
|
|
9a67a6ce03 |
21
load/bgm.lua
21
load/bgm.lua
@@ -7,13 +7,15 @@ bgm = {
|
|||||||
|
|
||||||
local current_bgm = nil
|
local current_bgm = nil
|
||||||
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,24 +69,19 @@ 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()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -26,8 +26,18 @@ font_3x5_4 = love.graphics.newImageFont(
|
|||||||
-4
|
-4
|
||||||
)
|
)
|
||||||
|
|
||||||
font_8x11 = love.graphics.newImageFont(
|
-- this would be font_8x11 with the other one as 8x11_2
|
||||||
"res/fonts/8x11_medium.png",
|
-- but that would break compatibility :(
|
||||||
"0123456789:.",
|
font_8x11_small = love.graphics.newImageFont(
|
||||||
|
"res/fonts/8x11.png",
|
||||||
|
" 0123456789:;.,ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ..
|
||||||
|
"?!/\\^@$%<=>()*-+[]_&",
|
||||||
|
1
|
||||||
|
)
|
||||||
|
|
||||||
|
font_8x11 = love.graphics.newImageFont(
|
||||||
|
"res/fonts/8x11_medium.png",
|
||||||
|
" 0123456789:;.,ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ..
|
||||||
|
"?!/\\^@$%<=>()*-+[]_&",
|
||||||
1
|
1
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
version = "v0.3.3"
|
version = "v0.3.3.2"
|
||||||
10
main.lua
10
main.lua
@@ -114,7 +114,7 @@ function love.keypressed(key, scancode)
|
|||||||
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") 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")
|
||||||
local info = love.filesystem.getInfo("ss", "directory")
|
local info = love.filesystem.getInfo("ss", "directory")
|
||||||
@@ -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)
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 591 B After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 734 B After Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
@@ -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()
|
||||||
|
|||||||
@@ -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,18 +46,22 @@ 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
|
||||||
self.inputs = self.replay["inputs"][self.replay_index]["inputs"]
|
while frames_left > 0 do
|
||||||
self.replay["inputs"][self.replay_index]["frames"] = self.replay["inputs"][self.replay_index]["frames"] - 1
|
frames_left = frames_left - 1
|
||||||
if self.replay["inputs"][self.replay_index]["frames"] == 0 and self.replay_index < table.getn(self.replay["inputs"]) then
|
self.inputs = self.replay["inputs"][self.replay_index]["inputs"]
|
||||||
self.replay_index = self.replay_index + 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
|
||||||
|
self.replay_index = self.replay_index + 1
|
||||||
|
end
|
||||||
|
local input_copy = {}
|
||||||
|
for input, value in pairs(self.inputs) do
|
||||||
|
input_copy[input] = value
|
||||||
|
end
|
||||||
|
self.game:update(input_copy, self.ruleset)
|
||||||
|
self.game.grid:update()
|
||||||
end
|
end
|
||||||
local input_copy = {}
|
|
||||||
for input, value in pairs(self.inputs) do
|
|
||||||
input_copy[input] = value
|
|
||||||
end
|
|
||||||
self.game:update(input_copy, self.ruleset)
|
|
||||||
self.game.grid:update()
|
|
||||||
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
|
||||||
|
|
||||||
@@ -104,6 +121,18 @@ 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
|
||||||
|
elseif e.input == "hold" then
|
||||||
|
self.show_invisible = not self.show_invisible
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ function ReplaySelectScene:render()
|
|||||||
-- 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)
|
||||||
|
|
||||||
love.graphics.setFont(font_3x5_4)
|
love.graphics.setFont(font_8x11)
|
||||||
love.graphics.print("SELECT REPLAY", 20, 35)
|
love.graphics.print("SELECT REPLAY", 20, 35)
|
||||||
|
|
||||||
if self.display_warning then
|
if self.display_warning then
|
||||||
|
|||||||
@@ -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 j = 0, self.width - 1 do
|
for i = 0, self.height - 1 do
|
||||||
if self:isOccupied(j, i) then return false end
|
if not self:isRowFull(i+1) then
|
||||||
end
|
for j = 0, self.width - 1 do
|
||||||
|
if self:isOccupied(j, i) then return false end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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()
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user