From 2e352657813b37d17c2215b85189f18a50c099f9 Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 19 Mar 2017 03:29:32 +0100 Subject: Comments, todos, pretty useless --- main.lua | 4 ++++ not/Cloud.lua | 1 + not/Decoration.lua | 2 ++ not/Effect.lua | 2 ++ not/Hero.lua | 2 ++ not/Platform.lua | 3 +++ not/Sprite.lua | 1 + 7 files changed, 15 insertions(+) diff --git a/main.lua b/main.lua index 9180ebf..b985648 100644 --- a/main.lua +++ b/main.lua @@ -1,8 +1,11 @@ -- "NOTNAUTS" -- WHOLE CODE HAS FLAG OF "need a cleanup" +-- TODO: Any lua source file in root directory that is not `main` (this file), `conf` should be moved to a proper directory. Its name should be changed to show what it contains. + -- Pretend you didn't see this -- This is work for scene manager +-- TODO: Create SceneManager or similar class. Scene = nil function changeScene(scene) if Scene ~= nil then @@ -12,6 +15,7 @@ function changeScene(scene) end -- Should be moved to scene/camera +-- TODO: move following functions to `Camera`. function getScale() return math.max(1, math.floor(math.max(love.graphics.getWidth() / 320, love.graphics.getHeight() / 180))) end diff --git a/not/Cloud.lua b/not/Cloud.lua index c12e236..c9899d5 100644 --- a/not/Cloud.lua +++ b/not/Cloud.lua @@ -5,6 +5,7 @@ -- Metatable of `Cloud` -- nils initialized in constructor +-- TODO: inherit from `not.Decoration` or `not.Sprite`, depending on final result of `not.Sprite`. Cloud = { x = 0, -- position horizontal y = 0, -- position vertical diff --git a/not/Decoration.lua b/not/Decoration.lua index 7f020e1..5bfc328 100644 --- a/not/Decoration.lua +++ b/not/Decoration.lua @@ -1,3 +1,5 @@ +-- TODO: follow new code template +-- TODO: add comments require "not.Sprite" Decoration = { world = nil, diff --git a/not/Effect.lua b/not/Effect.lua index 4e327a1..7010946 100644 --- a/not/Effect.lua +++ b/not/Effect.lua @@ -3,6 +3,8 @@ -- Metatable of `Effect` -- nils initialized in constructor +-- TODO: inherit from `not.Sprite`. +-- TODO: clean-up and reformat code, see newer code for reference. Effect = { x = 0, y = 0, diff --git a/not/Hero.lua b/not/Hero.lua index bd8c55c..a6facd9 100644 --- a/not/Hero.lua +++ b/not/Hero.lua @@ -83,6 +83,7 @@ function Hero:getControlSet () end -- Update callback of `Hero` +-- TODO: Explode this function (method, kek), move controler-related parts to `not.Player`, physics parts to `not.PhysicalBody`. function Hero:update (dt) -- hotfix? for destroyed bodies if self.body:isDestroyed() then return end @@ -280,6 +281,7 @@ function Hero:controlreleased (set, action, key) end -- Draw of `Hero` +-- TODO: see `not.PhysicalBody.draw` and `not.Sprite.draw`. function Hero:draw (offset_x, offset_y, scale, debug) -- draw only alive if not self.alive then return end diff --git a/not/Platform.lua b/not/Platform.lua index 9b7b03c..ecf0377 100644 --- a/not/Platform.lua +++ b/not/Platform.lua @@ -1,6 +1,8 @@ -- `Platform` -- Static platform physical object with a sprite. `Players` can walk on it. -- Collision category: [1] +-- TODO: reformat code to follow new code patterns +-- TODO: comment uncovered code parts -- WHOLE CODE HAS FLAG OF "need a cleanup" require "not.Sprite" @@ -51,6 +53,7 @@ function Platform:getPosition() end -- Draw of `Platform` +-- TODO: see todos in `not.Sprite.draw`. function Platform:draw (offset_x, offset_y, scale, debug) -- locals local offset_x = offset_x or 0 diff --git a/not/Sprite.lua b/not/Sprite.lua index e9eb387..f9a9cb4 100644 --- a/not/Sprite.lua +++ b/not/Sprite.lua @@ -82,6 +82,7 @@ end -- Drawing self to LOVE2D buffer. -- If there is no Quad, it will draw entire image. It won't draw anything if there is no image. -- TODO: it doesn't follow same pattern as `not.Hero.draw`. It should implement so it can be called from `not.World`. +-- TODO: change children if above changes are in effect: `not.Platform`, `not.Decoration`. function Sprite:draw (...) local i, q = self:getImage(), self:getQuad() if i then -- cgit v1.1