mirror of
https://github.com/SashLilac/cambridge.git
synced 2025-05-13 20:21:25 -05:00
Compare commits
79 Commits
47a5a53e23
...
v0.3.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a21484137 | ||
|
|
50410958f0 | ||
|
|
6fb583e463 | ||
|
|
91c8dc3dcc | ||
|
|
2166a3c6d8 | ||
|
|
1556b247fe | ||
|
|
23d9feb357 | ||
|
|
c693871621 | ||
|
|
2ba3611c56 | ||
|
|
602e7105ab | ||
|
|
7199aa7ef6 | ||
|
|
a972c31d9a | ||
|
|
02f314997d | ||
|
|
4769daedf4 | ||
|
|
4478c07acf | ||
|
|
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 | ||
|
|
a4b7a41a15 | ||
|
|
aa9e03506b | ||
|
|
40ac08c7e5 | ||
|
|
323c457809 | ||
|
|
decc1f563f | ||
|
|
63823ed4b1 | ||
|
|
d7c83b0bc7 | ||
|
|
e5892c0fae | ||
|
|
23a8c400ba | ||
|
|
bfbba75f17 | ||
|
|
27e699841e | ||
|
|
fac8c6584e | ||
|
|
d868e8b803 | ||
|
|
9e447d51a7 | ||
|
|
4dfa234bc3 | ||
|
|
47863175a3 | ||
|
|
8730261a78 | ||
|
|
703ce66c42 | ||
|
|
92d67968f5 | ||
|
|
d68bd13d2a | ||
|
|
a84335646d | ||
|
|
d46973f12d | ||
|
|
d4360b3662 | ||
|
|
06225bd35a | ||
|
|
e68238cbce | ||
|
|
83e197b5d6 | ||
|
|
1c0b73987d | ||
|
|
afe6a43dab |
16
README.md
16
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,23 +16,23 @@ 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.
|
||||||
|
|
||||||
#### Bleeding edge
|
#### Bleeding edge
|
||||||
|
|
||||||
If you want the bleeding edge version, download [this](https://github.com/MillaBasset/cambridge/archive/master.zip).
|
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.
|
||||||
|
|
||||||
Extract the ZIP, open a Command Prompt at the folder you extracted Cambridge to, then run this command:
|
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 .
|
||||||
|
|
||||||
Alternatively, if you're on a 32-bit system, 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 .
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ Then, check the mod pack section at the bottom of this page.
|
|||||||
|
|
||||||
### macOS, Linux
|
### macOS, Linux
|
||||||
|
|
||||||
If you haven't already, install `love` with your favourite package manager (Homebrew on macOS, your system's default on Linux). **Make sure you're using LÖVE 11, because it won't work with earlier versions!**
|
If you haven't already, install `love` with your favourite package manager (Homebrew on macOS, your system's default on Linux). **Make sure you're using LÖVE 11.3, because it won't work with earlier or later versions!**
|
||||||
|
|
||||||
#### Downloading a release
|
#### Downloading a release
|
||||||
|
|
||||||
@@ -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
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
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,30 +1,106 @@
|
|||||||
backgrounds = {
|
named_backgrounds = {
|
||||||
[0] = love.graphics.newImage("res/backgrounds/0.png"),
|
"title", "title_no_icon", "title_night",
|
||||||
love.graphics.newImage("res/backgrounds/100.png"),
|
"snow", "options_input", "options_game"
|
||||||
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_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 = {".png", ".jpg"}
|
||||||
|
bgpath = "res/backgrounds/"
|
||||||
|
dir = love.filesystem.getDirectoryItems(bgpath)
|
||||||
|
|
||||||
|
backgrounds = {}
|
||||||
|
|
||||||
|
local function loadExtendedBgs()
|
||||||
|
extended_bgs = require("res.backgrounds.extend_section_bg")
|
||||||
|
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
|
||||||
|
|
||||||
-- in order, the colors are:
|
-- in order, the colors are:
|
||||||
-- red, orange, yellow, green, cyan, blue
|
-- red, orange, yellow, green, cyan, blue
|
||||||
@@ -121,4 +197,17 @@ misc_graphics = {
|
|||||||
strike = love.graphics.newImage("res/img/strike.png"),
|
strike = love.graphics.newImage("res/img/strike.png"),
|
||||||
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
|
||||||
@@ -1 +1 @@
|
|||||||
version = "v0.3.1"
|
version = "v0.3.4"
|
||||||
67
main.lua
67
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()
|
||||||
|
|
||||||
@@ -81,7 +85,7 @@ function love.draw()
|
|||||||
love.graphics.setFont(font_3x5_2)
|
love.graphics.setFont(font_3x5_2)
|
||||||
love.graphics.setColor(1, 1, 1, 1)
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
love.graphics.printf(
|
love.graphics.printf(
|
||||||
string.format("%.2f", 1 / love.timer.getAverageDelta()) ..
|
string.format("%.2f", 1.0 / love.timer.getAverageDelta()) ..
|
||||||
"fps - " .. version, 0, 460, 635, "right"
|
"fps - " .. version, 0, 460, 635, "right"
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
@@ -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")
|
||||||
@@ -118,7 +122,7 @@ function love.keypressed(key, scancode)
|
|||||||
love.filesystem.remove("ss")
|
love.filesystem.remove("ss")
|
||||||
love.filesystem.createDirectory("ss")
|
love.filesystem.createDirectory("ss")
|
||||||
end
|
end
|
||||||
print("Saving screenshot as "..ss_name)
|
print("Saving screenshot as "..love.filesystem.getSaveDirectory().."/"..ss_name)
|
||||||
GLOBAL_CANVAS:newImageData():encode("png", ss_name)
|
GLOBAL_CANVAS:newImageData():encode("png", ss_name)
|
||||||
-- function keys are reserved
|
-- function keys are reserved
|
||||||
elseif string.match(scancode, "^f[1-9]$") or string.match(scancode, "^f[1-9][0-9]+$") then
|
elseif string.match(scancode, "^f[1-9]$") or string.match(scancode, "^f[1-9][0-9]+$") then
|
||||||
@@ -276,21 +280,17 @@ 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)
|
||||||
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
|
||||||
|
|
||||||
|
-- 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
|
||||||
|
|
||||||
@@ -299,7 +299,7 @@ function love.run()
|
|||||||
local dt = 0
|
local dt = 0
|
||||||
|
|
||||||
local last_time = love.timer.getTime()
|
local last_time = love.timer.getTime()
|
||||||
local time_accumulator = 0
|
local time_accumulator = 0.0
|
||||||
return function()
|
return function()
|
||||||
if love.event then
|
if love.event then
|
||||||
love.event.pump()
|
love.event.pump()
|
||||||
@@ -319,25 +319,40 @@ function love.run()
|
|||||||
|
|
||||||
if scene and scene.update and love.timer then
|
if scene and scene.update and love.timer then
|
||||||
scene:update()
|
scene:update()
|
||||||
|
|
||||||
local frame_duration = 1.0 / TARGET_FPS
|
if time_accumulator < FRAME_DURATION then
|
||||||
if time_accumulator < frame_duration then
|
|
||||||
if love.graphics and love.graphics.isActive() and love.draw then
|
if love.graphics and love.graphics.isActive() and love.draw then
|
||||||
love.graphics.origin()
|
love.graphics.origin()
|
||||||
love.graphics.clear(love.graphics.getBackgroundColor())
|
love.graphics.clear(love.graphics.getBackgroundColor())
|
||||||
love.draw()
|
love.draw()
|
||||||
love.graphics.present()
|
love.graphics.present()
|
||||||
end
|
end
|
||||||
local end_time = last_time + frame_duration
|
|
||||||
local time = love.timer.getTime()
|
-- request 1ms delays first but stop short of overshooting, then do "0ms" delays without overshooting (0ms requests generally do a delay of some nonzero amount of time, but maybe less than 1ms)
|
||||||
while time < end_time do
|
for milliseconds=0.001,0.000,-0.001 do
|
||||||
love.timer.sleep(0.001)
|
local max_delay = 0.0
|
||||||
time = love.timer.getTime()
|
while max_delay < FRAME_DURATION do
|
||||||
|
local delay_start_time = love.timer.getTime()
|
||||||
|
if delay_start_time - last_time < FRAME_DURATION - max_delay then
|
||||||
|
love.timer.sleep(milliseconds)
|
||||||
|
local last_delay = love.timer.getTime() - delay_start_time
|
||||||
|
if last_delay > max_delay then
|
||||||
|
max_delay = last_delay
|
||||||
|
end
|
||||||
|
else
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
while love.timer.getTime() - last_time < FRAME_DURATION do
|
||||||
|
-- busy loop, do nothing here until delay is finished; delays above stop short of finishing, so this part can finish it off precisely
|
||||||
end
|
end
|
||||||
time_accumulator = time_accumulator + time - last_time
|
|
||||||
end
|
end
|
||||||
time_accumulator = time_accumulator - frame_duration
|
|
||||||
|
local finish_delay_time = love.timer.getTime()
|
||||||
|
local real_frame_duration = finish_delay_time - last_time
|
||||||
|
time_accumulator = time_accumulator + real_frame_duration - FRAME_DURATION
|
||||||
|
last_time = finish_delay_time
|
||||||
end
|
end
|
||||||
last_time = love.timer.getTime()
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
zip -r cambridge.love libs load res scene tetris conf.lua main.lua scene.lua funcs.lua
|
zip -r cambridge.love libs load res scene tetris conf.lua main.lua scene.lua funcs.lua
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
./package
|
#!/bin/sh
|
||||||
|
|
||||||
|
./package-love.sh
|
||||||
mkdir dist
|
mkdir dist
|
||||||
mkdir dist/windows
|
mkdir dist/windows
|
||||||
mkdir dist/win32
|
mkdir dist/win32
|
||||||
@@ -8,4 +10,4 @@ zip dist/cambridge-windows.zip dist/windows/* SOURCES.md LICENSE.md
|
|||||||
cat dist/win32/love.exe cambridge.love > dist/win32/cambridge.exe
|
cat dist/win32/love.exe cambridge.love > dist/win32/cambridge.exe
|
||||||
zip dist/cambridge-win32.zip dist/win32/* SOURCES.md LICENSE.md
|
zip dist/cambridge-win32.zip dist/win32/* SOURCES.md LICENSE.md
|
||||||
cp cambridge.love dist/other/
|
cp cambridge.love dist/other/
|
||||||
zip dist/cambridge-other.zip cambridge.love libs/discord-rpc.* SOURCES.md LICENSE.md
|
zip dist/cambridge-other.zip cambridge.love libs/discord-rpc.* SOURCES.md LICENSE.md
|
||||||
14
res/backgrounds/extend_section_bg.lua
Normal file
14
res/backgrounds/extend_section_bg.lua
Normal 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
|
||||||
BIN
res/backgrounds/title-no-icon.jpg
Normal file
BIN
res/backgrounds/title-no-icon.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 343 KiB |
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.
@@ -5,7 +5,7 @@ CreditsScene.title = "Credits"
|
|||||||
function CreditsScene:new()
|
function CreditsScene:new()
|
||||||
self.frames = 0
|
self.frames = 0
|
||||||
-- higher = slower
|
-- higher = slower
|
||||||
self.scroll_speed = 1.85
|
self.scroll_speed = 1.8
|
||||||
switchBGM("credit_roll", "gm3")
|
switchBGM("credit_roll", "gm3")
|
||||||
|
|
||||||
DiscordRPC:update({
|
DiscordRPC:update({
|
||||||
@@ -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,22 +30,18 @@ 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)
|
||||||
love.graphics.print("THANK YOU\nFOR PLAYING!", 320, math.max(2030 - offset, 240))
|
love.graphics.print("THANK YOU\nFOR PLAYING!", 320, math.max(2050 - offset, 240))
|
||||||
|
|
||||||
love.graphics.setFont(font_3x5_3)
|
love.graphics.setFont(font_3x5_3)
|
||||||
love.graphics.print("Game Developers", 320, 550 - offset)
|
love.graphics.print("Game Developers", 320, 550 - offset)
|
||||||
love.graphics.print("Project Heads", 320, 640 - offset)
|
love.graphics.print("Project Heads", 320, 640 - offset)
|
||||||
love.graphics.print("Notable Game Developers", 320, 750 - offset)
|
love.graphics.print("Notable Game Developers", 320, 750 - offset)
|
||||||
love.graphics.print("Special Thanks", 320, 1000 - offset)
|
love.graphics.print("Special Thanks", 320, 1000 - offset)
|
||||||
love.graphics.print("- Milla", 320, math.max(2110 - offset, 320))
|
love.graphics.print("- Milla", 320, math.max(2130 - offset, 320))
|
||||||
|
|
||||||
love.graphics.setFont(font_3x5_2)
|
love.graphics.setFont(font_3x5_2)
|
||||||
love.graphics.print("Oshisaure\nJoe Zeng", 320, 590 - offset)
|
love.graphics.print("Oshisaure\nJoe Zeng", 320, 590 - offset)
|
||||||
@@ -66,7 +60,7 @@ function CreditsScene:render()
|
|||||||
"CylinderKnot\neightsixfivezero\nEricICX\nGesomaru\n" ..
|
"CylinderKnot\neightsixfivezero\nEricICX\nGesomaru\n" ..
|
||||||
"gizmo4487\nJBroms\nKirby703\nKitaru\n" ..
|
"gizmo4487\nJBroms\nKirby703\nKitaru\n" ..
|
||||||
"M1ssing0\nMattMayuga\nMyPasswordIsWeak\n" ..
|
"M1ssing0\nMattMayuga\nMyPasswordIsWeak\n" ..
|
||||||
"Nikki Karissa\noffwo\nOliver\nPineapple\npokemonfan1937\n" ..
|
"Nikki Karissa\nnim\noffwo\nOliver\nPineapple\npokemonfan1937\n" ..
|
||||||
"Pyra Neoxi\nRDST64\nRocketLanterns\nRustyFoxxo\n" ..
|
"Pyra Neoxi\nRDST64\nRocketLanterns\nRustyFoxxo\n" ..
|
||||||
"saphie\nShelleloch\nSimon\nstratus\nSuper302\n" ..
|
"saphie\nShelleloch\nSimon\nstratus\nSuper302\n" ..
|
||||||
"switchpalacecorner\nterpyderp\nTetrian22\nTetro48\nThatCookie\n" ..
|
"switchpalacecorner\nterpyderp\nTetrian22\nTetro48\nThatCookie\n" ..
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ function GameScene:new(game_mode, ruleset, inputs)
|
|||||||
self.retry_ruleset = ruleset
|
self.retry_ruleset = ruleset
|
||||||
self.secret_inputs = inputs
|
self.secret_inputs = inputs
|
||||||
self.game = game_mode(self.secret_inputs)
|
self.game = game_mode(self.secret_inputs)
|
||||||
|
self.game.secret_inputs = inputs
|
||||||
self.ruleset = ruleset(self.game)
|
self.ruleset = ruleset(self.game)
|
||||||
self.game:initialize(self.ruleset)
|
self.game:initialize(self.ruleset)
|
||||||
self.inputs = {
|
self.inputs = {
|
||||||
@@ -24,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,
|
||||||
@@ -32,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
|
||||||
@@ -40,6 +45,8 @@ function GameScene:update()
|
|||||||
self.game:update(inputs, self.ruleset)
|
self.game:update(inputs, self.ruleset)
|
||||||
self.game.grid:update()
|
self.game.grid:update()
|
||||||
DiscordRPC:update({
|
DiscordRPC:update({
|
||||||
|
details = self.game.rpc_details,
|
||||||
|
state = self.game.name,
|
||||||
largeImageKey = "ingame-"..self.game:getBackground().."00"
|
largeImageKey = "ingame-"..self.game:getBackground().."00"
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
@@ -47,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)
|
||||||
@@ -68,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()
|
||||||
|
|||||||
@@ -13,11 +13,12 @@ ConfigScene.options = {
|
|||||||
{"world_reverse", "A Button Rotation", false, {"Left", "Auto", "Right"}},
|
{"world_reverse", "A Button Rotation", false, {"Left", "Auto", "Right"}},
|
||||||
{"spawn_positions", "Spawn Positions", false, {"Per ruleset", "In field", "Out of field"}},
|
{"spawn_positions", "Spawn Positions", false, {"Per ruleset", "In field", "Out of field"}},
|
||||||
{"display_gamemode", "Debug Info", false, {"On", "Off"}},
|
{"display_gamemode", "Debug Info", false, {"On", "Off"}},
|
||||||
{"das_last_key", "DAS Last Key", false, {"Off", "On"}},
|
{"save_replay", "Save Replays", false, {"On", "Off"}},
|
||||||
{"smooth_movement", "Smooth Piece Drop", false, {"On", "Off"}},
|
{"smooth_movement", "Smooth Piece Drop", false, {"On", "Off"}},
|
||||||
{"synchroes_allowed", "Synchroes", false, {"Per ruleset", "On", "Off"}},
|
|
||||||
{"diagonal_input", "Diagonal Input", false, {"On", "Off"}},
|
{"diagonal_input", "Diagonal Input", false, {"On", "Off"}},
|
||||||
|
{"das_last_key", "DAS Last Key", false, {"Off", "On"}},
|
||||||
{"buffer_lock", "Buffer Drop Type", false, {"Off", "Hold", "Tap"}},
|
{"buffer_lock", "Buffer Drop Type", false, {"Off", "Hold", "Tap"}},
|
||||||
|
{"synchroes_allowed", "Synchroes", false, {"Per ruleset", "On", "Off"}},
|
||||||
{"sfx_volume", "SFX", true, "sfxSlider"},
|
{"sfx_volume", "SFX", true, "sfxSlider"},
|
||||||
{"bgm_volume", "BGM", true, "bgmSlider"},
|
{"bgm_volume", "BGM", true, "bgmSlider"},
|
||||||
}
|
}
|
||||||
@@ -33,8 +34,8 @@ function ConfigScene:new()
|
|||||||
state = "Changing game settings",
|
state = "Changing game settings",
|
||||||
})
|
})
|
||||||
|
|
||||||
self.sfxSlider = newSlider(165, 400, 225, config.sfx_volume * 100, 0, 100, function(v) config.sfx_volume = v / 100 end, {width=20, knob="circle", track="roundrect"})
|
self.sfxSlider = newSlider(165, 420, 225, config.sfx_volume * 100, 0, 100, function(v) config.sfx_volume = v / 100 end, {width=20, knob="circle", track="roundrect"})
|
||||||
self.bgmSlider = newSlider(465, 400, 225, config.bgm_volume * 100, 0, 100, function(v) config.bgm_volume = v / 100 end, {width=20, knob="circle", track="roundrect"})
|
self.bgmSlider = newSlider(465, 420, 225, config.bgm_volume * 100, 0, 100, function(v) config.bgm_volume = v / 100 end, {width=20, knob="circle", track="roundrect"})
|
||||||
end
|
end
|
||||||
|
|
||||||
function ConfigScene:update()
|
function ConfigScene:update()
|
||||||
@@ -44,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)
|
||||||
@@ -58,7 +55,7 @@ function ConfigScene:render()
|
|||||||
if not ConfigScene.options[self.highlight][3] then
|
if not ConfigScene.options[self.highlight][3] then
|
||||||
love.graphics.rectangle("fill", 25, 98 + self.highlight * 20, 170, 22)
|
love.graphics.rectangle("fill", 25, 98 + self.highlight * 20, 170, 22)
|
||||||
else
|
else
|
||||||
love.graphics.rectangle("fill", 65 + (1+self.highlight-#self.options) * 300, 342, 215, 33)
|
love.graphics.rectangle("fill", 65 + (1+self.highlight-#self.options) * 300, 362, 215, 33)
|
||||||
end
|
end
|
||||||
|
|
||||||
love.graphics.setFont(font_3x5_2)
|
love.graphics.setFont(font_3x5_2)
|
||||||
@@ -75,8 +72,8 @@ function ConfigScene: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.print("SFX Volume: " .. math.floor(self.sfxSlider:getValue()) .. "%", 75, 345)
|
love.graphics.print("SFX Volume: " .. math.floor(self.sfxSlider:getValue()) .. "%", 75, 365)
|
||||||
love.graphics.print("BGM Volume: " .. math.floor(self.bgmSlider:getValue()) .. "%", 375, 345)
|
love.graphics.print("BGM Volume: " .. math.floor(self.bgmSlider:getValue()) .. "%", 375, 365)
|
||||||
|
|
||||||
love.graphics.setColor(1, 1, 1, 0.75)
|
love.graphics.setColor(1, 1, 1, 0.75)
|
||||||
self.sfxSlider:draw()
|
self.sfxSlider:draw()
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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("input_config")
|
||||||
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
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|
||||||
|
|||||||
@@ -4,17 +4,21 @@ local ReplayScene = Scene:extend()
|
|||||||
|
|
||||||
ReplayScene.title = "Replay"
|
ReplayScene.title = "Replay"
|
||||||
|
|
||||||
function ReplayScene:new(replay, game_mode, ruleset, inputs)
|
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
|
||||||
self.retry_mode = game_mode
|
self.retry_mode = game_mode
|
||||||
self.retry_ruleset = ruleset
|
self.retry_ruleset = ruleset
|
||||||
self.secret_inputs = inputs
|
self.secret_inputs = replay["secret_inputs"]
|
||||||
self.game = game_mode(self.secret_inputs)
|
self.game = game_mode(self.secret_inputs)
|
||||||
|
self.game.save_replay = false
|
||||||
self.ruleset = ruleset(self.game)
|
self.ruleset = ruleset(self.game)
|
||||||
self.game:initialize(self.ruleset, true)
|
self.game:initialize(self.ruleset)
|
||||||
self.inputs = {
|
self.inputs = {
|
||||||
left=false,
|
left=false,
|
||||||
right=false,
|
right=false,
|
||||||
@@ -28,8 +32,12 @@ function ReplayScene:new(replay, game_mode, ruleset, inputs)
|
|||||||
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
|
||||||
|
self.show_invisible = false
|
||||||
DiscordRPC:update({
|
DiscordRPC:update({
|
||||||
details = "Viewing a replay",
|
details = "Viewing a replay",
|
||||||
state = self.game.name,
|
state = self.game.name,
|
||||||
@@ -38,19 +46,25 @@ function ReplayScene:new(replay, game_mode, ruleset, inputs)
|
|||||||
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",
|
||||||
|
state = self.game.name,
|
||||||
largeImageKey = "ingame-"..self.game:getBackground().."00"
|
largeImageKey = "ingame-"..self.game:getBackground().."00"
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
@@ -61,6 +75,30 @@ 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
|
||||||
|
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
|
||||||
|
|
||||||
function ReplayScene:onInputPress(e)
|
function ReplayScene:onInputPress(e)
|
||||||
@@ -83,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
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,12 @@ 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(
|
||||||
replays[#replays + 1] = new_replay
|
function() return binser.deserialize(data)[1] end
|
||||||
|
)
|
||||||
|
if success then
|
||||||
|
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"]
|
||||||
@@ -74,16 +78,12 @@ 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)
|
||||||
|
|
||||||
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
|
||||||
@@ -121,12 +121,15 @@ function ReplaySelectScene:render()
|
|||||||
love.graphics.setFont(font_3x5_2)
|
love.graphics.setFont(font_3x5_2)
|
||||||
for idx, replay in ipairs(replays) do
|
for idx, replay in ipairs(replays) do
|
||||||
if(idx >= self.menu_state.replay-9 and idx <= self.menu_state.replay+9) then
|
if(idx >= self.menu_state.replay-9 and idx <= self.menu_state.replay+9) then
|
||||||
local display_string = os.date("%c", replay["timestamp"]).." "..replay["mode"].." "..replay["ruleset"]
|
local display_string = os.date("%c", replay["timestamp"]).." - "..replay["mode"].." - "..replay["ruleset"]
|
||||||
if replay["level"] ~= nil then
|
if replay["level"] ~= nil then
|
||||||
display_string = display_string.." Level: "..replay["level"]
|
display_string = display_string.." - Level: "..replay["level"]
|
||||||
end
|
end
|
||||||
if replay["timer"] ~= nil then
|
if replay["timer"] ~= nil then
|
||||||
display_string = display_string.." Time: "..formatTime(replay["timer"])
|
display_string = display_string.." - Time: "..formatTime(replay["timer"])
|
||||||
|
end
|
||||||
|
if #display_string > 75 then
|
||||||
|
display_string = display_string:sub(1, 75) .. "..."
|
||||||
end
|
end
|
||||||
love.graphics.printf(display_string, 6, (260 - 20*(self.menu_state.replay)) + 20 * idx, 640, "left")
|
love.graphics.printf(display_string, 6, (260 - 20*(self.menu_state.replay)) + 20 * idx, 640, "left")
|
||||||
end
|
end
|
||||||
@@ -167,8 +170,7 @@ function ReplaySelectScene:onInputPress(e)
|
|||||||
scene = ReplayScene(
|
scene = ReplayScene(
|
||||||
replays[self.menu_state.replay],
|
replays[self.menu_state.replay],
|
||||||
mode,
|
mode,
|
||||||
rules,
|
rules
|
||||||
replays[self.menu_state.replay]["secret_inputs"]
|
|
||||||
)
|
)
|
||||||
elseif e.input == "up" or e.scancode == "up" then
|
elseif e.input == "up" or e.scancode == "up" then
|
||||||
self:changeOption(-1)
|
self:changeOption(-1)
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -60,18 +60,34 @@ function TitleScene:update()
|
|||||||
else self.y_offset = 310 - self.frames end
|
else self.y_offset = 310 - self.frames end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local block_offsets = {
|
||||||
|
{color = "M", x = 0, y = 0},
|
||||||
|
{color = "G", x = 32, y = 0},
|
||||||
|
{color = "Y", x = 64, y = 0},
|
||||||
|
{color = "B", x = 0, y = 32},
|
||||||
|
{color = "O", x = 0, y = 64},
|
||||||
|
{color = "C", x = 32, y = 64},
|
||||||
|
{color = "R", x = 64, y = 64}
|
||||||
|
}
|
||||||
|
|
||||||
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"], -- title_night
|
|
||||||
0, 0, 0,
|
-- 490, 192
|
||||||
0.5, 0.5
|
for _, b in ipairs(block_offsets) do
|
||||||
)
|
love.graphics.draw(
|
||||||
|
blocks["2tie"][b.color],
|
||||||
|
490 + b.x, 192 + b.y, 0,
|
||||||
|
2, 2
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
love.graphics.draw(
|
love.graphics.draw(
|
||||||
misc_graphics["icon"],
|
misc_graphics["icon"],
|
||||||
460, 170, 0,
|
490, 192, 0,
|
||||||
2, 2
|
2, 2
|
||||||
)
|
)
|
||||||
]]
|
]]
|
||||||
@@ -79,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"],
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
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 .
|
||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -16,12 +16,11 @@ GameMode.hash = ""
|
|||||||
GameMode.tagline = ""
|
GameMode.tagline = ""
|
||||||
GameMode.rollOpacityFunction = function(age) return 0 end
|
GameMode.rollOpacityFunction = function(age) return 0 end
|
||||||
|
|
||||||
function GameMode:new(secret_inputs)
|
function GameMode:new()
|
||||||
self.replay_inputs = {}
|
self.replay_inputs = {}
|
||||||
self.random_low, self.random_high = love.math.getRandomSeed()
|
self.random_low, self.random_high = love.math.getRandomSeed()
|
||||||
self.random_state = love.math.getRandomState()
|
self.random_state = love.math.getRandomState()
|
||||||
self.secret_inputs = secret_inputs
|
self.save_replay = config.gamesettings.save_replay == 1
|
||||||
self.save_replay = true
|
|
||||||
|
|
||||||
self.grid = Grid(10, 24)
|
self.grid = Grid(10, 24)
|
||||||
self.randomizer = Randomizer()
|
self.randomizer = Randomizer()
|
||||||
@@ -104,7 +103,7 @@ function GameMode:getSkin()
|
|||||||
return "2tie"
|
return "2tie"
|
||||||
end
|
end
|
||||||
|
|
||||||
function GameMode:initialize(ruleset, replay)
|
function GameMode:initialize(ruleset)
|
||||||
-- generate next queue
|
-- generate next queue
|
||||||
self.used_randomizer = (
|
self.used_randomizer = (
|
||||||
table.equalvalues(
|
table.equalvalues(
|
||||||
@@ -114,11 +113,10 @@ function GameMode:initialize(ruleset, replay)
|
|||||||
self.randomizer or BagRandomizer(table.keys(ruleset.colourscheme))
|
self.randomizer or BagRandomizer(table.keys(ruleset.colourscheme))
|
||||||
)
|
)
|
||||||
self.ruleset = ruleset
|
self.ruleset = ruleset
|
||||||
self.save_replay = not replay
|
|
||||||
for i = 1, math.max(self.next_queue_length, 1) do
|
for i = 1, math.max(self.next_queue_length, 1) do
|
||||||
table.insert(self.next_queue, self:getNextPiece(ruleset))
|
table.insert(self.next_queue, self:getNextPiece(ruleset))
|
||||||
end
|
end
|
||||||
self.lock_on_soft_drop = ({ruleset.softdrop_lock, self.instant_soft_drop, false, true})[config.gamesettings.manlock]
|
self.lock_on_soft_drop = ({ruleset.softdrop_lock, self.instant_soft_drop, false, true })[config.gamesettings.manlock]
|
||||||
self.lock_on_hard_drop = ({ruleset.harddrop_lock, self.instant_hard_drop, true, false})[config.gamesettings.manlock]
|
self.lock_on_hard_drop = ({ruleset.harddrop_lock, self.instant_hard_drop, true, false})[config.gamesettings.manlock]
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -137,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)
|
||||||
@@ -979,12 +979,10 @@ 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(
|
drawBackground(id)
|
||||||
backgrounds[self:getBackground()],
|
|
||||||
0, 0, 0,
|
|
||||||
0.5, 0.5
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function GameMode:drawFrame()
|
function GameMode:drawFrame()
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -309,7 +322,7 @@ local mroll_points = {10, 20, 30, 100}
|
|||||||
local grade_conversion = {
|
local grade_conversion = {
|
||||||
[0] = 0,
|
[0] = 0,
|
||||||
1, 2, 3, 4, 5, 5, 6, 6, 7, 7,
|
1, 2, 3, 4, 5, 5, 6, 6, 7, 7,
|
||||||
7, 8, 8, 8, 9, 9, 9, 10, 11, 12, 12,
|
7, 8, 8, 8, 9, 9, 9, 10, 11, 12,
|
||||||
12, 12, 13, 13, 14, 14, 15, 15, 16, 16,
|
12, 12, 13, 13, 14, 14, 15, 15, 16, 16,
|
||||||
17
|
17
|
||||||
}
|
}
|
||||||
@@ -354,8 +367,7 @@ function MarathonA3Game:getAggregateGrade()
|
|||||||
return math.min(
|
return math.min(
|
||||||
self.section_cool_grade +
|
self.section_cool_grade +
|
||||||
math.floor(self.roll_points / 100) +
|
math.floor(self.roll_points / 100) +
|
||||||
grade_conversion[self.grade],
|
grade_conversion[self.grade]
|
||||||
self.roll_frames > 3238 and 32 or 31
|
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -403,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 }
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ function PhantomManiaGame:new()
|
|||||||
self.combo = 1
|
self.combo = 1
|
||||||
self.tetrises = 0
|
self.tetrises = 0
|
||||||
self.section_tetrises = {[0] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
self.section_tetrises = {[0] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
self.section_req = true
|
|
||||||
self.randomizer = History6RollsRandomizer()
|
self.randomizer = History6RollsRandomizer()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -55,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()
|
||||||
@@ -120,11 +119,6 @@ function PhantomManiaGame:onLineClear(cleared_row_count)
|
|||||||
self.level = 999
|
self.level = 999
|
||||||
end
|
end
|
||||||
self.clear = true
|
self.clear = true
|
||||||
for i = 0, 9 do
|
|
||||||
if self.section_tetrises[i] < (i == 9 and 1 or 2) then
|
|
||||||
self.section_req = false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
self.level = new_level
|
self.level = new_level
|
||||||
end
|
end
|
||||||
@@ -175,6 +169,10 @@ local function getLetterGrade(level, clear)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function PhantomManiaGame:qualifiesForGM()
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
function PhantomManiaGame:drawScoringInfo()
|
function PhantomManiaGame:drawScoringInfo()
|
||||||
PhantomManiaGame.super.drawScoringInfo(self)
|
PhantomManiaGame.super.drawScoringInfo(self)
|
||||||
|
|
||||||
@@ -195,7 +193,7 @@ function PhantomManiaGame:drawScoringInfo()
|
|||||||
if getLetterGrade(self.level, self.clear) ~= "" then
|
if getLetterGrade(self.level, self.clear) ~= "" then
|
||||||
if self.roll_frames > 1982 then love.graphics.setColor(1, 0.5, 0, 1)
|
if self.roll_frames > 1982 then love.graphics.setColor(1, 0.5, 0, 1)
|
||||||
elseif self.level == 999 and self.clear then love.graphics.setColor(0, 1, 0, 1) end
|
elseif self.level == 999 and self.clear then love.graphics.setColor(0, 1, 0, 1) end
|
||||||
if self.level == 999 and self.section_req and self.tetrises >= 31 then
|
if self.level == 999 and self:qualifiesForGM() then
|
||||||
love.graphics.printf("GM", text_x, 140, 90, "left")
|
love.graphics.printf("GM", text_x, 140, 90, "left")
|
||||||
else
|
else
|
||||||
love.graphics.printf(getLetterGrade(self.level, self.clear), text_x, 140, 90, "left")
|
love.graphics.printf(getLetterGrade(self.level, self.clear), text_x, 140, 90, "left")
|
||||||
|
|||||||
@@ -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()
|
||||||
@@ -202,13 +203,13 @@ end
|
|||||||
local cool_cutoffs = {
|
local cool_cutoffs = {
|
||||||
frameTime(0,36), frameTime(0,36), frameTime(0,36), frameTime(0,36), frameTime(0,36),
|
frameTime(0,36), frameTime(0,36), frameTime(0,36), frameTime(0,36), frameTime(0,36),
|
||||||
frameTime(0,30), frameTime(0,30), frameTime(0,30), frameTime(0,30), frameTime(0,30),
|
frameTime(0,30), frameTime(0,30), frameTime(0,30), frameTime(0,30), frameTime(0,30),
|
||||||
frameTime(0,27), frameTime(0,27), frameTime(0,27),
|
frameTime(0,30), frameTime(0,30), frameTime(0,30),
|
||||||
}
|
}
|
||||||
|
|
||||||
local regret_cutoffs = {
|
local regret_cutoffs = {
|
||||||
frameTime(0,50), frameTime(0,50), frameTime(0,50), frameTime(0,50), frameTime(0,50),
|
frameTime(0,50), frameTime(0,50), frameTime(0,50), frameTime(0,50), frameTime(0,50),
|
||||||
frameTime(0,40), frameTime(0,40), frameTime(0,40), frameTime(0,40), frameTime(0,40),
|
frameTime(0,42), frameTime(0,42), frameTime(0,42), frameTime(0,42), frameTime(0,42),
|
||||||
frameTime(0,35), frameTime(0,35), frameTime(0,35),
|
frameTime(0,42), frameTime(0,42), frameTime(0,42),
|
||||||
}
|
}
|
||||||
|
|
||||||
function PhantomMania2Game:updateSectionTimes(old_level, new_level)
|
function PhantomMania2Game:updateSectionTimes(old_level, new_level)
|
||||||
@@ -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)
|
||||||
|
|
||||||
|
|||||||
@@ -13,4 +13,14 @@ function PhantomManiaNGame:new()
|
|||||||
self.enable_hold = true
|
self.enable_hold = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function PhantomManiaNGame:qualifiesForGM()
|
||||||
|
if self.tetrises < 31 then return false end
|
||||||
|
for i = 0, 9 do
|
||||||
|
if self.section_tetrises[i] < (i == 9 and 1 or 2) then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
return PhantomManiaNGame
|
return PhantomManiaNGame
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ function SurvivalA2Game:new()
|
|||||||
self.roll_frames = 0
|
self.roll_frames = 0
|
||||||
self.combo = 1
|
self.combo = 1
|
||||||
self.randomizer = History6RollsRandomizer()
|
self.randomizer = History6RollsRandomizer()
|
||||||
|
|
||||||
self.SGnames = {
|
self.SGnames = {
|
||||||
"9", "8", "7", "6", "5", "4", "3", "2", "1",
|
"9", "8", "7", "6", "5", "4", "3", "2", "1",
|
||||||
"S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9",
|
"S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9",
|
||||||
@@ -101,6 +101,7 @@ function SurvivalA2Game:onLineClear(cleared_row_count)
|
|||||||
self.clear = true
|
self.clear = true
|
||||||
if new_level < 999 then
|
if new_level < 999 then
|
||||||
self.game_over = true
|
self.game_over = true
|
||||||
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.level = new_level
|
self.level = new_level
|
||||||
|
|||||||
49
tetris/rulesets/arika_exp.lua
Normal file
49
tetris/rulesets/arika_exp.lua
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
local Piece = require 'tetris.components.piece'
|
||||||
|
local Ruleset = require 'tetris.rulesets.arika_ace2'
|
||||||
|
|
||||||
|
local ARS = Ruleset:extend()
|
||||||
|
|
||||||
|
ARS.name = "ARS-X"
|
||||||
|
ARS.hash = "ArikaEXP"
|
||||||
|
|
||||||
|
ARS.MANIPULATIONS_MAX = 24
|
||||||
|
ARS.ROTATIONS_MAX = 12
|
||||||
|
|
||||||
|
function ARS:onPieceCreate(piece, grid)
|
||||||
|
piece.manipulations = 0
|
||||||
|
piece.rotations = 0
|
||||||
|
piece.lowest_y = -math.huge
|
||||||
|
end
|
||||||
|
|
||||||
|
function ARS:checkNewLow(piece)
|
||||||
|
for _, block in pairs(piece:getBlockOffsets()) do
|
||||||
|
local y = piece.position.y + block.y
|
||||||
|
if y > piece.lowest_y then
|
||||||
|
piece.manipulations = 0
|
||||||
|
piece.rotations = 0
|
||||||
|
piece.lowest_y = y
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function ARS:onPieceMove(piece, grid)
|
||||||
|
piece.lock_delay = 0 -- move reset
|
||||||
|
if piece:isDropBlocked(grid) then
|
||||||
|
piece.manipulations = piece.manipulations + 1
|
||||||
|
if piece.manipulations >= ARS.MANIPULATIONS_MAX then
|
||||||
|
piece.locked = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function ARS:onPieceRotate(piece, grid, upward)
|
||||||
|
piece.lock_delay = 0 -- rotate reset
|
||||||
|
if upward or piece:isDropBlocked(grid) then
|
||||||
|
piece.rotations = piece.rotations + 1
|
||||||
|
if piece.rotations >= ARS.ROTATIONS_MAX and piece:isDropBlocked(grid) then
|
||||||
|
piece.locked = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return ARS
|
||||||
@@ -209,7 +209,7 @@ function Ruleset:initializePiece(
|
|||||||
|
|
||||||
local colours
|
local colours
|
||||||
if table.equalvalues(
|
if table.equalvalues(
|
||||||
self.colourscheme, {"I", "J", "L", "O", "S", "T", "Z"}
|
table.keys(self.colourscheme), {"I", "J", "L", "O", "S", "T", "Z"}
|
||||||
) then
|
) then
|
||||||
colours = ({self.colourscheme, ColourSchemes.Arika, ColourSchemes.TTC})[config.gamesettings.piece_colour]
|
colours = ({self.colourscheme, ColourSchemes.Arika, ColourSchemes.TTC})[config.gamesettings.piece_colour]
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
local Piece = require 'tetris.components.piece'
|
local Piece = require 'tetris.components.piece'
|
||||||
local Ruleset = require 'tetris.rulesets.standard_exp'
|
local Ruleset = require 'tetris.rulesets.standard_ace'
|
||||||
|
|
||||||
local SRS = Ruleset:extend()
|
local SRS = Ruleset:extend()
|
||||||
|
|
||||||
@@ -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 = {
|
||||||
@@ -33,8 +35,8 @@ SRS.wallkicks_line = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function SRS:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
|
||||||
|
|
||||||
|
function SRS:attemptWallkicks(piece, new_piece, rot_dir, grid)
|
||||||
local kicks
|
local kicks
|
||||||
if piece.shape == "O" then
|
if piece.shape == "O" then
|
||||||
return
|
return
|
||||||
@@ -69,6 +71,12 @@ function SRS:checkNewLow(piece)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function SRS:onPieceCreate(piece, grid)
|
||||||
|
piece.manipulations = 0
|
||||||
|
piece.rotations = 0
|
||||||
|
piece.lowest_y = -math.huge
|
||||||
|
end
|
||||||
|
|
||||||
function SRS:onPieceDrop(piece, grid)
|
function SRS:onPieceDrop(piece, grid)
|
||||||
self:checkNewLow(piece)
|
self:checkNewLow(piece)
|
||||||
if piece.manipulations >= self.MANIPULATIONS_MAX and piece:isDropBlocked(grid) then
|
if piece.manipulations >= self.MANIPULATIONS_MAX and piece:isDropBlocked(grid) then
|
||||||
@@ -102,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
|
||||||
|
|||||||
2
tetris/rulesets/arika_srs.lua → tetris/rulesets/standard_ace.lua
Executable file → Normal file
2
tetris/rulesets/arika_srs.lua → tetris/rulesets/standard_ace.lua
Executable file → Normal file
@@ -1,5 +1,5 @@
|
|||||||
local Piece = require 'tetris.components.piece'
|
local Piece = require 'tetris.components.piece'
|
||||||
local Ruleset = require 'tetris.rulesets.ti_srs'
|
local Ruleset = require 'tetris.rulesets.standard_ti'
|
||||||
|
|
||||||
local SRS = Ruleset:extend()
|
local SRS = Ruleset:extend()
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
local Piece = require 'tetris.components.piece'
|
local Piece = require 'tetris.components.piece'
|
||||||
local Ruleset = require 'tetris.rulesets.arika_srs'
|
local Ruleset = require 'tetris.rulesets.standard_ti'
|
||||||
|
|
||||||
local SRS = Ruleset:extend()
|
local SRS = Ruleset:extend()
|
||||||
|
|
||||||
@@ -27,8 +27,6 @@ function SRS:checkNewLow(piece)
|
|||||||
for _, block in pairs(piece:getBlockOffsets()) do
|
for _, block in pairs(piece:getBlockOffsets()) do
|
||||||
local y = piece.position.y + block.y
|
local y = piece.position.y + block.y
|
||||||
if y > piece.lowest_y then
|
if y > piece.lowest_y then
|
||||||
--piece.manipulations = 0
|
|
||||||
--piece.rotations = 0
|
|
||||||
piece.lowest_y = y
|
piece.lowest_y = y
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user