first commit

This commit is contained in:
Squishy (C6H12O6+NaCl+H2O)
2024-04-11 08:33:58 +07:00
commit d0307c8765
72 changed files with 8974 additions and 0 deletions

2
load/bigint.lua Normal file
View File

@@ -0,0 +1,2 @@
bigint = require "libs.bigint.bigint"
number_names = require "libs.bigint.named-powers-of-ten"

2
load/fonts.lua Normal file
View File

@@ -0,0 +1,2 @@
tromi_font = love.graphics.newFont('res/fonts/monofonto rg.otf', 28)
big_font = love.graphics.newFont('res/fonts/monofonto rg.otf', 56)

48
load/graphics.lua Normal file
View File

@@ -0,0 +1,48 @@
backgrounds = {
[0] = love.graphics.newVideo("res/backgrounds/green_waterfall.ogv", {audio=false}),
love.graphics.newVideo("res/backgrounds/water.ogv", {audio=false}),
love.graphics.newVideo("res/backgrounds/green_streams.ogv", {audio=false}),
love.graphics.newVideo("res/backgrounds/streams.ogv", {audio=false}),
love.graphics.newVideo("res/backgrounds/red_forest_waterfall.ogv", {audio=false}),
love.graphics.newVideo("res/backgrounds/flowers_rain.ogv", {audio=false}),
love.graphics.newVideo("res/backgrounds/moonlight_tree.ogv", {audio=false}),
love.graphics.newVideo("res/backgrounds/lisa_frank.ogv", {audio=false}),
love.graphics.newVideo("res/backgrounds/snowy_trees.ogv", {audio=false}),
love.graphics.newVideo("res/backgrounds/snowy_cabin.ogv", {audio=false}),
}
blocks = {
["2tie"] = {
R = love.graphics.newImage("res/img/r.png"),
O = love.graphics.newImage("res/img/o.png"),
Y = love.graphics.newImage("res/img/y.png"),
G = love.graphics.newImage("res/img/g.png"),
C = love.graphics.newImage("res/img/b.png"),
B = love.graphics.newImage("res/img/i.png"),
M = love.graphics.newImage("res/img/v.png"),
F = love.graphics.newImage("res/img/bl.png"),
A = love.graphics.newImage("res/img/bl.png"),
X = love.graphics.newImage("res/img/t.png"),
W = love.graphics.newImage("res/img/w.png"),
R_d = love.graphics.newImage("res/img/r_d.png"),
O_d = love.graphics.newImage("res/img/o_d.png"),
Y_d = love.graphics.newImage("res/img/y_d.png"),
G_d = love.graphics.newImage("res/img/g_d.png"),
C_d = love.graphics.newImage("res/img/b_d.png"),
B_d = love.graphics.newImage("res/img/i_d.png"),
M_d = love.graphics.newImage("res/img/v_d.png"),
}
}
ColourSchemes = {
Arika = {
I = "R",
L = "O",
J = "B",
S = "M",
Z = "G",
O = "Y",
T = "C",
}
}

29
load/save.lua Normal file
View File

@@ -0,0 +1,29 @@
local binser = require 'libs.binser'
local fs = love.filesystem
function loadSave()
config = loadFromFile(CONFIG_FILE)
end
function loadFromFile(filename)
local save_data = fs.read(filename)
if save_data == nil then
return {} -- new object
end
return binser.deserialize(save_data)[1]
end
function initConfig()
if config.fullscreen == nil then config.fullscreen = false end
if config.music == nil then config.music = true end
if not config.input then
scene = InputConfigScene(true)
else
scene = TitleScene()
end
end
function saveConfig()
fs.write(CONFIG_FILE,binser.serialize(config))
end

49
load/sounds.lua Normal file
View File

@@ -0,0 +1,49 @@
sounds = {
bottom = love.audio.newSource("res/se/bottom.wav", "static"),
lock = love.audio.newSource("res/se/lock.wav", "static"),
erase = love.audio.newSource("res/se/erase.wav", "static"),
fall = love.audio.newSource("res/se/fall.wav", "static"),
ready = love.audio.newSource("res/se/ready.wav", "static"),
promote = love.audio.newSource("res/se/promote.wav", "static"),
demote = love.audio.newSource("res/se/demote.wav", "static"),
autopromote = love.audio.newSource("res/se/autopromote.wav", "static"),
bgm_firsthalf = love.audio.newSource("res/bgm/firsthalf.flac", "static"),
bgm_secondhalf = love.audio.newSource("res/bgm/secondhalf.flac", "static"),
bgm_title = love.audio.newSource("res/bgm/title.flac", "static")
}
function playSE(sound, subsound)
if sound ~= nil then
if subsound ~= nil then
sounds[sound][subsound]:setVolume(0.4)
if sounds[sound][subsound]:isPlaying() then
sounds[sound][subsound]:stop()
end
sounds[sound][subsound]:play()
else
sounds[sound]:setVolume(0.4)
if sounds[sound]:isPlaying() then
sounds[sound]:stop()
end
sounds[sound]:play()
end
end
end
function playSEOnce(sound, subsound)
if sound ~= nil then
if subsound ~= nil then
sounds[sound][subsound]:setVolume(0.4)
if sounds[sound][subsound]:isPlaying() then
return
end
sounds[sound][subsound]:play()
else
sounds[sound]:setVolume(0.4)
if sounds[sound]:isPlaying() then
return
end
sounds[sound]:play()
end
end
end