The video tutorial is outdated; Dusk now supplies iterators to get multiple objects with the same name from your map, or just an ‘object’ table to get a single object.
To get a single object:
[lua]
local crate = map.layer[“object layer”].object[“crate1”]
[/lua]
To use an iterator:
[lua]
for crate in map.layer[“object layer”].nameIs(“crate”) do
– Do something to each crate
end
[/lua]
Of course, you’d replace “object layer” with the name or index of your layer.
- C