mirror of
https://github.com/SashLilac/cambridge.git
synced 2025-05-13 20:21:25 -05:00
Compare commits
9 Commits
v0.3.4
...
34fcc3f659
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34fcc3f659 | ||
|
|
4caa268adc | ||
|
|
a79552a6f3 | ||
|
|
cd90405865 | ||
|
|
e69659b2ad | ||
|
|
d90e382037 | ||
|
|
ba6f5bb837 | ||
|
|
39e9dc3303 | ||
|
|
a1f0dfd9f2 |
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|
||||||
|
|||||||
2
main.lua
2
main.lua
@@ -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")
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -107,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())
|
||||||
@@ -126,11 +128,13 @@ function ReplayScene:onInputPress(e)
|
|||||||
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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user