mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 06:59:03 -06:00
Compare commits
No commits in common. "ea133c6f8c4cf1e92afbf5f37e1438c95c2747b6" and "dcde2a380d5d5cf9976fd05ce341f0e677ff094c" have entirely different histories.
ea133c6f8c
...
dcde2a380d
@ -28,11 +28,11 @@ All assets needed are bundled with the executable.
|
|||||||
|
|
||||||
If you want the bleeding edge version, download [this](https://github.com/MillaBasset/cambridge/archive/master.zip). Extract the ZIP to a folder of your choosing.
|
If you want the bleeding edge version, download [this](https://github.com/MillaBasset/cambridge/archive/master.zip). Extract the ZIP to a folder of your choosing.
|
||||||
|
|
||||||
If you're on Windows, you can double-click `start.bat` to run the game. If that doesn't work, open a Command Prompt where you extracted Cambridge and run:
|
Assuming you're on a 64-bit system, you can double-click `start_win64.bat` to run the game. If that doesn't work, open a Command Prompt where you extracted Cambridge and run:
|
||||||
|
|
||||||
dist\windows\love.exe .
|
dist\windows\love.exe .
|
||||||
|
|
||||||
If that doesn't work, run this instead, still using Command Prompt where you extracted Cambridge:
|
If you're on a 32-bit system, you'll want to double-click `start_win32.bat`. If that doesn't work, run this instead:
|
||||||
|
|
||||||
dist\win32\love.exe .
|
dist\win32\love.exe .
|
||||||
|
|
||||||
@ -107,4 +107,4 @@ Other Notable Games
|
|||||||
- [Puzzle Trial](https://kagamine-rin.itch.io/puzzle-trial) by Rin
|
- [Puzzle Trial](https://kagamine-rin.itch.io/puzzle-trial) by Rin
|
||||||
- [stackfuse](https://github.com/sinefuse/stackfuse) by sinefuse
|
- [stackfuse](https://github.com/sinefuse/stackfuse) by sinefuse
|
||||||
|
|
||||||
![Cambridge Logo](https://cdn.discordapp.com/attachments/827186653772644452/1077674343544393820/Icon_2.png)
|
![Cambridge Logo](https://cdn.discordapp.com/attachments/625496179433668635/763363717730664458/Icon_2.png)
|
||||||
|
@ -60,9 +60,6 @@ function formatTime(frames)
|
|||||||
min = math.floor(frames/3600)
|
min = math.floor(frames/3600)
|
||||||
sec = math.floor(frames/60) % 60
|
sec = math.floor(frames/60) % 60
|
||||||
hund = math.floor(frames/.6) % 100
|
hund = math.floor(frames/.6) % 100
|
||||||
if frames == 15641 then
|
|
||||||
hund = math.ceil(frames/.6) % 100
|
|
||||||
end
|
|
||||||
str = string.format("%02d:%02d.%02d", min, sec, hund)
|
str = string.format("%02d:%02d.%02d", min, sec, hund)
|
||||||
return str
|
return str
|
||||||
end
|
end
|
||||||
|
30
load/bgm.lua
30
load/bgm.lua
@ -6,17 +6,14 @@ bgm = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local current_bgm = nil
|
local current_bgm = nil
|
||||||
local pitch = 1
|
|
||||||
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 config.bgm_volume <= 0 then
|
if bgm_locked or 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
|
||||||
@ -70,28 +67,25 @@ function processBGMFadeout(dt)
|
|||||||
fadeout_time = 0
|
fadeout_time = 0
|
||||||
fading_bgm = false
|
fading_bgm = false
|
||||||
end
|
end
|
||||||
current_bgm:setVolume(
|
current_bgm:setVolume(fadeout_time * config.bgm_volume / total_fadeout_time)
|
||||||
fadeout_time * config.bgm_volume / total_fadeout_time
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function pauseBGM()
|
function pauseBGM(f)
|
||||||
|
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()
|
function resumeBGM(f)
|
||||||
|
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()
|
||||||
current_bgm:setPitch(pitch)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function pitchBGM(new_pitch)
|
|
||||||
pitch = new_pitch
|
|
||||||
if current_bgm ~= nil then
|
|
||||||
current_bgm:setPitch(pitch)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -26,18 +26,8 @@ font_3x5_4 = love.graphics.newImageFont(
|
|||||||
-4
|
-4
|
||||||
)
|
)
|
||||||
|
|
||||||
-- this would be font_8x11 with the other one as 8x11_2
|
|
||||||
-- but that would break compatibility :(
|
|
||||||
font_8x11_small = love.graphics.newImageFont(
|
|
||||||
"res/fonts/8x11.png",
|
|
||||||
" 0123456789:;.,ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ..
|
|
||||||
"?!/\\^@$%<=>()*-+[]_&",
|
|
||||||
1
|
|
||||||
)
|
|
||||||
|
|
||||||
font_8x11 = love.graphics.newImageFont(
|
font_8x11 = love.graphics.newImageFont(
|
||||||
"res/fonts/8x11_medium.png",
|
"res/fonts/8x11_medium.png",
|
||||||
" 0123456789:;.,ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ..
|
"0123456789:.",
|
||||||
"?!/\\^@$%<=>()*-+[]_&",
|
|
||||||
1
|
1
|
||||||
)
|
)
|
||||||
|
@ -1,106 +1,31 @@
|
|||||||
named_backgrounds = {
|
backgrounds = {
|
||||||
"title", "title_no_icon", "title_night",
|
[0] = love.graphics.newImage("res/backgrounds/0.png"),
|
||||||
"snow", "options_input", "options_game"
|
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_no_icon = love.graphics.newImage("res/backgrounds/title-no-icon.jpg"),
|
||||||
|
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 = {".jpg", ".png"}
|
|
||||||
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
|
||||||
@ -198,16 +123,3 @@ misc_graphics = {
|
|||||||
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.4"
|
version = "v0.3.1"
|
19
main.lua
19
main.lua
@ -1,4 +1,5 @@
|
|||||||
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,11 +25,6 @@ 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()
|
||||||
config.depth_3d = 100 -- TODO add a setting for this to the menu
|
config.depth_3d = 100 -- TODO add a setting for this to the menu
|
||||||
@ -115,7 +111,7 @@ function love.keypressed(key, scancode)
|
|||||||
saveConfig()
|
saveConfig()
|
||||||
scene.restart_message = true
|
scene.restart_message = true
|
||||||
if config.secret then playSE("mode_decide")
|
if config.secret then playSE("mode_decide")
|
||||||
else playSE("erase", "single") 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")
|
||||||
@ -282,17 +278,22 @@ 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
|
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
|
||||||
|
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
-- 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/fonts/3x5.xcf
Normal file
BIN
res/fonts/3x5.xcf
Normal file
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 591 B |
Binary file not shown.
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 734 B |
BIN
res/fonts/8x12.xcf
Normal file
BIN
res/fonts/8x12.xcf
Normal file
Binary file not shown.
@ -16,7 +16,9 @@ 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()
|
||||||
@ -30,7 +32,11 @@ 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)
|
||||||
drawBackground(19)
|
love.graphics.draw(
|
||||||
|
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)
|
||||||
|
@ -25,8 +25,6 @@ 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,
|
||||||
@ -35,9 +33,7 @@ function GameScene:new(game_mode, ruleset, inputs)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function GameScene:update()
|
function GameScene:update()
|
||||||
if self.paused then
|
if love.window.hasFocus() and not 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
|
||||||
@ -54,16 +50,6 @@ 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)
|
||||||
@ -81,17 +67,12 @@ function GameScene:onInputPress(e)
|
|||||||
scene = e.input == "retry" and GameScene(self.retry_mode, self.retry_ruleset, self.secret_inputs) or ModeSelectScene()
|
scene = e.input == "retry" and GameScene(self.retry_mode, self.retry_ruleset, self.secret_inputs) or ModeSelectScene()
|
||||||
elseif e.input == "retry" then
|
elseif e.input == "retry" then
|
||||||
switchBGM(nil)
|
switchBGM(nil)
|
||||||
pitchBGM(1)
|
|
||||||
self.game:onExit()
|
self.game:onExit()
|
||||||
scene = GameScene(self.retry_mode, self.retry_ruleset, self.secret_inputs)
|
scene = GameScene(self.retry_mode, self.retry_ruleset, self.secret_inputs)
|
||||||
elseif e.input == "pause" and not (self.game.game_over or self.game.completed) then
|
elseif e.input == "pause" and not (self.game.game_over or self.game.completed) then
|
||||||
self.paused = not self.paused
|
self.paused = not self.paused
|
||||||
if self.paused then
|
if self.paused then pauseBGM()
|
||||||
pauseBGM()
|
else resumeBGM() end
|
||||||
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()
|
||||||
|
@ -45,7 +45,11 @@ end
|
|||||||
|
|
||||||
function ConfigScene:render()
|
function ConfigScene:render()
|
||||||
love.graphics.setColor(1, 1, 1, 1)
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
drawBackground("options_game")
|
love.graphics.draw(
|
||||||
|
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)
|
||||||
|
@ -20,7 +20,11 @@ function ConfigScene:update() end
|
|||||||
|
|
||||||
function ConfigScene:render()
|
function ConfigScene:render()
|
||||||
love.graphics.setColor(1, 1, 1, 1)
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
drawBackground("options_input")
|
love.graphics.draw(
|
||||||
|
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,7 +45,11 @@ end
|
|||||||
|
|
||||||
function KeyConfigScene:render()
|
function KeyConfigScene:render()
|
||||||
love.graphics.setColor(1, 1, 1, 1)
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
drawBackground("options_input")
|
love.graphics.draw(
|
||||||
|
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,7 +58,11 @@ function ModeSelectScene:update()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ModeSelectScene:render()
|
function ModeSelectScene:render()
|
||||||
drawBackground(0)
|
love.graphics.draw(
|
||||||
|
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)
|
||||||
|
|
||||||
|
@ -6,9 +6,6 @@ ReplayScene.title = "Replay"
|
|||||||
|
|
||||||
function ReplayScene:new(replay, game_mode, ruleset)
|
function ReplayScene:new(replay, game_mode, ruleset)
|
||||||
config.gamesettings = replay["gamesettings"]
|
config.gamesettings = replay["gamesettings"]
|
||||||
if replay["delayed_auto_shift"] then config.das = replay["delayed_auto_shift"] end
|
|
||||||
if replay["auto_repeat_rate"] then config.arr = replay["auto_repeat_rate"] end
|
|
||||||
if replay["das_cut_delay"] then config.dcd = replay["das_cut_delay"] end
|
|
||||||
love.math.setRandomSeed(replay["random_low"], replay["random_high"])
|
love.math.setRandomSeed(replay["random_low"], replay["random_high"])
|
||||||
love.math.setRandomState(replay["random_state"])
|
love.math.setRandomState(replay["random_state"])
|
||||||
self.retry_replay = replay
|
self.retry_replay = replay
|
||||||
@ -32,13 +29,8 @@ 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
|
|
||||||
self.show_invisible = false
|
|
||||||
self.frame_steps = 0
|
|
||||||
DiscordRPC:update({
|
DiscordRPC:update({
|
||||||
details = "Viewing a replay",
|
details = "Viewing a replay",
|
||||||
state = self.game.name,
|
state = self.game.name,
|
||||||
@ -47,13 +39,7 @@ function ReplayScene:new(replay, game_mode, ruleset)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ReplayScene:update()
|
function ReplayScene:update()
|
||||||
local frames_left = self.replay_speed
|
if love.window.hasFocus() and not self.paused then
|
||||||
if not self.paused or self.frame_steps > 0 then
|
|
||||||
if self.frame_steps > 0 then
|
|
||||||
self.frame_steps = self.frame_steps - 1
|
|
||||||
end
|
|
||||||
while frames_left > 0 do
|
|
||||||
frames_left = frames_left - 1
|
|
||||||
self.inputs = self.replay["inputs"][self.replay_index]["inputs"]
|
self.inputs = self.replay["inputs"][self.replay_index]["inputs"]
|
||||||
self.replay["inputs"][self.replay_index]["frames"] = self.replay["inputs"][self.replay_index]["frames"] - 1
|
self.replay["inputs"][self.replay_index]["frames"] = self.replay["inputs"][self.replay_index]["frames"] - 1
|
||||||
if self.replay["inputs"][self.replay_index]["frames"] == 0 and self.replay_index < table.getn(self.replay["inputs"]) then
|
if self.replay["inputs"][self.replay_index]["frames"] == 0 and self.replay_index < table.getn(self.replay["inputs"]) then
|
||||||
@ -65,7 +51,6 @@ function ReplayScene:update()
|
|||||||
end
|
end
|
||||||
self.game:update(input_copy, self.ruleset)
|
self.game:update(input_copy, self.ruleset)
|
||||||
self.game.grid:update()
|
self.game.grid:update()
|
||||||
end
|
|
||||||
DiscordRPC:update({
|
DiscordRPC:update({
|
||||||
details = "Viewing a replay",
|
details = "Viewing a replay",
|
||||||
state = self.game.name,
|
state = self.game.name,
|
||||||
@ -79,30 +64,6 @@ 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)
|
||||||
@ -111,8 +72,6 @@ function ReplayScene:onInputPress(e)
|
|||||||
e.input == "menu_decide" or
|
e.input == "menu_decide" or
|
||||||
e.input == "retry"
|
e.input == "retry"
|
||||||
) then
|
) then
|
||||||
switchBGM(nil)
|
|
||||||
pitchBGM(1)
|
|
||||||
self.game:onExit()
|
self.game:onExit()
|
||||||
loadSave()
|
loadSave()
|
||||||
love.math.setRandomSeed(os.time())
|
love.math.setRandomSeed(os.time())
|
||||||
@ -127,23 +86,6 @@ 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
|
||||||
--frame step
|
|
||||||
elseif e.input == "rotate_left" then
|
|
||||||
self.frame_steps = self.frame_steps + 1
|
|
||||||
elseif e.input == "left" then
|
|
||||||
self.replay_speed = self.replay_speed - 1
|
|
||||||
if self.replay_speed < 1 then
|
|
||||||
self.replay_speed = 1
|
|
||||||
end
|
|
||||||
pitchBGM(self.replay_speed)
|
|
||||||
elseif e.input == "right" then
|
|
||||||
self.replay_speed = self.replay_speed + 1
|
|
||||||
if self.replay_speed > 99 then
|
|
||||||
self.replay_speed = 99
|
|
||||||
end
|
|
||||||
pitchBGM(self.replay_speed)
|
|
||||||
elseif e.input == "hold" then
|
|
||||||
self.show_invisible = not self.show_invisible
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -14,13 +14,9 @@ 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 success, new_replay = pcall(
|
local new_replay = binser.deserialize(data)[1]
|
||||||
function() return binser.deserialize(data)[1] end
|
|
||||||
)
|
|
||||||
if success then
|
|
||||||
replays[#replays + 1] = new_replay
|
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"]
|
||||||
end)
|
end)
|
||||||
@ -47,6 +43,8 @@ function ReplaySelectScene:new()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ReplaySelectScene:update()
|
function ReplaySelectScene:update()
|
||||||
|
switchBGM(nil) -- experimental
|
||||||
|
|
||||||
if self.das_up or self.das_down or self.das_left or self.das_right then
|
if self.das_up or self.das_down or self.das_left or self.das_right then
|
||||||
self.das = self.das + 1
|
self.das = self.das + 1
|
||||||
else
|
else
|
||||||
@ -76,12 +74,16 @@ function ReplaySelectScene:update()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ReplaySelectScene:render()
|
function ReplaySelectScene:render()
|
||||||
drawBackground(0)
|
love.graphics.draw(
|
||||||
|
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_8x11)
|
love.graphics.setFont(font_3x5_4)
|
||||||
love.graphics.print("SELECT REPLAY", 20, 35)
|
love.graphics.print("SELECT REPLAY", 20, 35)
|
||||||
|
|
||||||
if self.display_warning then
|
if self.display_warning then
|
||||||
|
@ -29,7 +29,11 @@ function SettingsScene:update() end
|
|||||||
|
|
||||||
function SettingsScene:render()
|
function SettingsScene:render()
|
||||||
love.graphics.setColor(1, 1, 1, 1)
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
drawBackground("options_game")
|
love.graphics.draw(
|
||||||
|
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,7 +46,11 @@ end
|
|||||||
|
|
||||||
function StickConfigScene:render()
|
function StickConfigScene:render()
|
||||||
love.graphics.setColor(1, 1, 1, 1)
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
drawBackground("options_input")
|
love.graphics.draw(
|
||||||
|
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
|
||||||
|
@ -74,7 +74,11 @@ local block_offsets = {
|
|||||||
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)
|
||||||
drawBackground("title_no_icon") -- title, title_night
|
love.graphics.draw(
|
||||||
|
backgrounds["title_no_icon"], -- title, title_night
|
||||||
|
0, 0, 0,
|
||||||
|
0.5, 0.5
|
||||||
|
)
|
||||||
|
|
||||||
-- 490, 192
|
-- 490, 192
|
||||||
for _, b in ipairs(block_offsets) do
|
for _, b in ipairs(block_offsets) do
|
||||||
@ -105,7 +109,11 @@ 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)
|
||||||
drawBackground("snow")
|
love.graphics.draw(
|
||||||
|
backgrounds["snow"],
|
||||||
|
0, 0, 0,
|
||||||
|
0.5, 0.5
|
||||||
|
)
|
||||||
|
|
||||||
love.graphics.draw(
|
love.graphics.draw(
|
||||||
misc_graphics["santa"],
|
misc_graphics["santa"],
|
||||||
|
@ -34,7 +34,11 @@ end
|
|||||||
|
|
||||||
function TuningScene:render()
|
function TuningScene:render()
|
||||||
love.graphics.setColor(1, 1, 1, 1)
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
drawBackground("options_game")
|
love.graphics.draw(
|
||||||
|
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)
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
@echo OFF
|
|
||||||
|
|
||||||
rem This solution of detecting the current CPU taken from here: https://stackoverflow.com/a/24590583
|
|
||||||
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set CURRENT_CPU=32BIT || set CURRENT_CPU=64BIT
|
|
||||||
|
|
||||||
if %CURRENT_CPU%==32BIT .\dist\win32\love.exe .
|
|
||||||
if %CURRENT_CPU%==64BIT .\dist\windows\love.exe .
|
|
1
start_win32.bat
Normal file
1
start_win32.bat
Normal file
@ -0,0 +1 @@
|
|||||||
|
dist\win32\love.exe .
|
1
start_win64.bat
Normal file
1
start_win64.bat
Normal file
@ -0,0 +1 @@
|
|||||||
|
dist\windows\love.exe .
|
@ -232,15 +232,12 @@ function Grid:applyBigPiece(piece)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- places where you see this take an argument used the old, buggy method
|
function Grid:checkForBravo(cleared_row_count)
|
||||||
function Grid:checkForBravo()
|
for i = 0, self.height - 1 - cleared_row_count do
|
||||||
for i = 0, self.height - 1 do
|
|
||||||
if not self:isRowFull(i+1) then
|
|
||||||
for j = 0, self.width - 1 do
|
for j = 0, self.width - 1 do
|
||||||
if self:isOccupied(j, i) then return false end
|
if self:isOccupied(j, i) then return false end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -10,10 +10,41 @@ BigA2Game.tagline = "Big blocks in the most celebrated TGM mode!"
|
|||||||
function BigA2Game:new()
|
function BigA2Game:new()
|
||||||
BigA2Game.super:new()
|
BigA2Game.super:new()
|
||||||
self.big_mode = true
|
self.big_mode = true
|
||||||
local getClearedRowCount = self.grid.getClearedRowCount
|
|
||||||
self.grid.getClearedRowCount = function(self)
|
|
||||||
return getClearedRowCount(self) / 2
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BigA2Game:updateScore(level, drop_bonus, cleared_lines)
|
||||||
|
cleared_lines = cleared_lines / 2
|
||||||
|
if not self.clear then
|
||||||
|
self:updateGrade(cleared_lines)
|
||||||
|
if cleared_lines >= 4 then
|
||||||
|
self.tetris_count = self.tetris_count + 1
|
||||||
|
end
|
||||||
|
if self.grid:checkForBravo(cleared_lines) then self.bravo = 4 else self.bravo = 1 end
|
||||||
|
if cleared_lines > 0 then
|
||||||
|
self.combo = self.combo + (cleared_lines - 1) * 2
|
||||||
|
self.score = self.score + (
|
||||||
|
(math.ceil((level + cleared_lines) / 4) + drop_bonus) *
|
||||||
|
cleared_lines * self.combo * self.bravo
|
||||||
|
)
|
||||||
|
else
|
||||||
|
self.combo = 1
|
||||||
|
end
|
||||||
|
self.drop_bonus = 0
|
||||||
|
else self.lines = self.lines + cleared_lines end
|
||||||
|
end
|
||||||
|
|
||||||
|
function BigA2Game:onLineClear(cleared_row_count)
|
||||||
|
cleared_row_count = cleared_row_count / 2
|
||||||
|
self:updateSectionTimes(self.level, self.level + cleared_row_count)
|
||||||
|
self.level = math.min(self.level + cleared_row_count, 999)
|
||||||
|
if self.level == 999 and not self.clear then
|
||||||
|
self.clear = true
|
||||||
|
self.grid:clear()
|
||||||
|
if self:qualifiesForMRoll() then self.grade = 32 end
|
||||||
|
self.roll_frames = -150
|
||||||
|
end
|
||||||
|
self.lock_drop = self.level >= 900
|
||||||
|
self.lock_hard_drop = self.level >= 900
|
||||||
end
|
end
|
||||||
|
|
||||||
return BigA2Game
|
return BigA2Game
|
@ -136,27 +136,25 @@ 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 init_name = string.format("replays/%s.crp", os.date("%Y-%m-%d_%H-%M-%S"))
|
local replay_files = love.filesystem.getDirectoryItems("replays")
|
||||||
local replay_name = init_name
|
-- Select replay filename that doesn't collide with an existing one
|
||||||
local replay_number = 0
|
local replay_number = 0
|
||||||
while true do
|
local collision = true
|
||||||
if love.filesystem.getInfo(replay_name, "file") then
|
while collision do
|
||||||
|
collision = false
|
||||||
replay_number = replay_number + 1
|
replay_number = replay_number + 1
|
||||||
replay_name = string.format("%s (%d)", init_name, replay_number)
|
for key, file in pairs(replay_files) do
|
||||||
else
|
if file == replay_number..".crp" then
|
||||||
|
collision = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
love.filesystem.write(replay_name, binser.serialize(replay))
|
end
|
||||||
|
love.filesystem.write("replays/"..replay_number..".crp", binser.serialize(replay))
|
||||||
end
|
end
|
||||||
|
|
||||||
function GameMode:addReplayInput(inputs)
|
function GameMode:addReplayInput(inputs)
|
||||||
@ -180,9 +178,6 @@ function GameMode:update(inputs, ruleset)
|
|||||||
if self.game_over or self.completed then
|
if self.game_over or self.completed then
|
||||||
if self.save_replay and self.game_over_frames == 0 then
|
if self.save_replay and self.game_over_frames == 0 then
|
||||||
self:saveReplay()
|
self:saveReplay()
|
||||||
|
|
||||||
-- ensure replays are only saved once per game, incase self.game_over_frames == 0 for longer than one frame
|
|
||||||
self.save_replay = false
|
|
||||||
end
|
end
|
||||||
self.game_over_frames = self.game_over_frames + 1
|
self.game_over_frames = self.game_over_frames + 1
|
||||||
return
|
return
|
||||||
@ -404,7 +399,6 @@ end
|
|||||||
|
|
||||||
function GameMode:onGameOver()
|
function GameMode:onGameOver()
|
||||||
switchBGM(nil)
|
switchBGM(nil)
|
||||||
pitchBGM(1)
|
|
||||||
local alpha = 0
|
local alpha = 0
|
||||||
local animation_length = 120
|
local animation_length = 120
|
||||||
if self.game_over_frames < animation_length then
|
if self.game_over_frames < animation_length then
|
||||||
@ -987,10 +981,12 @@ 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)
|
||||||
drawBackground(id)
|
love.graphics.draw(
|
||||||
|
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 < 2000 and math.floor(old_level / 100) < math.floor(new_level / 100)) or
|
(new_level < 2001 and math.floor(old_level / 100) < math.floor(new_level / 100)) or
|
||||||
(new_level >= 2020)
|
(new_level >= 2020)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
@ -353,10 +353,15 @@ function Marathon2020Game:updateSectionTimes(old_level, new_level)
|
|||||||
self.section_start_time = self.frames
|
self.section_start_time = self.frames
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(self.secondary_section_times[section] < cool_cutoffs[self.delay_level]) and
|
self.section_status[section - 1] == "cool" and
|
||||||
(section == 1 or self.secondary_section_times[section] <= self.secondary_section_times[section - 1] + 120)
|
self.secondary_section_times[section] <= self.secondary_section_times[section - 1] + 120 and
|
||||||
|
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,15 +249,12 @@ local grade_conversion = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function MarathonA2Game:whilePieceActive()
|
function MarathonA2Game:whilePieceActive()
|
||||||
if self.clear then return
|
|
||||||
else
|
|
||||||
self.grade_point_decay_counter = self.grade_point_decay_counter + 1
|
self.grade_point_decay_counter = self.grade_point_decay_counter + 1
|
||||||
if self.grade_point_decay_counter >= grade_point_decays[self.grade + 1] then
|
if self.grade_point_decay_counter >= grade_point_decays[self.grade + 1] then
|
||||||
self.grade_point_decay_counter = 0
|
self.grade_point_decay_counter = 0
|
||||||
self.grade_points = math.max(0, self.grade_points - 1)
|
self.grade_points = math.max(0, self.grade_points - 1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
function MarathonA2Game:updateGrade(cleared_lines)
|
function MarathonA2Game:updateGrade(cleared_lines)
|
||||||
if self.clear or cleared_lines == 0 then return
|
if self.clear or cleared_lines == 0 then return
|
||||||
|
@ -26,9 +26,7 @@ function MarathonA3Game:new()
|
|||||||
self.roll_points = 0
|
self.roll_points = 0
|
||||||
self.grade_point_decay_counter = 0
|
self.grade_point_decay_counter = 0
|
||||||
self.section_cool_grade = 0
|
self.section_cool_grade = 0
|
||||||
--self.section_status = { [0] = "none" }
|
self.section_status = { [0] = "none" }
|
||||||
self.section_cools = { [0] = 0 }
|
|
||||||
self.section_regrets = { [0] = 0 }
|
|
||||||
self.section_start_time = 0
|
self.section_start_time = 0
|
||||||
self.secondary_section_times = { [0] = 0 }
|
self.secondary_section_times = { [0] = 0 }
|
||||||
self.section_times = { [0] = 0 }
|
self.section_times = { [0] = 0 }
|
||||||
@ -203,23 +201,15 @@ function MarathonA3Game:updateSectionTimes(old_level, new_level)
|
|||||||
self.speed_level = self.section_cool and self.speed_level + 100 or self.speed_level
|
self.speed_level = self.section_cool and self.speed_level + 100 or self.speed_level
|
||||||
|
|
||||||
if section_time > regret_cutoffs[section] then
|
if section_time > regret_cutoffs[section] then
|
||||||
if self.grade > 0 then
|
self.section_cool_grade = self.section_cool_grade - 1
|
||||||
--this happens after the points are added, intentionally
|
table.insert(self.section_status, "regret")
|
||||||
local currentgrade = self:getAggregateGrade()
|
|
||||||
while self:getAggregateGrade() >= currentgrade do
|
|
||||||
self.grade = self.grade - 1
|
|
||||||
end
|
|
||||||
self.grade_points = 0
|
|
||||||
end
|
|
||||||
table.insert(self.section_regrets, 1)
|
|
||||||
self.coolregret_message = "REGRET!!"
|
self.coolregret_message = "REGRET!!"
|
||||||
self.coolregret_timer = 300
|
self.coolregret_timer = 300
|
||||||
else
|
elseif self.section_cool then
|
||||||
table.insert(self.section_regrets, 0)
|
|
||||||
end
|
|
||||||
|
|
||||||
if self.section_cool then
|
|
||||||
self.section_cool_grade = self.section_cool_grade + 1
|
self.section_cool_grade = self.section_cool_grade + 1
|
||||||
|
table.insert(self.section_status, "cool")
|
||||||
|
else
|
||||||
|
table.insert(self.section_status, "none")
|
||||||
end
|
end
|
||||||
|
|
||||||
self.section_cool = false
|
self.section_cool = false
|
||||||
@ -233,9 +223,6 @@ function MarathonA3Game:updateSectionTimes(old_level, new_level)
|
|||||||
self.section_cool = true
|
self.section_cool = true
|
||||||
self.coolregret_message = "COOL!!"
|
self.coolregret_message = "COOL!!"
|
||||||
self.coolregret_timer = 300
|
self.coolregret_timer = 300
|
||||||
table.insert(self.section_cools, 1)
|
|
||||||
else
|
|
||||||
table.insert(self.section_cools, 0)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -415,11 +402,9 @@ MarathonA3Game.mRollOpacityFunction = function(age)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function MarathonA3Game:sectionColourFunction(section)
|
function MarathonA3Game:sectionColourFunction(section)
|
||||||
if self.section_cools[section] == 1 and self.section_regrets[section] == 1 then
|
if self.section_status[section] == "cool" then
|
||||||
return { 1, 1, 0, 1 }
|
|
||||||
elseif self.section_cools[section] == 1 then
|
|
||||||
return { 0, 1, 0, 1 }
|
return { 0, 1, 0, 1 }
|
||||||
elseif self.section_regrets[section] == 1 then
|
elseif self.section_status[section] == "regret" then
|
||||||
return { 1, 0, 0, 1 }
|
return { 1, 0, 0, 1 }
|
||||||
else
|
else
|
||||||
return { 1, 1, 1, 1 }
|
return { 1, 1, 1, 1 }
|
||||||
|
@ -28,6 +28,7 @@ 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
|
||||||
|
|
||||||
@ -54,7 +55,7 @@ function PhantomManiaGame:getDasLimit()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function PhantomManiaGame:getLineClearDelay()
|
function PhantomManiaGame:getLineClearDelay()
|
||||||
return self:getLineARE() - 2
|
return self:getLineARE()
|
||||||
end
|
end
|
||||||
|
|
||||||
function PhantomManiaGame:getLockDelay()
|
function PhantomManiaGame:getLockDelay()
|
||||||
@ -119,6 +120,11 @@ 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
|
||||||
@ -169,10 +175,6 @@ 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)
|
||||||
|
|
||||||
@ -193,7 +195,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:qualifiesForGM() then
|
if self.level == 999 and self.section_req and self.tetrises >= 31 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,7 +41,6 @@ function PhantomMania2Game:new()
|
|||||||
|
|
||||||
self.coolregret_message = ""
|
self.coolregret_message = ""
|
||||||
self.coolregret_timer = 0
|
self.coolregret_timer = 0
|
||||||
self.coolregrets = { [0] = 0 }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function PhantomMania2Game:getARE()
|
function PhantomMania2Game:getARE()
|
||||||
@ -203,13 +202,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,30), frameTime(0,30), frameTime(0,30),
|
frameTime(0,27), frameTime(0,27), frameTime(0,27),
|
||||||
}
|
}
|
||||||
|
|
||||||
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,42), frameTime(0,42), frameTime(0,42), frameTime(0,42), frameTime(0,42),
|
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,35), frameTime(0,35), frameTime(0,35),
|
||||||
}
|
}
|
||||||
|
|
||||||
function PhantomMania2Game:updateSectionTimes(old_level, new_level)
|
function PhantomMania2Game:updateSectionTimes(old_level, new_level)
|
||||||
@ -220,14 +219,11 @@ function PhantomMania2Game:updateSectionTimes(old_level, new_level)
|
|||||||
self.section_start_time = self.frames
|
self.section_start_time = self.frames
|
||||||
if section_time <= cool_cutoffs[section] then
|
if section_time <= cool_cutoffs[section] then
|
||||||
self.grade = self.grade + 2
|
self.grade = self.grade + 2
|
||||||
table.insert(self.coolregrets, 2)
|
|
||||||
self.coolregret_message = "COOL!!"
|
self.coolregret_message = "COOL!!"
|
||||||
self.coolregret_timer = 300
|
self.coolregret_timer = 300
|
||||||
elseif section_time <= regret_cutoffs[section] then
|
elseif section_time <= regret_cutoffs[section] then
|
||||||
self.grade = self.grade + 1
|
self.grade = self.grade + 1
|
||||||
table.insert(self.coolregrets, 1)
|
|
||||||
else
|
else
|
||||||
table.insert(self.coolregrets, 0)
|
|
||||||
self.coolregret_message = "REGRET!!"
|
self.coolregret_message = "REGRET!!"
|
||||||
self.coolregret_timer = 300
|
self.coolregret_timer = 300
|
||||||
end
|
end
|
||||||
@ -296,16 +292,6 @@ function PhantomMania2Game:setHoldOpacity()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function PhantomMania2Game:sectionColourFunction(section)
|
|
||||||
if self.coolregrets[section] == 2 then
|
|
||||||
return { 0, 1, 0, 1 }
|
|
||||||
elseif self.coolregrets[section] == 0 then
|
|
||||||
return { 1, 0, 0, 1 }
|
|
||||||
else
|
|
||||||
return { 1, 1, 1, 1 }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function PhantomMania2Game:drawScoringInfo()
|
function PhantomMania2Game:drawScoringInfo()
|
||||||
PhantomMania2Game.super.drawScoringInfo(self)
|
PhantomMania2Game.super.drawScoringInfo(self)
|
||||||
|
|
||||||
|
@ -13,14 +13,4 @@ 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
|
||||||
(1900 <= self.level and self.level < 2019)
|
self.level == 2019
|
||||||
) then
|
) then
|
||||||
self.level = self.level + 1
|
self.level = self.level + 1
|
||||||
end
|
end
|
||||||
@ -201,7 +201,7 @@ end
|
|||||||
|
|
||||||
Survival2020Game.opacityFunction = function(age)
|
Survival2020Game.opacityFunction = function(age)
|
||||||
if age > 300 then return 0
|
if age > 300 then return 0
|
||||||
else return 1 - math.max(age - 240, 0) / 60 end
|
else return 1 - Math.max(age - 240, 0) / 60 end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Survival2020Game:drawGrid()
|
function Survival2020Game:drawGrid()
|
||||||
@ -249,7 +249,7 @@ function Survival2020Game:drawScoringInfo()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Survival2020Game:getBackground()
|
function Survival2020Game:getBackground()
|
||||||
return math.min(19, math.floor(self.level / 100))
|
return math.floor(self.level / 100)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Survival2020Game:getHighscoreData()
|
function Survival2020Game:getHighscoreData()
|
||||||
|
@ -1,49 +0,0 @@
|
|||||||
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
|
|
2
tetris/rulesets/standard_ace.lua → tetris/rulesets/arika_srs.lua
Normal file → Executable file
2
tetris/rulesets/standard_ace.lua → tetris/rulesets/arika_srs.lua
Normal file → Executable file
@ -1,5 +1,5 @@
|
|||||||
local Piece = require 'tetris.components.piece'
|
local Piece = require 'tetris.components.piece'
|
||||||
local Ruleset = require 'tetris.rulesets.standard_ti'
|
local Ruleset = require 'tetris.rulesets.ti_srs'
|
||||||
|
|
||||||
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.standard_ace'
|
local Ruleset = require 'tetris.rulesets.standard_exp'
|
||||||
|
|
||||||
local SRS = Ruleset:extend()
|
local SRS = Ruleset:extend()
|
||||||
|
|
||||||
@ -8,8 +8,6 @@ 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 = {
|
||||||
@ -35,8 +33,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
|
||||||
@ -71,12 +69,6 @@ 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
|
||||||
@ -93,8 +85,6 @@ function SRS:onPieceMove(piece, grid)
|
|||||||
if piece.manipulations >= SRS.MANIPULATIONS_MAX then
|
if piece.manipulations >= SRS.MANIPULATIONS_MAX then
|
||||||
piece.locked = true
|
piece.locked = true
|
||||||
end
|
end
|
||||||
else
|
|
||||||
piece.locked = false
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -112,6 +102,4 @@ end
|
|||||||
|
|
||||||
function SRS:canPieceRotate() return true end
|
function SRS:canPieceRotate() return true end
|
||||||
|
|
||||||
function SRS:get180RotationValue() return 2 end
|
|
||||||
|
|
||||||
return SRS
|
return SRS
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
local Piece = require 'tetris.components.piece'
|
local Piece = require 'tetris.components.piece'
|
||||||
local Ruleset = require 'tetris.rulesets.standard_ti'
|
local Ruleset = require 'tetris.rulesets.arika_srs'
|
||||||
|
|
||||||
local SRS = Ruleset:extend()
|
local SRS = Ruleset:extend()
|
||||||
|
|
||||||
@ -27,6 +27,8 @@ 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
|
||||||
|
Loading…
Reference in New Issue
Block a user