Fish fillets remake https://glitchapp.codeberg.page/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
fish-fillets-remake/game/mainfunctions/savegame.lua

411 lines
12 KiB

function savegameload()
--buttons
profile1Button = {
text = "profile1",
x = 1000,
y = 10,
r = 0,
sx = 1,
hovered = false,
color = {1,1,1},
hoveredColor = {1,1,0},
font = poorfishmiddle,
}
playerProgress = {
[1] = "first", -- index is number, value is string
playerName = "GlitchApp", -- index is string, value is string
outlineColor = {0, 0.5, 1}, -- index is string, value is list of values
gameFinished = false, -- index is string, value is boolean
--extra menus
leveleditorunlocked=true,
extrasunlocked=true,
musicplayerunlocked=true,
--unlocked music
--pixelsphere
pixelsphereunlocked=true,
enchanted_song=true,
aquaria_song=true,
sirens_song=true,
song18_song=true,
song21_song=true,
vapor_song=true,
calmrelax_song=true,
ambientI_song=true,
ambientII_song=true,
ambientIII_song=true,
anotheraugust_song=true,
sevenandeight_song=true,
novemembersnow_song=true,
icyrealm_song=true,
happylullaby_song=true,
thehex_song=true,
--isaiah658
isaiah658unlocked=true,
ambient_song=true,
underwater2_song=true,
--umplix
umplixunlocked=true,
deepsea_song=true,
sinkingfeeling_song=true,
--ericmatyas
ericmatyasunlocked=true,
hyp_song=true,
dream_song=true,
islandofmysteries_song=true,
monkeyislandband_song=true,
puzzlegame_song=true,
theyarehere_song=true,
--cleytonkauffman
cleytonkauffmanunlocked=true,
underwaterI_song=true,
underwaterII_song=true,
--marcelofg
marcelofunlocked=true,
airy_song=true,
--springyspringo
springyspringounlocked=true,
water_song=true,
--tokyogeisha
tokyogeishaunlocked=true,
ambience_song=true,
ambienceII_song=true,
creep_song=true,
--poinl
poinlunlocked=true,
nautilus_song=true,
--hectavex
hectavexunlocked=true,
rupture_song=true,
ova_song=true,
vanish_song=true,
--tedkerr
tedkerrunlocked=true,
crashedship_song=true,
scifi_song=true,
--isao
isaounlocked=true,
upbeat_song=true,
epicdance_song=true,
--Vikto Kraus
viktorkrausunlocked=true,
arobotswaytoheavenunlocked=true,
--levels unlocked
--0.Fishhouse
true,--1
true,--2
true,--3
true,--4
true,--5
true,--6
true,--7
true,--8
--1.Ship Wrecks
true,--9
true,--10
true,--11
true,--12
true,--13
true,--14
true,--15
true,--16
true,--17
true,--18
true,--19
--3. City in the deep
true,--20
true,--21
true,--22
true,--23
true,--24
true,--25
true,--26
true,--27
true,--28
true,--29
--5. Coral reef
true,--30
true,--31
true,--32
true,--33
true,--34
true,--35
true,--36
true,--37
--7. Dump
true,--38
true,--39
true,--40
true,--41
true,--42
true,--43
true,--44
--2.Silver's ship
true,--45
true,--46
true,--47
true,--48
true,--49
true,--50
true,--51
--4.UFO
true,--52
true,--53
true,--54
true,--55
true,--56
true,--57
true,--58
--6. Treasure cave
true,--59
true,--60
true,--61
true,--62
true,--63
true,--64
--8. Secret computer
true,--65
true,--66
true,--67
true,--68
true,--69
true,--70
--9. NG
true,--71
true,--72
true,--73
true,--74
true,--75
true,--76
true,--77
true,--78
true,--79
}
Gameoptions= {
-- sound and music
soundon=true,
musicison=true,
--Language
language="en",
language2="en",
accent="br",
accent2="br",
--shaders
shader1=false, --crt effect
shader2=true, --caustics effect
talkies=true, --Subtitles
palette=1, -- Color scheme
threeD=false, --3d
touchinterfaceison=false, --touch interface
res="1080p", --resolution
fullscreen=false, --full screen mode
}
end
function loadmygame()
savedgame = love.filesystem.read("savedgames/save.txt")
end
function savemygame()
--achievements
--unlocked features
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", leveleditorunlocked , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", extrasunlocked , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", musicplayerunlocked , all )
--unlocked music
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", musicplayerunlocked , all )
--unlocked music authors and tracks
--pixelsphere
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", pixelsphereunlocked , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", enchanted_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", aquaria_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", sirens_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", song18_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", song21_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", vapor_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", calmrelax_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", ambientI_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", ambientII_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", ambientIII_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", anotheraugust_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", sevenandeight_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", novemembersnow_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", icyrealm_song , all )
--isaiah658
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", isaiah658unlocked , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", ambient_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", underwater2_song , all )
--umplix
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", umplixunlocked , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", deepsea_song, all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", sinkingfeeling_song, all )
--ericmatyas
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", ericmatyasunlocked , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", hyp_song, all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", dream_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", islandofmysteries_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", monkeyislandband_song, all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", puzzlegame_song, all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", theyarehere_song, all )
--cleytonkauffman
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", cleytonkauffmanunlocked , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", underwaterI_song, all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", underwaterII_song , all )
--marcelof
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", marcelofunlocked , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", airy_song, all )
--springyspringo
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", springyspringounlocked , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", water_song , all )
--tokygeisha
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", tokyogeishaunlocked , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", ambience_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", ambienceII_song, all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", creep_song, all )
--poinl
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", poinlunlocked , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", nautilus_song, all )
--hectavex
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", hectavexunlocked , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", rupture_song , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", ova_song, all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", vanish_song , all )
--tedkerr
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", tedkerrunlocked , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", crashedship_song, all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", scifi_song, all )
--isao
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", isaounlocked , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", upbeat_song, all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", epicdance_song , all )
--viktorkraus
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", viktorkrausunlocked , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", arobotswaytoheavenunlocked , all )
--unlocked ends
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", extrasunlocked , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", fishhouseunlockedend , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", shipwrecksunlockedend , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", silversshipunlockedend , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", cityinthedeepunlockedend , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", ufounlockedend , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", coralreefunlockedend , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", treasurecaveunlockedend , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", dumpunlockedend , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", secretcomputerunlockedend , all )
success, errormsg = love.filesystem.append( "savedgames/savedgame1.txt", nextgenerationunlockedend , all )
--unlocked levels
savedgame,savedgamemessage = love.filesystem.write("savedgames/savedgame1.txt",unlockedlevels,all)
if success then
print ('file created')
else
print ('file not created: '..savedgamemessage)
end
end
--buttons
local function isButtonHovered (button)
local font = button.font or love.graphics.getFont( )
local width = font:getWidth(button.text)
local height = font:getHeight( )
local sx, sy = button.sx or 1, button.sy or button.sx or 1
local x, y = button.x, button.y
local w, h = width*sx, height*sy
local mx, my = love.mouse.getPosition()
if mx >= x and mx <= x+w
and my >= y and my <= y+h then
button.w, button.h = w, h
return true
end
return false
end
local function drawButton (button, hovered,text)
love.graphics.setFont( button.font )
if hovered then
love.graphics.setColor(button.hoveredColor)
love.graphics.rectangle ('line', button.x, button.y, button.w, button.h)
else
love.graphics.setColor(button.color)
end
love.graphics.print(text,button.x,button.y,button.r,button.sx)
end
function savegamedraw()
--
hovered = isButtonHovered (Button)
drawButton (Button, hovered,"Button")
if hovered and love.mouse.isDown(1) then
if love.mouse.isDown(1) then
music:stop()
love.timer.sleep( 0.5 )
end
end
end