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,8 +30,7 @@ function Kupo:new(x,y)
o.light_radius = o.range/2
o.light = Light:new(o.pos.x,o.pos.y,o.light_radius)
table.insert(LoadedObjects.Entities,o)
o.id = #LoadedObjects.Entities
o:id()
setmetatable(o, self)
self.__index = self
@@ -41,12 +40,12 @@ end
function Kupo:doLogic()
self:adjustLight(self.target_offset.x,self.target_offset.y)
self.target.x = main_Player.pos.x - main_Player.target_offset.x
self.target.y = main_Player.pos.y - main_Player.target_offset.y
self.target.x = main_player.pos.x - main_player.target_offset.x
self.target.y = main_player.pos.y - main_player.target_offset.y
local distance_x = self.target.x - self.pos.x
local distance_y = self.target.y - self.pos.y
local distance = math.sqrt(distance_x ^ 2 + distance_y ^ 2)
local angle = GetAngleFromVector(distance_x,distance_y)
local angle = getAngleFromVector(distance_x,distance_y)
self.draw_bow = false
if distance <= self.range then
if self.hostile == true then