summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-04-03 20:11:21 +0200
committerAki <nthirtyone@gmail.com>2017-04-03 20:11:21 +0200
commitb4389dfb590862b50cc6c9ce59d3fcef9bd046b3 (patch)
tree032ba0d2510168459a8df7c480db465043bbdb43
parenteed0553c2f005c439a028d56d82756828e75c2ac (diff)
downloadroflnauts-b4389dfb590862b50cc6c9ce59d3fcef9bd046b3.zip
roflnauts-b4389dfb590862b50cc6c9ce59d3fcef9bd046b3.tar.gz
roflnauts-b4389dfb590862b50cc6c9ce59d3fcef9bd046b3.tar.bz2
World comments, other comments, todos
-rw-r--r--not/Cloud.lua2
-rw-r--r--not/Decoration.lua2
-rw-r--r--not/Effect.lua2
-rw-r--r--not/Hero.lua2
-rw-r--r--not/PhysicalBody.lua2
-rw-r--r--not/Platform.lua2
-rw-r--r--not/Player.lua2
-rw-r--r--not/World.lua17
8 files changed, 22 insertions, 9 deletions
diff --git a/not/Cloud.lua b/not/Cloud.lua
index 2af7d4b..3bc5377 100644
--- a/not/Cloud.lua
+++ b/not/Cloud.lua
@@ -42,7 +42,7 @@ function Cloud:new (x, y, t, v)
return o
end
--- Initializator of `Cloud`.
+-- Initializer of `Cloud`.
function Cloud:init (x, y, t, v)
Decoration.init(self, x, y, nil)
self:setAnimationsList(animations)
diff --git a/not/Decoration.lua b/not/Decoration.lua
index 80f6653..9dc2bdd 100644
--- a/not/Decoration.lua
+++ b/not/Decoration.lua
@@ -18,7 +18,7 @@ function Decoration:new (x, y, imagePath)
return o
end
--- Initializator of `Decoration`.
+-- Initializer of `Decoration`.
function Decoration:init (x, y, imagePath)
Sprite.init(self, imagePath)
self:setPosition(x, y)
diff --git a/not/Effect.lua b/not/Effect.lua
index 1bf9ed7..4051b92 100644
--- a/not/Effect.lua
+++ b/not/Effect.lua
@@ -21,7 +21,7 @@ function Effect:new (name, x, y)
return o
end
--- Initializator of `Effect`.
+-- Initializer of `Effect`.
function Effect:init (name, x, y)
Decoration.init(self, x, y, nil)
self:setAnimationsList(require("effects"))
diff --git a/not/Hero.lua b/not/Hero.lua
index f77e5cb..47c6e33 100644
--- a/not/Hero.lua
+++ b/not/Hero.lua
@@ -50,7 +50,7 @@ function Hero:new (game, world, x, y, name)
return o
end
--- Initializator of `Hero`.
+-- Initializer of `Hero`.
function Hero:init (name, world, x, y)
-- Find imagePath based on hero name.
local fileName = name or Hero.name -- INITIAL from metatable
diff --git a/not/PhysicalBody.lua b/not/PhysicalBody.lua
index 7c05262..7b774f2 100644
--- a/not/PhysicalBody.lua
+++ b/not/PhysicalBody.lua
@@ -17,7 +17,7 @@ function PhysicalBody:new (world, x, y, imagePath)
end
]]
--- Initializator of `PhysicalBody`.
+-- Initializer of `PhysicalBody`.
function PhysicalBody:init (world, x, y, imagePath)
Sprite.init(self, imagePath)
self.body = love.physics.newBody(world.world, x, y)
diff --git a/not/Platform.lua b/not/Platform.lua
index 0c03e73..5ee2dd7 100644
--- a/not/Platform.lua
+++ b/not/Platform.lua
@@ -19,7 +19,7 @@ function Platform:new (game, world, x, y, shape, sprite, animations)
return o
end
--- Initializator of `Platform`.
+-- Initializer of `Platform`.
function Platform:init (animations, shape, world, x, y, imagePath)
PhysicalBody.init(self, world, x, y, imagePath)
self:setAnimationsList(animations)
diff --git a/not/Player.lua b/not/Player.lua
index bcd72bc..fd1613c 100644
--- a/not/Player.lua
+++ b/not/Player.lua
@@ -16,7 +16,7 @@ function Player:new (...)
return o
end
--- Initializator of `Player`.
+-- Initializer of `Player`.
function Player:init (...)
Hero.init(self, ...)
end \ No newline at end of file
diff --git a/not/World.lua b/not/World.lua
index 6d81918..216f9dd 100644
--- a/not/World.lua
+++ b/not/World.lua
@@ -1,5 +1,6 @@
-- `World`
-- Used to manage physical world and everything inside it: clouds, platforms, nauts, background etc.
+-- TODO: Possibly move common parts of `World` and `Menu` to abstract class `Scene`.
-- WHOLE CODE HAS FLAG OF "need a cleanup"
@@ -36,6 +37,7 @@ World = {
}
-- Constructor of `World` ZA WARUDO!
+-- TODO: push stuff to initialization method.
function World:new(map, nauts)
-- Meta
local o = {}
@@ -46,6 +48,7 @@ function World:new(map, nauts)
o.world = love.physics.newWorld(0, 9.81*64, true)
o.world:setCallbacks(o.beginContact, o.endContact)
-- Empty tables for objects
+ -- TODO: DEAR DEER, do you see it?
local n = {}
o.Nauts = n
local p = {}
@@ -58,7 +61,7 @@ function World:new(map, nauts)
o.Decorations = d
local r = {}
o.Rays = r
- -- Random init
+ -- Random init; TODO: use LOVE2D's random.
math.randomseed(os.time())
-- Map
local map = map or "default"
@@ -86,6 +89,7 @@ function World:delete()
end
-- Load map from file
+-- TODO: Change current map model to function-based one.
function World:loadMap(name)
local name = name or "default"
name = "maps/" .. name .. ".lua"
@@ -125,11 +129,14 @@ function World:getSpawnPosition()
end
-- Add new platform to the world
+-- TODO: follow new parameters in `not.Platform.new` based on `not.Platform.init`.
function World:createPlatform(x, y, polygon, sprite, animations)
table.insert(self.Platforms, Platform:new(self, self.world, x, y, polygon, sprite, animations))
end
-- Add new naut to the world
+-- TODO: separate two methods for `not.Hero` and `not.Player`.
+-- TODO: follow new parameters in `not.Player.new` based on `not.Player.init`.
function World:createNaut(x, y, name)
local naut = Hero:new(self, self.world, x, y, name)
table.insert(self.Nauts, naut)
@@ -137,11 +144,14 @@ function World:createNaut(x, y, name)
end
-- Add new decoration to the world
+-- TODO: follow new parameters in `not.Decoration.new` based on `not.Decoration.init`.
function World:createDecoration(x, y, sprite)
table.insert(self.Decorations, Decoration:new(x, y, sprite))
end
-- Add new cloud to the world
+-- TODO: extend variables names to provide better readability.
+-- TODO: follow new parameters in `not.Cloud.new` based on `not.Cloud.init`.
function World:createCloud(x, y, t, v)
table.insert(self.Clouds, Cloud:new(x, y, t, v))
end
@@ -167,6 +177,8 @@ function World:randomizeCloud(outside)
end
-- Add an effect behind nauts
+-- TODO: follow new parameters in `not.Effect.new` based on `not.Effect.init`.
+-- TODO: along with `createRay` move this nearer reast of `create*` methods for readability.
function World:createEffect(name, x, y)
table.insert(self.Effects, Effect:new(name, x, y))
end
@@ -288,7 +300,7 @@ function World:draw()
-- Background
love.graphics.draw(self.background, 0, 0, 0, scaler, scaler)
- -- This needs to be reworked!
+ -- TODO: this needs to be reworked!
-- Draw clouds
for _,cloud in pairs(self.Clouds) do
cloud:draw(offset_x, offset_y, scale)
@@ -403,6 +415,7 @@ function World.endContact(a, b, coll)
end
-- Controller callbacks
+-- TODO: names of this methods don't follow naming patterns in this project. See `Controller` and change it.
function World:controlpressed(set, action, key)
if key == "f6" and debug then
local map = self:getMapName()