mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 05:09:02 -06:00
Compare commits
No commits in common. "2a2148413775d1524bda1f8faad544ab0de932b3" and "1556b247fe40a4ed28408c8b04feec04c3417492" have entirely different histories.
2a21484137
...
1556b247fe
@ -8,7 +8,7 @@ image_formats = {".png", ".jpg"}
|
||||
bgpath = "res/backgrounds/"
|
||||
dir = love.filesystem.getDirectoryItems(bgpath)
|
||||
|
||||
backgrounds = {}
|
||||
local backgrounds = {}
|
||||
|
||||
local function loadExtendedBgs()
|
||||
extended_bgs = require("res.backgrounds.extend_section_bg")
|
||||
@ -198,16 +198,3 @@ misc_graphics = {
|
||||
santa = love.graphics.newImage("res/img/santa.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.3.2"
|
@ -30,7 +30,11 @@ function CreditsScene:render()
|
||||
local offset = self.frames / self.scroll_speed
|
||||
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
drawBackground(19)
|
||||
love.graphics.draw(
|
||||
fetchBackgroundAndLoop(id),
|
||||
0, 0, 0,
|
||||
0.5, 0.5
|
||||
)
|
||||
|
||||
love.graphics.setFont(font_3x5_4)
|
||||
love.graphics.print("Cambridge Credits", 320, 500 - offset)
|
||||
|
@ -45,7 +45,11 @@ end
|
||||
|
||||
function ConfigScene:render()
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
drawBackground("options_game")
|
||||
love.graphics.draw(
|
||||
fetchBackgroundAndLoop("options_game"),
|
||||
0, 0, 0,
|
||||
0.5, 0.5
|
||||
)
|
||||
|
||||
love.graphics.setFont(font_3x5_4)
|
||||
love.graphics.print("GAME SETTINGS", 80, 40)
|
||||
|
@ -20,7 +20,11 @@ function ConfigScene:update() end
|
||||
|
||||
function ConfigScene:render()
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
drawBackground("options_input")
|
||||
love.graphics.draw(
|
||||
fetchBackgroundAndLoop("options_input"),
|
||||
0, 0, 0,
|
||||
0.5, 0.5
|
||||
)
|
||||
|
||||
love.graphics.setFont(font_3x5_4)
|
||||
love.graphics.print("INPUT CONFIG", 80, 40)
|
||||
|
@ -45,7 +45,11 @@ end
|
||||
|
||||
function KeyConfigScene:render()
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
drawBackground("input_config")
|
||||
love.graphics.draw(
|
||||
fetchBackgroundAndLoop("input_config"),
|
||||
0, 0, 0,
|
||||
0.5, 0.5
|
||||
)
|
||||
|
||||
love.graphics.setFont(font_3x5_2)
|
||||
for i, input in ipairs(configurable_inputs) do
|
||||
|
@ -58,7 +58,11 @@ function ModeSelectScene:update()
|
||||
end
|
||||
|
||||
function ModeSelectScene:render()
|
||||
drawBackground(0)
|
||||
love.graphics.draw(
|
||||
fetchBackgroundAndLoop(0),
|
||||
0, 0, 0,
|
||||
0.5, 0.5
|
||||
)
|
||||
|
||||
love.graphics.draw(misc_graphics["select_mode"], 20, 40)
|
||||
|
||||
|
@ -78,7 +78,11 @@ function ReplaySelectScene:update()
|
||||
end
|
||||
|
||||
function ReplaySelectScene:render()
|
||||
drawBackground(0)
|
||||
love.graphics.draw(
|
||||
fetchBackgroundAndLoop(0),
|
||||
0, 0, 0,
|
||||
0.5, 0.5
|
||||
)
|
||||
|
||||
-- Same graphic as mode select
|
||||
--love.graphics.draw(misc_graphics["select_mode"], 20, 40)
|
||||
|
@ -29,7 +29,11 @@ function SettingsScene:update() end
|
||||
|
||||
function SettingsScene:render()
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
drawBackground("options_game")
|
||||
love.graphics.draw(
|
||||
fetchBackgroundAndLoop("options_game"),
|
||||
0, 0, 0,
|
||||
0.5, 0.5
|
||||
)
|
||||
|
||||
love.graphics.setFont(font_3x5_4)
|
||||
love.graphics.print("SETTINGS", 80, 40)
|
||||
|
@ -46,7 +46,11 @@ end
|
||||
|
||||
function StickConfigScene:render()
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
drawBackground("options_input")
|
||||
love.graphics.draw(
|
||||
fetchBackgroundAndLoop("options_input"),
|
||||
0, 0, 0,
|
||||
0.5, 0.5
|
||||
)
|
||||
|
||||
love.graphics.setFont(font_3x5_2)
|
||||
for i, input in ipairs(configurable_inputs) do
|
||||
|
@ -73,7 +73,11 @@ local block_offsets = {
|
||||
function TitleScene:render()
|
||||
love.graphics.setFont(font_3x5_4)
|
||||
love.graphics.setColor(1, 1, 1, 1 - self.snow_bg_opacity)
|
||||
drawBackground("title_no_icon") -- title, title_night
|
||||
love.graphics.draw(
|
||||
fetchBackgroundAndLoop("title_no_icon"), -- title, title_night
|
||||
0, 0, 0,
|
||||
0.5, 0.5
|
||||
)
|
||||
|
||||
-- 490, 192
|
||||
for _, b in ipairs(block_offsets) do
|
||||
@ -95,7 +99,11 @@ function TitleScene:render()
|
||||
|
||||
love.graphics.setFont(font_3x5_2)
|
||||
love.graphics.setColor(1, 1, 1, self.snow_bg_opacity)
|
||||
drawBackground("snow")
|
||||
love.graphics.draw(
|
||||
fetchBackgroundAndLoop("snow"),
|
||||
0, 0, 0,
|
||||
0.5, 0.5
|
||||
)
|
||||
|
||||
love.graphics.draw(
|
||||
misc_graphics["santa"],
|
||||
|
@ -34,7 +34,11 @@ end
|
||||
|
||||
function TuningScene:render()
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
drawBackground("options_game")
|
||||
love.graphics.draw(
|
||||
fetchBackgroundAndLoop("options_game"),
|
||||
0, 0, 0,
|
||||
0.5, 0.5
|
||||
)
|
||||
|
||||
love.graphics.setColor(1, 1, 1, 0.5)
|
||||
love.graphics.rectangle("fill", 75, 98 + self.highlight * 75, 400, 33)
|
||||
|
@ -980,9 +980,13 @@ end
|
||||
|
||||
function GameMode:drawBackground()
|
||||
local id = self:getBackground()
|
||||
if type(id) == "number" then id = clamp(id, 0, #backgrounds) end
|
||||
-- if type(id) == "number" then id = clamp(id, 0, #backgrounds) end
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
drawBackground(id)
|
||||
love.graphics.draw(
|
||||
fetchBackgroundAndLoop(id),
|
||||
0, 0, 0,
|
||||
0.5, 0.5
|
||||
)
|
||||
end
|
||||
|
||||
function GameMode:drawFrame()
|
||||
|
Loading…
Reference in New Issue
Block a user