diff --git a/code/collision.lua b/code/collision.lua index 9e28060..1acae56 100644 --- a/code/collision.lua +++ b/code/collision.lua @@ -10,10 +10,10 @@ LoadedObjects.Rooms = {} --[[ Collision - [bool flag] isDisabled + [bool flag] is_disabled > if true used for collision - [bool flag] isColliding + [bool flag] is_colliding > if true, this collision is colliding [vec2 position] from - x, y @@ -31,7 +31,7 @@ LoadedObjects.Rooms = {} -- can also be called with only ox and oy, where they become the width and height instead function Collision:new(ox,oy,tx,ty) - local o = {isColliding = false, isDisabled = false} + local o = {is_colliding = false, is_disabled = false} if tx ~= nil and ty ~= nil then o.from = {x = ox, y = oy} @@ -77,7 +77,7 @@ function Collision:containsPoint(x, y) end function Collision:draw(color) - if self.isColliding == true then + if self.is_colliding == true then love.graphics.setColor(0,1,0,0.5) elseif color == 1 then love.graphics.setColor(1,0,0,0.5) diff --git a/code/debug.lua b/code/debug.lua index a90a3bb..e1d7ab4 100644 --- a/code/debug.lua +++ b/code/debug.lua @@ -21,8 +21,6 @@ function debugUI() i = i + 1 end end - -- player isOnGroundCheck - --love.graphics.main_Player love.graphics.setColor(1,0,0) end diff --git a/code/entities/arrow.lua b/code/entities/arrow.lua index 82fa5b6..ac6dc36 100644 --- a/code/entities/arrow.lua +++ b/code/entities/arrow.lua @@ -1,10 +1,10 @@ Arrow = Entity:new() +Arrow.type = "Arrow" + function Arrow:new(x,y,rotation,speed) local o = Entity:new(x,y) - o.type = "arrow" - o.pos = {x = x, y = y} o.speed = speed or 10 o.sprite_rotation = rotation or 0 diff --git a/code/entities/cursed_book.lua b/code/entities/cursed_book.lua index 64e82f8..a0f3527 100644 --- a/code/entities/cursed_book.lua +++ b/code/entities/cursed_book.lua @@ -1,9 +1,9 @@ CursedBook = Entity:new() +CursedBook.type = "CursedBook" function CursedBook:new(x,y) local o = Entity:new(x,y) - o.type = "cursed_book" -- behaviour o.pos = {x = x, y = y} o.speed = 0.01 diff --git a/code/entities/decoration.lua b/code/entities/decoration.lua index f603f45..d0f79ad 100644 --- a/code/entities/decoration.lua +++ b/code/entities/decoration.lua @@ -1,10 +1,9 @@ Decoration = Entity:new() +Decoration.type = "Decoration" function Decoration:new(x,y,animation,light_radius) local o = Entity:new(x,y) - o.type = "decoration" - o.pos = {x = x, y = y} -- animations diff --git a/code/entities/fairy.lua b/code/entities/fairy.lua index 18b4df5..d442add 100644 --- a/code/entities/fairy.lua +++ b/code/entities/fairy.lua @@ -1,10 +1,9 @@ Fairy = Entity:new() +Fairy.type = "Fairy" function Fairy:new(x,y) local o = Entity:new(x,y) - o.type = "fairy" - -- behaviour o.pos = {x = x, y = y} o.speed = 1.4 diff --git a/code/entities/hook_anchor.lua b/code/entities/hook_anchor.lua index e8c5b5a..73fcc47 100644 --- a/code/entities/hook_anchor.lua +++ b/code/entities/hook_anchor.lua @@ -1,9 +1,9 @@ HookAnchor = Entity:new() +HookAnchor.type = "HookAnchor" function HookAnchor:new(x,y,hook_distance) local o = Entity:new(x,y) - o.type = "hook_anchor" o.pos = {x = x, y = y} o.hook_distance = hook_distance or 100 diff --git a/code/entities/kupo.lua b/code/entities/kupo.lua index d19bec3..ec91591 100644 --- a/code/entities/kupo.lua +++ b/code/entities/kupo.lua @@ -1,10 +1,9 @@ Kupo = Entity:new() +Kupo.type = "Kupo" function Kupo:new(x,y) local o = Entity:new(x,y) - o.type = "kupo" - o.pos = {x = x, y = y} o.speed = 20 o.range = 200 @@ -142,7 +141,7 @@ function Kupo:handleAnimation() if self.vel.x ~= 0 then self.sprite_flip.x = math.sign(self.vel.x) end self.body:animate() - self:Draw(self.body) + self:draw(self.body) if self.draw_bow == true then self.bow:drawFrame( diff --git a/code/entities/particle.lua b/code/entities/particle.lua index f196932..dfe4ee1 100644 --- a/code/entities/particle.lua +++ b/code/entities/particle.lua @@ -1,6 +1,8 @@ -Particle = Entity:new() LoadedObjects.Particles = {} +Particle = Entity:new() +Particle.type = "Particle" + function Particle:new(x,y,particle_data) local o = Entity:new(x,y) diff --git a/code/entities/player.lua b/code/entities/player.lua index 3221ec1..4956632 100644 --- a/code/entities/player.lua +++ b/code/entities/player.lua @@ -1,9 +1,9 @@ Player = Entity:new() +Player.type = "Player" function Player:new(x,y) local o = Entity:new(x,y) - o.type = "player" -- physics o.zero_speed = 0.01 -- gameworld pixels @@ -166,7 +166,7 @@ function Player:doLogic() if self.is_hooked then self:unhook() else - local anchor = self:checkNearest("hook_anchor",self.hook_distance) + local anchor = self:checkNearest("HookAnchor",self.hook_distance) if anchor then self.is_hooked = true self.hook_distance = anchor.hook_distance diff --git a/code/entity.lua b/code/entity.lua index 6ef522e..1f317b5 100644 --- a/code/entity.lua +++ b/code/entity.lua @@ -179,7 +179,7 @@ function Entity:getCollidingAt(x,y,object) and y + self.box.from.y < collision.to.y and y + self.box.to.y > collision.from.y then - collision.isColliding = true + collision.is_colliding = true return collision end end diff --git a/code/game.lua b/code/game.lua index 7bd8755..515d8c8 100644 --- a/code/game.lua +++ b/code/game.lua @@ -39,9 +39,9 @@ function stepGame() end if Keybind:checkPressed(Keybind.debug.reload) then - MenuClear() + clearMenu() menu_type = "dialog" - MenuInit("dialog",DialogSequence.Example) + initMenu("dialog",dialog_sequence.example) end if Keybind:checkPressed(Keybind.debug.editor) then diff --git a/code/in_out.lua b/code/in_out.lua index e52b7f5..29e2f8f 100644 --- a/code/in_out.lua +++ b/code/in_out.lua @@ -46,6 +46,24 @@ function exportLevel(levelname, filename) exportFile:write("\n },") logPrint("- objects") exportFile:write("\n objects = {") + logPrint(" - spawns") + exportFile:write("\n spawns = {") + for i, v in ipairs(LoadedObjects.Spawns) do + if i > 1 then + exportFile:write(",") + end + exportFile:write("\n {") + exportFile:write(v.archetype.type) + exportFile:write(",{") + for i=1, #v.args do + if i > 1 then + exportFile:write(",") + end + exportFile:write(v.args[i]) + end + exportFile:write("}}") + end + exportFile:write("\n },") logPrint(" - rooms") exportFile:write("\n rooms = {") for i, room in ipairs(LoadedObjects.Rooms) do @@ -82,22 +100,6 @@ function scandir(directory) return t end ---[[ -return { - name = "level1", - tileset = tileset.library, - tiles = { - {13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 5,25,26, 6,25,26, 7, 0, 5,25,26, 7, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 5,37,38, 6,37,38, 7, 0, 5,37,38, 7, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 5,37,38, 6,37,38, 7, 0, 5,37,38, 7, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 5,49,50, 6,49,50, 7, 0, 5,49,50, 7, 0, 0, 0, 0, 0, 0}, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} - }, - objects = {} -} -]] if logging then -- Make log stuff os.execute( "mkdir \"./logs\"" ) diff --git a/code/keybind.lua b/code/keybind.lua index b1cfe27..c98e169 100644 --- a/code/keybind.lua +++ b/code/keybind.lua @@ -110,6 +110,7 @@ function Keybind:default() Keybind.debug.editor = { keys = {"f4"}} Keybind.debug.recording = { keys = {"f5"}} Keybind.debug.playback = { keys = {"f6"}} + Keybind.debug.respawn = { keys = {"f8"}} -- Editor Keybind.editor.palette_mode = { keys = {"tab"}} diff --git a/code/level.lua b/code/level.lua index 10614dd..5995b50 100644 --- a/code/level.lua +++ b/code/level.lua @@ -18,14 +18,23 @@ function loadLevelTiles() indexLevelTiles() createTileObjects() createRoomObjects() + getSpawns() end function createRoomObjects() + LoadedObjects.Rooms = {} for _, v in pairs(LevelData.objects.rooms) do table.insert(LoadedObjects.Rooms, Collision:new(v[1][1],v[1][2],v[2][1],v[2][2])) end end +function getSpawns() + LoadedObjects.Spawns = {} + for _, v in pairs(LevelData.objects.spawns) do + addSpawn(v[1],unpack(v[2])) + end +end + function expandLevelCanvas(horizontal,vertical) local horizontal = horizontal or 0 local vertical = vertical or 0 diff --git a/code/menu.lua b/code/menu.lua index 93c441b..ade73d6 100644 --- a/code/menu.lua +++ b/code/menu.lua @@ -1,6 +1,6 @@ function drawMenu(menu) local font = love.graphics.getFont() - love.graphics.setFont(LocaleFont) + love.graphics.setFont(locale_font) -- reset scale love.graphics.setScale() @@ -54,19 +54,19 @@ function stepMenu(menu) end function stepMenuPauseScreen() - if PauseResume:getVariable() == true then - PauseResume = nil - PauseOptions = nil - PauseExit = nil + if pause_resume:getVariable() == true then + pause_resume = nil + pause_options = nil + pause_exit = nil exitMenu() - elseif PauseExit:getVariable() == true then + elseif pause_exit:getVariable() == true then love.event.quit() end end function stepMenuDialog() - if DialogContainer.value >= DialogContainer.target_value then - DialogContainer = nil + if dialog_container.value >= dialog_container.target_value then + dialog_container = nil exitMenu() end end @@ -90,55 +90,55 @@ function initMenu(menu,parameter) initMenuPauseScreen() elseif menu == "dialog" then if parameter == nil then - parameter = DialogSequence.Example + parameter = dialog_sequence.Example end initMenuDialog(parameter) end end function initMenuDialog(parameter) - DialogContainer = interfaceDialog:new() - DialogContainer:loadSequence(parameter) + dialog_container = InterfaceDialog:new() + dialog_container:loadSequence(parameter) end function initMenuPauseScreen() - local buttonStandard = {width = 200, height = 30, separation = 10} + local button_standard = {width = 200, height = 30, separation = 10} -- elements - PauseResume = InterfaceButton:new( + pause_resume = InterfaceButton:new( game.width/2, - game.height/2-buttonStandard.height-buttonStandard.separation, - buttonStandard.width, - buttonStandard.height, + game.height/2-button_standard.height-button_standard.separation, + button_standard.width, + button_standard.height, {false,true}, 1, { - text = Locale.ui.pause_screen_resume, + text = locale.ui.pause_screen_resume, color = {0,0,0.5}, color2 = {1,1,1} } ) - PauseOptions = InterfaceButton:new( + pause_options = InterfaceButton:new( game.width/2, game.height/2, - buttonStandard.width, - buttonStandard.height, + button_standard.width, + button_standard.height, {false,true}, 1, { - text = Locale.ui.pause_screen_options, + text = locale.ui.pause_screen_options, color = {0,0,0.5}, color2 = {1,1,1} } ) - PauseExit = InterfaceButton:new( + pause_exit = InterfaceButton:new( game.width/2, - game.height/2+buttonStandard.height+buttonStandard.separation, - buttonStandard.width, - buttonStandard.height, + game.height/2+button_standard.height+button_standard.separation, + button_standard.width, + button_standard.height, {false,true}, 1, { - text = Locale.ui.pause_screen_exit, + text = locale.ui.pause_screen_exit, color = {0,0,0.5}, color2 = {1,1,1} } diff --git a/code/objects.lua b/code/objects.lua index 434c91e..7f8aa4e 100644 --- a/code/objects.lua +++ b/code/objects.lua @@ -7,8 +7,8 @@ function LoadedObjects.drawCollisions() end for _, platform in pairs(LoadedObjects.Platforms) do - if platform.disable == true then platform:Draw(2) end - if platform.disable == false then platform:Draw(1) end + if platform.is_disabled == true then platform:Draw(2) end + if platform.is_disabled == false then platform:Draw(1) end end for _, ladder in pairs(LoadedObjects.Ladders) do @@ -23,13 +23,13 @@ end -- returns true if theres a collision at that point function isThereObjectAt(x,y,objectType) for _, object in pairs(objectType) do - if object.disable then + if object.is_disabled then -- Dont calculate if dissabled elseif x >= object.from.x and x <= object.to.x and y >= object.from.y and y <= object.to.y then - object.isColliding = true + object.is_colliding = true return true end end @@ -54,21 +54,21 @@ function setCollisionFlags() } for _, type in pairs(Check) do for _, object in pairs(type) do - object.isColliding = false + object.is_colliding = false end end for _, platform in pairs(LoadedObjects.Platforms) do - if main_Player.pos.y < platform.from.y then - platform.disable = false + if main_player.pos.y < platform.from.y then + platform.is_disabled = false else - platform.disable = true + platform.is_disabled = true end end for _, platform in pairs(LoadedObjects.Hazards) do - if main_Player.isOnGround then - platform.disable = true + if main_player.isOnGround then + platform.is_disabled = true else - platform.disable = false + platform.is_disabled = false end end end diff --git a/code/require.lua b/code/require.lua index aeece38..475343e 100644 --- a/code/require.lua +++ b/code/require.lua @@ -22,6 +22,7 @@ require "code/queue" -- objects require "code/entity" +require "code/spawn" require "code/canvas" require "code/collision" require "code/lights" diff --git a/code/spawn.lua b/code/spawn.lua new file mode 100644 index 0000000..f964e03 --- /dev/null +++ b/code/spawn.lua @@ -0,0 +1,15 @@ +LoadedObjects.Spawns = {} + +function addSpawn(archetype, ...) + local o = { + archetype = archetype, + args = {...} + } + table.insert(LoadedObjects.Spawns, o) +end + +function activateSpawns() + for _, spawn in pairs(LoadedObjects.Spawns) do + spawn.archetype:new(unpack(spawn.args)) + end +end diff --git a/data/dialog_sequences.lua b/data/dialog_sequences.lua index 79eb2e5..d55ee04 100644 --- a/data/dialog_sequences.lua +++ b/data/dialog_sequences.lua @@ -1,7 +1,7 @@ dialog_sequence = {} -dialog_sequence.Example = { - {Locale.dialogue.example[1],Locale.name.fairy}, - {Locale.dialogue.example[2],Locale.name.chaos}, - {Locale.dialogue.example[3],Locale.name.life} +dialog_sequence.example = { + {locale.dialogue.example[1],locale.name.fairy}, + {locale.dialogue.example[2],locale.name.chaos}, + {locale.dialogue.example[3],locale.name.life} } diff --git a/data/levels/level1.lua b/data/levels/level1.lua index 6db7452..d814a6f 100644 --- a/data/levels/level1.lua +++ b/data/levels/level1.lua @@ -2,38 +2,41 @@ return { name = "unnamed", tileset = tileset.library, properties = { - darkness = true + darkness = false }, tiles = { - { 4, 0, 0, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, - { 4, 0, 0, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, - { 4, 0, 0, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, - { 4, 0, 0, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, -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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} }, objects = { + spawns = { + {Fairy,{100,88}}, + {HookAnchor,{200,89,100}}, + {HookAnchor,{400,89,120}} + }, rooms = { - {{16,0},{128,208}}, - {{96,128},{272,240}}, - {{224,80},{336,192}}, - {{400,32},{560,352}} - } + {{96,64},{544,320}}, + {{0,0},{112,176}} + }, }, } diff --git a/data/locale/ENG.lua b/data/locale/ENG.lua index 18651f2..465e4a7 100644 --- a/data/locale/ENG.lua +++ b/data/locale/ENG.lua @@ -1,16 +1,16 @@ -LocaleFont = love.graphics.getFont() +locale_font = love.graphics.getFont() -Locale = {} +locale = {} -Locale.ui = {} -Locale.ui.pause_screen_resume = "Resume" -Locale.ui.pause_screen_options = "Options" -Locale.ui.pause_screen_exit = "Exit" +locale.ui = {} +locale.ui.pause_screen_resume = "Resume" +locale.ui.pause_screen_options = "Options" +locale.ui.pause_screen_exit = "Exit" -Locale.name = {} -Locale.name.fairy = "Ozy" -Locale.name.chaos = "Aelato" -Locale.name.life = "Olidia" +locale.name = {} +locale.name.fairy = "Ozy" +locale.name.chaos = "Aelato" +locale.name.life = "Olidia" -Locale.dialogue = {} -Locale.dialogue.example = {"Hello!","Duh.","Lol"} +locale.dialogue = {} +locale.dialogue.example = {"Hello!","Duh.","Lol"} diff --git a/data/locale/HEON.lua b/data/locale/HEON.lua index d8c9120..011215a 100644 --- a/data/locale/HEON.lua +++ b/data/locale/HEON.lua @@ -1,16 +1,16 @@ -LocaleFont = love.graphics.newFont("assets/ui/fonts/heon.ttf",18) +locale_font = love.graphics.newFont("assets/ui/fonts/heon.ttf",18) -Locale = {} +locale = {} -Locale.ui = {} -Locale.ui.pause_screen_resume = "" -Locale.ui.pause_screen_options = "" -Locale.ui.pause_screen_exit = "" +locale.ui = {} +locale.ui.pause_screen_resume = "" +locale.ui.pause_screen_options = "" +locale.ui.pause_screen_exit = "" -Locale.name = {} -Locale.name.fairy = "" -Locale.name.chaos = "" -Locale.name.life = "" +locale.name = {} +locale.name.fairy = "" +locale.name.chaos = "" +locale.name.life = "" -Locale.dialogue = {} -Locale.dialogue.example = {"","",""} +locale.dialogue = {} +locale.dialogue.example = {"","",""} diff --git a/main.lua b/main.lua index 4ef9819..b801271 100644 --- a/main.lua +++ b/main.lua @@ -53,13 +53,7 @@ function love.load() main_player = Player:new(75,50) - --Kupo:new(100,150) - --Kupo:new(300,150) - HookAnchor:new(200,89) - HookAnchor:new(400,89) - Fairy:new(200,88) - --CursedBook:new(180,68) - + activateSpawns() --love.audio.play(music.placeholder) end @@ -109,6 +103,10 @@ function love.update(dt) return end + if Keybind:checkPressed(Keybind.debug.respawn) then + activateSpawns() + end + if love.keyboard.isDown("f7") then local test_prompt = Prompt:new({ name = "test prompt",