consistent naming; moving functions from level.lua to gameworld.lua

This commit is contained in:
lustlion
2022-01-22 23:10:21 +01:00
parent f4b44dc7bc
commit 90ed1f6460
13 changed files with 381 additions and 202 deletions

View File

@@ -31,6 +31,20 @@ end
function Entity:Smart()
end
function Entity:Move()
self.pos.x = self.pos.x + self.vel.x
self.pos.y = self.pos.y + self.vel.y
end
function Entity:CollisionMove()
if not self:isCollidingAt(self.pos.x + self.vel.x, self.pos.y, LoadedObjects.Collisions) then
self.pos.x = self.pos.x + self.vel.x
end
if not self:isCollidingAt(self.pos.x, self.pos.y + self.vel.y, LoadedObjects.Collisions) then
self.pos.y = self.pos.y + self.vel.y
end
end
function Entity:Kill()
if self.light ~= nil then
KillLight(self.light)