mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-12-22 12:29:03 -06:00
made the experience feel closer to arcade stackers
This commit is contained in:
parent
27e699841e
commit
bfbba75f17
@ -39,7 +39,7 @@ function initConfig()
|
||||
else
|
||||
if config.current_mode then current_mode = config.current_mode end
|
||||
if config.current_ruleset then current_ruleset = config.current_ruleset end
|
||||
scene = TitleScene()
|
||||
scene = ArcadeScene()
|
||||
end
|
||||
end
|
||||
|
||||
|
3
main.lua
3
main.lua
@ -103,6 +103,9 @@ function love.keypressed(key, scancode)
|
||||
scene = InputConfigScene()
|
||||
switchBGM(nil)
|
||||
loadSave()
|
||||
elseif scancode == "f8" and scene.title == "Arcade" then
|
||||
scene = TitleScene()
|
||||
playSE("mode_decide")
|
||||
-- secret sound playing :eyes:
|
||||
elseif scancode == "f8" and scene.title == "Title" then
|
||||
config.secret = not config.secret
|
||||
|
@ -8,6 +8,7 @@ function Scene:render() end
|
||||
function Scene:onInputPress() end
|
||||
function Scene:onInputRelease() end
|
||||
|
||||
ArcadeScene = require "scene.arcade"
|
||||
ExitScene = require "scene.exit"
|
||||
GameScene = require "scene.game"
|
||||
ReplayScene = require "scene.replay"
|
||||
|
52
scene/arcade.lua
Normal file
52
scene/arcade.lua
Normal file
@ -0,0 +1,52 @@
|
||||
local ArcadeScene = Scene:extend()
|
||||
|
||||
ArcadeScene.title = "Arcade"
|
||||
|
||||
function ArcadeScene:new()
|
||||
self.frames = 0
|
||||
DiscordRPC:update({
|
||||
details = "In menus",
|
||||
state = "Waiting for a credit",
|
||||
largeImageKey = "icon2",
|
||||
largeImageText = version
|
||||
})
|
||||
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 ArcadeScene:update()
|
||||
self.frames = self.frames + 1
|
||||
end
|
||||
|
||||
function ArcadeScene:render()
|
||||
love.graphics.setFont(font_3x5_3)
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
love.graphics.draw(
|
||||
backgrounds["title_no_icon"],
|
||||
0, 0, 0,
|
||||
0.5, 0.5
|
||||
)
|
||||
|
||||
for _, b in ipairs(block_offsets) do
|
||||
love.graphics.draw(
|
||||
blocks["2tie"][b.color],
|
||||
272 + b.x, 144 + b.y, 0,
|
||||
2, 2
|
||||
)
|
||||
end
|
||||
|
||||
love.graphics.printf("CAMBRIDGE: THE OPEN SOURCE ARCADE STACKER", 0, 256, 640, "center")
|
||||
love.graphics.setFont(font_3x5_2)
|
||||
love.graphics.setColor(1, 1, 1, 1 - (math.floor(self.frames / 60) % 2))
|
||||
love.graphics.printf("Insert 1 credit(s)", 0, 416, 640, "center")
|
||||
end
|
||||
|
||||
return ArcadeScene
|
@ -64,18 +64,19 @@ function GameScene:onInputPress(e)
|
||||
highscore_hash = self.game.hash .. "-" .. self.ruleset.hash
|
||||
submitHighscore(highscore_hash, highscore_entry)
|
||||
self.game:onExit()
|
||||
scene = e.input == "retry" and GameScene(self.retry_mode, self.retry_ruleset, self.secret_inputs) or ModeSelectScene()
|
||||
scene = ArcadeScene()
|
||||
-- e.input == "retry" and GameScene(self.retry_mode, self.retry_ruleset, self.secret_inputs) or ModeSelectScene()
|
||||
elseif e.input == "retry" then
|
||||
switchBGM(nil)
|
||||
self.game:onExit()
|
||||
scene = GameScene(self.retry_mode, self.retry_ruleset, self.secret_inputs)
|
||||
scene = ArcadeScene() --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
|
||||
self.paused = not self.paused
|
||||
if self.paused then pauseBGM()
|
||||
else resumeBGM() end
|
||||
elseif e.input == "menu_back" then
|
||||
self.game:onExit()
|
||||
scene = ModeSelectScene()
|
||||
scene = ArcadeScene() -- ModeSelectScene()
|
||||
elseif e.input and string.sub(e.input, 1, 5) ~= "menu_" then
|
||||
self.inputs[e.input] = true
|
||||
end
|
||||
|
@ -78,7 +78,7 @@ function KeyConfigScene:onInputPress(e)
|
||||
if not config.input then config.input = {} end
|
||||
config.input.keys = self.new_input
|
||||
saveConfig()
|
||||
scene = had_config and InputConfigScene() or TitleScene()
|
||||
scene = had_config and InputConfigScene() or ArcadeScene()
|
||||
elseif e.scancode == "delete" or e.scancode == "backspace" then
|
||||
-- retry
|
||||
self.input_state = 1
|
||||
|
@ -86,7 +86,7 @@ function StickConfigScene:onInputPress(e)
|
||||
if not config.input then config.input = {} end
|
||||
config.input.joysticks = self.new_input
|
||||
saveConfig()
|
||||
scene = had_config and InputConfigScene() or TitleScene()
|
||||
scene = had_config and InputConfigScene() or ArcadeScene()
|
||||
elseif e.scancode == "delete" or e.scancode == "backspace" then
|
||||
-- retry
|
||||
self.input_state = 1
|
||||
|
Loading…
Reference in New Issue
Block a user