Compare commits

..

No commits in common. "8d7ccae2bc7baf546e94717dd43572566a4bd596" and "3e68af6a5b42390356d97968825104c8a150a414" have entirely different histories.

12 changed files with 66 additions and 86 deletions

View File

@ -28,11 +28,11 @@ All assets needed are bundled with the executable.
If you want the bleeding edge version, download [this](https://github.com/MillaBasset/cambridge/archive/master.zip). Extract the ZIP to a folder of your choosing. If you want the bleeding edge version, download [this](https://github.com/MillaBasset/cambridge/archive/master.zip). Extract the ZIP to a folder of your choosing.
If you're on Windows, you can double-click `start.bat` to run the game. If that doesn't work, open a Command Prompt where you extracted Cambridge and run: Assuming you're on a 64-bit system, you can double-click `start_win64.bat` to run the game. If that doesn't work, open a Command Prompt where you extracted Cambridge and run:
dist\windows\love.exe . dist\windows\love.exe .
If that doesn't work, run this instead, still using Command Prompt where you extracted Cambridge: If you're on a 32-bit system, you'll want to double-click `start_win32.bat`. If that doesn't work, run this instead:
dist\win32\love.exe . dist\win32\love.exe .
@ -107,4 +107,4 @@ Other Notable Games
- [Puzzle Trial](https://kagamine-rin.itch.io/puzzle-trial) by Rin - [Puzzle Trial](https://kagamine-rin.itch.io/puzzle-trial) by Rin
- [stackfuse](https://github.com/sinefuse/stackfuse) by sinefuse - [stackfuse](https://github.com/sinefuse/stackfuse) by sinefuse
![Cambridge Logo](https://cdn.discordapp.com/attachments/827186653772644452/1077674343544393820/Icon_2.png) ![Cambridge Logo](https://cdn.discordapp.com/attachments/625496179433668635/763363717730664458/Icon_2.png)

View File

@ -1,4 +1,24 @@
backgrounds = { backgrounds = {
[0] = love.graphics.newImage("res/backgrounds/0.png"),
love.graphics.newImage("res/backgrounds/100.png"),
love.graphics.newImage("res/backgrounds/200.png"),
love.graphics.newImage("res/backgrounds/300.png"),
love.graphics.newImage("res/backgrounds/400.png"),
love.graphics.newImage("res/backgrounds/500.png"),
love.graphics.newImage("res/backgrounds/600.png"),
love.graphics.newImage("res/backgrounds/700.png"),
love.graphics.newImage("res/backgrounds/800.png"),
love.graphics.newImage("res/backgrounds/900.png"),
love.graphics.newImage("res/backgrounds/1000.png"),
love.graphics.newImage("res/backgrounds/1100.png"),
love.graphics.newImage("res/backgrounds/1200.png"),
love.graphics.newImage("res/backgrounds/1300.png"),
love.graphics.newImage("res/backgrounds/1400.png"),
love.graphics.newImage("res/backgrounds/1500.png"),
love.graphics.newImage("res/backgrounds/1600.png"),
love.graphics.newImage("res/backgrounds/1700.png"),
love.graphics.newImage("res/backgrounds/1800.png"),
love.graphics.newImage("res/backgrounds/1900.png"),
title = love.graphics.newImage("res/backgrounds/title.png"), title = love.graphics.newImage("res/backgrounds/title.png"),
title_no_icon = love.graphics.newImage("res/backgrounds/title-no-icon.jpg"), title_no_icon = love.graphics.newImage("res/backgrounds/title-no-icon.jpg"),
title_night = love.graphics.newImage("res/backgrounds/title-night.jpg"), title_night = love.graphics.newImage("res/backgrounds/title-night.jpg"),
@ -7,13 +27,6 @@ backgrounds = {
game_config = love.graphics.newImage("res/backgrounds/options-game.png"), game_config = love.graphics.newImage("res/backgrounds/options-game.png"),
} }
local i = 0
local bgpath = "res/backgrounds/%d.png"
while love.filesystem.getInfo(bgpath:format(i*100)) do
backgrounds[i] = love.graphics.newImage(bgpath:format(i*100))
i = i + 1
end
-- in order, the colors are: -- in order, the colors are:
-- red, orange, yellow, green, cyan, blue -- red, orange, yellow, green, cyan, blue
-- magenta (or purple), white, black -- magenta (or purple), white, black

View File

@ -6,9 +6,6 @@ ReplayScene.title = "Replay"
function ReplayScene:new(replay, game_mode, ruleset) function ReplayScene:new(replay, game_mode, ruleset)
config.gamesettings = replay["gamesettings"] config.gamesettings = replay["gamesettings"]
if replay["delayed_auto_shift"] then config.das = replay["delayed_auto_shift"] end
if replay["auto_repeat_rate"] then config.arr = replay["auto_repeat_rate"] end
if replay["das_cut_delay"] then config.dcd = replay["das_cut_delay"] end
love.math.setRandomSeed(replay["random_low"], replay["random_high"]) love.math.setRandomSeed(replay["random_low"], replay["random_high"])
love.math.setRandomState(replay["random_state"]) love.math.setRandomState(replay["random_state"])
self.retry_replay = replay self.retry_replay = replay

View File

@ -1,7 +0,0 @@
@echo OFF
rem This solution of detecting the current CPU taken from here: https://stackoverflow.com/a/24590583
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set CURRENT_CPU=32BIT || set CURRENT_CPU=64BIT
if %CURRENT_CPU%==32BIT .\dist\win32\love.exe .
if %CURRENT_CPU%==64BIT .\dist\windows\love.exe .

1
start_win32.bat Normal file
View File

@ -0,0 +1 @@
dist\win32\love.exe .

1
start_win64.bat Normal file
View File

@ -0,0 +1 @@
dist\windows\love.exe .

View File

@ -135,27 +135,27 @@ function GameMode:saveReplay()
replay["lines"] = self.lines replay["lines"] = self.lines
replay["gamesettings"] = config.gamesettings replay["gamesettings"] = config.gamesettings
replay["secret_inputs"] = self.secret_inputs replay["secret_inputs"] = self.secret_inputs
replay["delayed_auto_shift"] = config.das
replay["auto_repeat_rate"] = config.arr
replay["das_cut_delay"] = config.dcd
replay["timestamp"] = os.time() replay["timestamp"] = os.time()
replay["pause_count"] = self.pause_count replay["pause_count"] = self.pause_count
replay["pause_time"] = self.pause_time replay["pause_time"] = self.pause_time
if love.filesystem.getInfo("replays") == nil then if love.filesystem.getInfo("replays") == nil then
love.filesystem.createDirectory("replays") love.filesystem.createDirectory("replays")
end end
local init_name = string.format("replays/%s.crp", os.date("%Y-%m-%d_%H-%M-%S")) local replay_files = love.filesystem.getDirectoryItems("replays")
local replay_name = init_name -- Select replay filename that doesn't collide with an existing one
local replay_number = 0 local replay_number = 0
while true do local collision = true
if love.filesystem.getInfo(replay_name, "file") then while collision do
collision = false
replay_number = replay_number + 1 replay_number = replay_number + 1
replay_name = string.format("%s (%d)", init_name, replay_number) for key, file in pairs(replay_files) do
else if file == replay_number..".crp" then
collision = true
break break
end end
end end
love.filesystem.write(replay_name, binser.serialize(replay)) end
love.filesystem.write("replays/"..replay_number..".crp", binser.serialize(replay))
end end
function GameMode:addReplayInput(inputs) function GameMode:addReplayInput(inputs)
@ -979,11 +979,9 @@ function GameMode:drawSectionTimesWithSplits(current_section, section_limit)
end end
function GameMode:drawBackground() function GameMode:drawBackground()
local id = self:getBackground()
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( love.graphics.draw(
backgrounds[id], backgrounds[self:getBackground()],
0, 0, 0, 0, 0, 0,
0.5, 0.5 0.5, 0.5
) )

View File

@ -352,9 +352,18 @@ 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.section_status[section - 1] == "cool" and
self.secondary_section_times[section] <= self.secondary_section_times[section - 1] + 120 and
self.secondary_section_times[section] < cool_cutoffs[self.delay_level]
) then
sectionCool(section) sectionCool(section)
elseif self.section_status[section - 1] == "cool" then
table.insert(self.section_status, "none")
elseif self.secondary_section_times[section] < cool_cutoffs[self.delay_level] then
sectionCool(section)
else
table.insert(self.section_status, "none")
end end
if section > 5 then if section > 5 then

View File

@ -249,15 +249,12 @@ local grade_conversion = {
} }
function MarathonA2Game:whilePieceActive() function MarathonA2Game:whilePieceActive()
if self.clear then return
else
self.grade_point_decay_counter = self.grade_point_decay_counter + 1 self.grade_point_decay_counter = self.grade_point_decay_counter + 1
if self.grade_point_decay_counter >= grade_point_decays[self.grade + 1] then if self.grade_point_decay_counter >= grade_point_decays[self.grade + 1] then
self.grade_point_decay_counter = 0 self.grade_point_decay_counter = 0
self.grade_points = math.max(0, self.grade_points - 1) self.grade_points = math.max(0, self.grade_points - 1)
end end
end end
end
function MarathonA2Game:updateGrade(cleared_lines) function MarathonA2Game:updateGrade(cleared_lines)
if self.clear or cleared_lines == 0 then return if self.clear or cleared_lines == 0 then return

View File

@ -26,9 +26,7 @@ function MarathonA3Game:new()
self.roll_points = 0 self.roll_points = 0
self.grade_point_decay_counter = 0 self.grade_point_decay_counter = 0
self.section_cool_grade = 0 self.section_cool_grade = 0
--self.section_status = { [0] = "none" } self.section_status = { [0] = "none" }
self.section_cools = { [0] = 0 }
self.section_regrets = { [0] = 0 }
self.section_start_time = 0 self.section_start_time = 0
self.secondary_section_times = { [0] = 0 } self.secondary_section_times = { [0] = 0 }
self.section_times = { [0] = 0 } self.section_times = { [0] = 0 }
@ -203,23 +201,15 @@ function MarathonA3Game:updateSectionTimes(old_level, new_level)
self.speed_level = self.section_cool and self.speed_level + 100 or self.speed_level self.speed_level = self.section_cool and self.speed_level + 100 or self.speed_level
if section_time > regret_cutoffs[section] then if section_time > regret_cutoffs[section] then
if self.grade > 0 then self.section_cool_grade = self.section_cool_grade - 1
--this happens after the points are added, intentionally table.insert(self.section_status, "regret")
local currentgrade = self:getAggregateGrade()
while self:getAggregateGrade() >= currentgrade do
self.grade = self.grade - 1
end
self.grade_points = 0
end
table.insert(self.section_regrets, 1)
self.coolregret_message = "REGRET!!" self.coolregret_message = "REGRET!!"
self.coolregret_timer = 300 self.coolregret_timer = 300
else elseif self.section_cool then
table.insert(self.section_regrets, 0)
end
if self.section_cool then
self.section_cool_grade = self.section_cool_grade + 1 self.section_cool_grade = self.section_cool_grade + 1
table.insert(self.section_status, "cool")
else
table.insert(self.section_status, "none")
end end
self.section_cool = false self.section_cool = false
@ -233,9 +223,6 @@ function MarathonA3Game:updateSectionTimes(old_level, new_level)
self.section_cool = true self.section_cool = true
self.coolregret_message = "COOL!!" self.coolregret_message = "COOL!!"
self.coolregret_timer = 300 self.coolregret_timer = 300
table.insert(self.section_cools, 1)
else
table.insert(self.section_cools, 0)
end end
end end
end end
@ -415,11 +402,9 @@ MarathonA3Game.mRollOpacityFunction = function(age)
end end
function MarathonA3Game:sectionColourFunction(section) function MarathonA3Game:sectionColourFunction(section)
if self.section_cools[section] == 1 and self.section_regrets[section] == 1 then if self.section_status[section] == "cool" then
return { 1, 1, 0, 1 }
elseif self.section_cools[section] == 1 then
return { 0, 1, 0, 1 } return { 0, 1, 0, 1 }
elseif self.section_regrets[section] == 1 then elseif self.section_status[section] == "regret" then
return { 1, 0, 0, 1 } return { 1, 0, 0, 1 }
else else
return { 1, 1, 1, 1 } return { 1, 1, 1, 1 }

View File

@ -54,7 +54,7 @@ function PhantomManiaGame:getDasLimit()
end end
function PhantomManiaGame:getLineClearDelay() function PhantomManiaGame:getLineClearDelay()
return self:getLineARE() - 2 return self:getLineARE()
end end
function PhantomManiaGame:getLockDelay() function PhantomManiaGame:getLockDelay()

View File

@ -41,7 +41,6 @@ function PhantomMania2Game:new()
self.coolregret_message = "" self.coolregret_message = ""
self.coolregret_timer = 0 self.coolregret_timer = 0
self.coolregrets = { [0] = 0 }
end end
function PhantomMania2Game:getARE() function PhantomMania2Game:getARE()
@ -220,14 +219,11 @@ function PhantomMania2Game:updateSectionTimes(old_level, new_level)
self.section_start_time = self.frames self.section_start_time = self.frames
if section_time <= cool_cutoffs[section] then if section_time <= cool_cutoffs[section] then
self.grade = self.grade + 2 self.grade = self.grade + 2
table.insert(self.coolregrets, 2)
self.coolregret_message = "COOL!!" self.coolregret_message = "COOL!!"
self.coolregret_timer = 300 self.coolregret_timer = 300
elseif section_time <= regret_cutoffs[section] then elseif section_time <= regret_cutoffs[section] then
self.grade = self.grade + 1 self.grade = self.grade + 1
table.insert(self.coolregrets, 1)
else else
table.insert(self.coolregrets, 0)
self.coolregret_message = "REGRET!!" self.coolregret_message = "REGRET!!"
self.coolregret_timer = 300 self.coolregret_timer = 300
end end
@ -296,16 +292,6 @@ function PhantomMania2Game:setHoldOpacity()
end end
end end
function PhantomMania2Game:sectionColourFunction(section)
if self.coolregrets[section] == 2 then
return { 0, 1, 0, 1 }
elseif self.coolregrets[section] == 0 then
return { 1, 0, 0, 1 }
else
return { 1, 1, 1, 1 }
end
end
function PhantomMania2Game:drawScoringInfo() function PhantomMania2Game:drawScoringInfo()
PhantomMania2Game.super.drawScoringInfo(self) PhantomMania2Game.super.drawScoringInfo(self)