naming conventions act 2: the end

This commit is contained in:
lustlion
2022-03-06 09:35:45 +01:00
parent edd064c2fd
commit 05bf757ea5
29 changed files with 509 additions and 536 deletions

View File

@@ -30,6 +30,11 @@ function Entity:new(x,y)
return o
end
function Entity:id()
table.insert(LoadedObjects.Entities,self)
self.id = #LoadedObjects.Entities
end
function Entity:checkNearest(type,maxdistance)
local return_entity = nil
local shortest = -1
@@ -107,7 +112,7 @@ function Entity:checkVisionLine(entity,range)
local distance_x = target_x - self.pos.x
local distance_y = target_y - self.pos.y
local angle = GetAngleFromVector(distance_x,distance_y)
local angle = getAngleFromVector(distance_x,distance_y)
local distance = math.sqrt(distance_x ^ 2 + distance_y ^ 2)
local is_colliding = true
@@ -211,7 +216,7 @@ function Entity:checkVisionLineDebug(entity,range)
local distance_x = target_x - self.pos.x
local distance_y = target_y - self.pos.y
local angle = GetAngleFromVector(distance_x,distance_y)
local angle = getAngleFromVector(distance_x,distance_y)
local distance = math.sqrt(distance_x ^ 2 + distance_y ^ 2)
if distance < range then