This is a fairly simple concept that I just can’t get the right syntax for, so I’d like some help!
One doc says…
[lua]–doc1.lua
local scene = {
objects = {
{ – The Player
name = “player”,
img = “art/player.png”,
start_x = -170,
start_y = -4720,
},
},[/lua]
Is it possible to reference “player” by name? How?
So far, I have, in a separate lua document,
[lua]–doc2.lua
local function enemy(self, event)
local scene = require(“doc1”)
– ??? Something goes here.
if(self.y <= player.y) then
print(“SUCCESS”)
end
end[/lua]
How do I make “success” happen?
Thanks. [import]uid: 191140 topic_id: 35170 reply_id: 335170[/import]