consistent naming; moving functions from level.lua to gameworld.lua
This commit is contained in:
@@ -41,7 +41,7 @@ function Arrow:DoPhysics()
|
||||
while not isThereObjectAt(
|
||||
self.pos.x + math.sign(self.vel.x),
|
||||
self.pos.y,
|
||||
objects.collisions
|
||||
LoadedObjects.Collisions
|
||||
) do
|
||||
self.pos.x = self.pos.x + math.sign(self.vel.x)
|
||||
end
|
||||
@@ -57,7 +57,7 @@ function Arrow:DoPhysics()
|
||||
while not isThereObjectAt(
|
||||
self.pos.x,
|
||||
self.pos.y + math.sign(self.vel.y),
|
||||
objects.collisions
|
||||
LoadedObjects.Collisions
|
||||
) do
|
||||
self.pos.y = self.pos.y + math.sign(self.vel.y)
|
||||
end
|
||||
|
||||
@@ -66,10 +66,5 @@ function Fairy:DoPhysics()
|
||||
self.vel.x = self.vel.x + random_x
|
||||
self.vel.y = self.vel.y + random_y
|
||||
-- move
|
||||
if not self:isCollidingAt(self.pos.x + self.vel.x, self.pos.y, objects.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, objects.collisions) then
|
||||
self.pos.y = self.pos.y + self.vel.y
|
||||
end
|
||||
self:CollisionMove()
|
||||
end
|
||||
|
||||
@@ -73,10 +73,5 @@ function Particle:HandleAnimation()
|
||||
end
|
||||
|
||||
function Particle:DoPhysics()
|
||||
if not self:isCollidingAt(self.pos.x + self.vel.x, self.pos.y, objects.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, objects.collisions) then
|
||||
self.pos.y = self.pos.y + self.vel.y
|
||||
end
|
||||
self:Move()
|
||||
end
|
||||
|
||||
@@ -144,13 +144,13 @@ function Player:DoPhysics()
|
||||
self.vel.y = self.vel.y + gravity
|
||||
end
|
||||
|
||||
if not self:isCollidingAt(self.pos.x + self.vel.x + self.move_x, self.pos.y, objects.collisions) then
|
||||
if not self:isCollidingAt(self.pos.x + self.vel.x + self.move_x, self.pos.y, LoadedObjects.Collisions) then
|
||||
self.pos.x = self.pos.x + self.vel.x + self.move_x
|
||||
else
|
||||
self.vel.x = 0
|
||||
end
|
||||
|
||||
if not self:isCollidingAt(self.pos.x, self.pos.y + self.vel.y, objects.collisions) then
|
||||
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
|
||||
else
|
||||
if self.vel.y > 0 then
|
||||
|
||||
Reference in New Issue
Block a user