summaryrefslogtreecommitdiffstats
path: root/engine/scene.lua
blob: 4cfd6045a1fa35fdd6388ccc9e9ec1c915a0f1e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
local rm = resourcemanager
local cube_mesh = rm.get_mesh("cube")
local cube_material = rm.get_material("test-128px")

local Cube = {}

function Cube:init(x, y, z)
    self.components.Transform = components.Transform.new(x, y, z)
end

function Cube:tick()
end

sent.register({
    name = "Cube",
    cls = Cube,
    components = {
        components.Transform.new(0, 0, 0),
        components.Renderable.new_mesh(cube_mesh, cube_material),
    },
})

for x=-2,2 do
    for y=-2,2 do
        for z=-2,2 do
            if z > -2 and z < 2 and x > -2 and x < 2 then
            else
                Cube.new(x, y, z)
            end
        end
    end
end