From fcac1abef1f06f411ea393796d446661e1279fa9 Mon Sep 17 00:00:00 2001 From: lustlion Date: Sun, 27 Feb 2022 04:29:13 +0100 Subject: [PATCH] made a table local --- code/entity.lua | 3 ++- code/ui/dialog.lua | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/code/entity.lua b/code/entity.lua index b43df21..339ad2e 100644 --- a/code/entity.lua +++ b/code/entity.lua @@ -2,7 +2,8 @@ Entity = {class = "Entity"} LoadedObjects.Entities = {} function Entity:New(x,y) - o = {} + local o = {} + o.pos = {x = x, y = y} o.vel = {x = 0, y = 0} diff --git a/code/ui/dialog.lua b/code/ui/dialog.lua index 35f2396..2d6d74b 100644 --- a/code/ui/dialog.lua +++ b/code/ui/dialog.lua @@ -2,7 +2,7 @@ interfaceDialog = {type = "Dialog"} -- dialog boxes function interfaceDialog:New(style) local o = {} - + o.pos = { x = 0, y = game.height*80/100 @@ -10,7 +10,6 @@ function interfaceDialog:New(style) o.size = { w = game.width, h = game.height*20/100 - } o.value = 0 @@ -34,7 +33,6 @@ function interfaceDialog:New(style) setmetatable(o, self) self.__index = self - return o end