mirror of
https://github.com/SashLilac/cambridge.git
synced 2025-05-13 20:21:25 -05:00
Compare commits
44 Commits
v0.3.2
...
52d4aeb3d0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52d4aeb3d0 | ||
|
|
91279c9f38 | ||
|
|
0572803627 | ||
|
|
1fef7b4880 | ||
|
|
e09b044de4 | ||
|
|
7d6f783c40 | ||
|
|
9d365f61a7 | ||
|
|
082697c3cd | ||
|
|
788aa11470 | ||
|
|
a303e82b90 | ||
|
|
b06d03c4e6 | ||
|
|
a6b8abff6d | ||
|
|
bdc317c3c5 | ||
|
|
71c9147a2c | ||
|
|
79d706a415 | ||
|
|
5fa144f146 | ||
|
|
244e67074d | ||
|
|
4b456cf49c | ||
|
|
9a67a6ce03 | ||
|
|
df19129228 | ||
|
|
80de771d2a | ||
|
|
7c32273971 | ||
|
|
9d5dbb4674 | ||
|
|
8d7ccae2bc | ||
|
|
1e06a1ce8a | ||
|
|
d24fff5bdc | ||
|
|
e34005093c | ||
|
|
3dc8b1214b | ||
|
|
5d2da1b4fb | ||
|
|
f786bda9dd | ||
|
|
3f789210a6 | ||
|
|
a7e7ac43a6 | ||
|
|
5dc72037ec | ||
|
|
e5cb69df43 | ||
|
|
3e68af6a5b | ||
|
|
8e6a760fe7 | ||
|
|
aa9e03506b | ||
|
|
40ac08c7e5 | ||
|
|
63823ed4b1 | ||
|
|
d7c83b0bc7 | ||
|
|
d868e8b803 | ||
|
|
47863175a3 | ||
|
|
8730261a78 | ||
|
|
703ce66c42 |
12
README.md
12
README.md
@@ -5,7 +5,7 @@ Cambridge
|
|||||||
|
|
||||||
Welcome to Cambridge, the next open-source falling-block game engine!
|
Welcome to Cambridge, the next open-source falling-block game engine!
|
||||||
|
|
||||||
The project is written and maintained exclusively by [Milla](https://github.com/MillaBasset), [joezeng](https://github.com/joezeng) and [Oshisaure](https://github.com/oshisaure)!
|
The project is written and maintained exclusively by [Milla](https://github.com/MillaBasset), [joezeng](https://github.com/joezeng) and [Oshisaure](https://github.com/oshisaure)!
|
||||||
|
|
||||||
The Discord server has been reopened! https://discord.gg/AADZUmgsph
|
The Discord server has been reopened! https://discord.gg/AADZUmgsph
|
||||||
|
|
||||||
@@ -16,11 +16,11 @@ Playing the game
|
|||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
You do not need LÖVE on Windows, as it comes bundled with the program.
|
You do not need LÖVE on Windows, as it comes bundled with the program.
|
||||||
|
|
||||||
#### Stable release
|
#### Stable release
|
||||||
|
|
||||||
To get the stable release, simply download either `cambridge-win32.zip` (32-bit) or `cambridge-windows.zip` (64-bit) in the [latest release](https://github.com/MillaBasset/cambridge/releases/latest).
|
To get the stable release, simply download either `cambridge-win32.zip` (32-bit) or `cambridge-windows.zip` (64-bit) in the [latest release](https://github.com/MillaBasset/cambridge/releases/latest).
|
||||||
|
|
||||||
All assets needed are bundled with the executable.
|
All assets needed are bundled with the executable.
|
||||||
|
|
||||||
@@ -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.
|
||||||
|
|
||||||
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:
|
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:
|
||||||
|
|
||||||
dist\windows\love.exe .
|
dist\windows\love.exe .
|
||||||
|
|
||||||
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:
|
If that doesn't work, run this instead, still using Command Prompt where you extracted Cambridge:
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@@ -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,24 +1,4 @@
|
|||||||
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"),
|
||||||
@@ -27,6 +7,13 @@ 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
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
version = "v0.3.2"
|
version = "v0.3.3.2"
|
||||||
15
main.lua
15
main.lua
@@ -1,5 +1,4 @@
|
|||||||
function love.load()
|
function love.load()
|
||||||
math.randomseed(os.time())
|
|
||||||
highscores = {}
|
highscores = {}
|
||||||
love.graphics.setDefaultFilter("linear", "nearest")
|
love.graphics.setDefaultFilter("linear", "nearest")
|
||||||
require "load.rpc"
|
require "load.rpc"
|
||||||
@@ -24,6 +23,11 @@ function love.load()
|
|||||||
-- used for screenshots
|
-- used for screenshots
|
||||||
GLOBAL_CANVAS = love.graphics.newCanvas()
|
GLOBAL_CANVAS = love.graphics.newCanvas()
|
||||||
|
|
||||||
|
-- aliasing to prevent people using math.random by accident
|
||||||
|
math.random = love.math.random
|
||||||
|
math.randomseed = love.math.setRandomSeed
|
||||||
|
math.randomseed(os.time())
|
||||||
|
|
||||||
-- init config
|
-- init config
|
||||||
initConfig()
|
initConfig()
|
||||||
|
|
||||||
@@ -110,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")
|
||||||
@@ -285,13 +289,16 @@ function love.focus(f)
|
|||||||
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)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- higher values of TARGET_FPS will make the game run "faster"
|
||||||
|
-- since the game is mostly designed for 60 FPS
|
||||||
local TARGET_FPS = 60
|
local TARGET_FPS = 60
|
||||||
local FRAME_DURATION = 1.0 / TARGET_FPS
|
local FRAME_DURATION = 1.0 / TARGET_FPS
|
||||||
|
|
||||||
|
-- custom run function; optimizes game by syncing draw/update calls
|
||||||
function love.run()
|
function love.run()
|
||||||
if love.load then love.load(love.arg.parseGameArguments(arg), arg) end
|
if love.load then love.load(love.arg.parseGameArguments(arg), arg) end
|
||||||
|
|
||||||
|
|||||||
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.
@@ -25,6 +25,8 @@ function GameScene:new(game_mode, ruleset, inputs)
|
|||||||
hold=false,
|
hold=false,
|
||||||
}
|
}
|
||||||
self.paused = false
|
self.paused = false
|
||||||
|
self.game.pause_count = 0
|
||||||
|
self.game.pause_time = 0
|
||||||
DiscordRPC:update({
|
DiscordRPC:update({
|
||||||
details = self.game.rpc_details,
|
details = self.game.rpc_details,
|
||||||
state = self.game.name,
|
state = self.game.name,
|
||||||
@@ -33,7 +35,9 @@ function GameScene:new(game_mode, ruleset, inputs)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function GameScene:update()
|
function GameScene:update()
|
||||||
if love.window.hasFocus() and not self.paused then
|
if self.paused then
|
||||||
|
self.game.pause_time = self.game.pause_time + 1
|
||||||
|
else
|
||||||
local inputs = {}
|
local inputs = {}
|
||||||
for input, value in pairs(self.inputs) do
|
for input, value in pairs(self.inputs) do
|
||||||
inputs[input] = value
|
inputs[input] = value
|
||||||
@@ -50,6 +54,16 @@ end
|
|||||||
|
|
||||||
function GameScene:render()
|
function GameScene:render()
|
||||||
self.game:draw(self.paused)
|
self.game:draw(self.paused)
|
||||||
|
if self.game.pause_time > 0 or self.game.pause_count > 0 then
|
||||||
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
|
love.graphics.setFont(font_3x5_2)
|
||||||
|
love.graphics.printf(string.format(
|
||||||
|
"%d PAUSE%s (%s)",
|
||||||
|
self.game.pause_count,
|
||||||
|
self.game.pause_count == 1 and "" or "S",
|
||||||
|
formatTime(self.game.pause_time)
|
||||||
|
), 0, 0, 635, "right")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function GameScene:onInputPress(e)
|
function GameScene:onInputPress(e)
|
||||||
@@ -71,8 +85,12 @@ function GameScene:onInputPress(e)
|
|||||||
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
|
||||||
self.paused = not self.paused
|
self.paused = not self.paused
|
||||||
if self.paused then pauseBGM()
|
if self.paused then
|
||||||
else resumeBGM() end
|
pauseBGM()
|
||||||
|
self.game.pause_count = self.game.pause_count + 1
|
||||||
|
else
|
||||||
|
resumeBGM()
|
||||||
|
end
|
||||||
elseif e.input == "menu_back" then
|
elseif e.input == "menu_back" then
|
||||||
self.game:onExit()
|
self.game:onExit()
|
||||||
scene = ModeSelectScene()
|
scene = ModeSelectScene()
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ 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
|
||||||
@@ -29,8 +32,11 @@ function ReplayScene:new(replay, game_mode, ruleset)
|
|||||||
hold=false,
|
hold=false,
|
||||||
}
|
}
|
||||||
self.paused = false
|
self.paused = false
|
||||||
|
self.game.pause_count = replay["pause_count"]
|
||||||
|
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
|
||||||
DiscordRPC:update({
|
DiscordRPC:update({
|
||||||
details = "Viewing a replay",
|
details = "Viewing a replay",
|
||||||
state = self.game.name,
|
state = self.game.name,
|
||||||
@@ -39,18 +45,22 @@ function ReplayScene:new(replay, game_mode, ruleset)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ReplayScene:update()
|
function ReplayScene:update()
|
||||||
if love.window.hasFocus() and not self.paused then
|
local frames_left = self.replay_speed
|
||||||
self.inputs = self.replay["inputs"][self.replay_index]["inputs"]
|
if not self.paused then
|
||||||
self.replay["inputs"][self.replay_index]["frames"] = self.replay["inputs"][self.replay_index]["frames"] - 1
|
while frames_left > 0 do
|
||||||
if self.replay["inputs"][self.replay_index]["frames"] == 0 and self.replay_index < table.getn(self.replay["inputs"]) then
|
frames_left = frames_left - 1
|
||||||
self.replay_index = self.replay_index + 1
|
self.inputs = self.replay["inputs"][self.replay_index]["inputs"]
|
||||||
|
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,
|
||||||
@@ -64,6 +74,24 @@ 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)
|
||||||
|
if self.game.pause_time and self.game.pause_count then
|
||||||
|
if self.game.pause_time > 0 or self.game.pause_count > 0 then
|
||||||
|
love.graphics.printf(string.format(
|
||||||
|
"%d PAUSE%s (%s)",
|
||||||
|
self.game.pause_count,
|
||||||
|
self.game.pause_count == 1 and "" or "S",
|
||||||
|
formatTime(self.game.pause_time)
|
||||||
|
), 0, pauses_y_coordinate, 635, "right")
|
||||||
|
end
|
||||||
|
else
|
||||||
|
love.graphics.printf("?? PAUSES (--:--.--)", 0, pauses_y_coordinate, 635, "right")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ReplayScene:onInputPress(e)
|
function ReplayScene:onInputPress(e)
|
||||||
@@ -86,6 +114,16 @@ 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
|
||||||
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
|
||||||
|
|||||||
7
start.bat
Normal file
7
start.bat
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
@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 +0,0 @@
|
|||||||
dist\win32\love.exe .
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
dist\windows\love.exe .
|
|
||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -135,25 +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_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 replay_files = love.filesystem.getDirectoryItems("replays")
|
local init_name = string.format("replays/%s.crp", os.date("%Y-%m-%d_%H-%M-%S"))
|
||||||
-- Select replay filename that doesn't collide with an existing one
|
local replay_name = init_name
|
||||||
local replay_number = 0
|
local replay_number = 0
|
||||||
local collision = true
|
while true do
|
||||||
while collision do
|
if love.filesystem.getInfo(replay_name, "file") then
|
||||||
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
|
break
|
||||||
collision = true
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
love.filesystem.write("replays/"..replay_number..".crp", binser.serialize(replay))
|
love.filesystem.write(replay_name, binser.serialize(replay))
|
||||||
end
|
end
|
||||||
|
|
||||||
function GameMode:addReplayInput(inputs)
|
function GameMode:addReplayInput(inputs)
|
||||||
@@ -977,9 +979,11 @@ 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[self:getBackground()],
|
backgrounds[id],
|
||||||
0, 0, 0,
|
0, 0, 0,
|
||||||
0.5, 0.5
|
0.5, 0.5
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -353,15 +353,10 @@ function Marathon2020Game:updateSectionTimes(old_level, new_level)
|
|||||||
self.section_start_time = self.frames
|
self.section_start_time = self.frames
|
||||||
|
|
||||||
if (
|
if (
|
||||||
self.section_status[section - 1] == "cool" and
|
(self.secondary_section_times[section] < cool_cutoffs[self.delay_level]) and
|
||||||
self.secondary_section_times[section] <= self.secondary_section_times[section - 1] + 120 and
|
(section == 1 or self.secondary_section_times[section] <= self.secondary_section_times[section - 1] + 120)
|
||||||
self.secondary_section_times[section] < cool_cutoffs[self.delay_level]
|
|
||||||
) then
|
) 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
|
else
|
||||||
table.insert(self.section_status, "none")
|
table.insert(self.section_status, "none")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -249,10 +249,13 @@ local grade_conversion = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function MarathonA2Game:whilePieceActive()
|
function MarathonA2Game:whilePieceActive()
|
||||||
self.grade_point_decay_counter = self.grade_point_decay_counter + 1
|
if self.clear then return
|
||||||
if self.grade_point_decay_counter >= grade_point_decays[self.grade + 1] then
|
else
|
||||||
self.grade_point_decay_counter = 0
|
self.grade_point_decay_counter = self.grade_point_decay_counter + 1
|
||||||
self.grade_points = math.max(0, self.grade_points - 1)
|
if self.grade_point_decay_counter >= grade_point_decays[self.grade + 1] then
|
||||||
|
self.grade_point_decay_counter = 0
|
||||||
|
self.grade_points = math.max(0, self.grade_points - 1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,9 @@ 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 }
|
||||||
@@ -201,15 +203,23 @@ 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
|
||||||
self.section_cool_grade = self.section_cool_grade - 1
|
if self.grade > 0 then
|
||||||
table.insert(self.section_status, "regret")
|
--this happens after the points are added, intentionally
|
||||||
|
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
|
||||||
elseif self.section_cool then
|
|
||||||
self.section_cool_grade = self.section_cool_grade + 1
|
|
||||||
table.insert(self.section_status, "cool")
|
|
||||||
else
|
else
|
||||||
table.insert(self.section_status, "none")
|
table.insert(self.section_regrets, 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
if self.section_cool then
|
||||||
|
self.section_cool_grade = self.section_cool_grade + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
self.section_cool = false
|
self.section_cool = false
|
||||||
@@ -223,6 +233,9 @@ 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
|
||||||
@@ -402,9 +415,11 @@ MarathonA3Game.mRollOpacityFunction = function(age)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function MarathonA3Game:sectionColourFunction(section)
|
function MarathonA3Game:sectionColourFunction(section)
|
||||||
if self.section_status[section] == "cool" then
|
if self.section_cools[section] == 1 and self.section_regrets[section] == 1 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_status[section] == "regret" then
|
elseif self.section_regrets[section] == 1 then
|
||||||
return { 1, 0, 0, 1 }
|
return { 1, 0, 0, 1 }
|
||||||
else
|
else
|
||||||
return { 1, 1, 1, 1 }
|
return { 1, 1, 1, 1 }
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ function PhantomManiaGame:getDasLimit()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function PhantomManiaGame:getLineClearDelay()
|
function PhantomManiaGame:getLineClearDelay()
|
||||||
return self:getLineARE()
|
return self:getLineARE() - 2
|
||||||
end
|
end
|
||||||
|
|
||||||
function PhantomManiaGame:getLockDelay()
|
function PhantomManiaGame:getLockDelay()
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ 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()
|
||||||
@@ -219,11 +220,14 @@ 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
|
||||||
@@ -292,6 +296,16 @@ 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)
|
||||||
|
|
||||||
|
|||||||
@@ -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