consistent naming; moving functions from level.lua to gameworld.lua
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user