A_RTS/levels.lua

51 lines
1.7 KiB
Lua

levels = {}
levels.main_menu = {
entities = {}
}
local entities = levels.main_menu.entities
-- campfire
entities.campfire = {
model = g3d.newModel("assets/objects/campfire.obj","assets/textures/campfire.png", {0,0,0}, {0,0,0}, {1,1,1}),
is_animated = false,
animated_texture = nil
}
-- grass ground
local radius = math.random(50,50)
for r1 = 0, radius, 1 do for r2= 0, radius, 1 do
local tex = math.random(1,15)
local ori = math.random(0,3)
if tex <= 1 then
tex = math.random(1,7)+1
table.insert(entities,g3d.newModel("assets/objects/ground.obj","assets/textures/ground/grass"..tex..".png", {r1-radius/2, 0.01 , r2-radius/2 }, { 0, ori*math.rad(90), 0 }, { 2, 2, 2} ) )
else
table.insert(entities,g3d.newModel("assets/objects/ground.obj","assets/textures/ground/grass1.png", {r1-radius/2, 0.01 , r2-radius/2 }, { 0, ori*math.rad(90), 0 }, { 2, 2, 2} ) )
end
end end
math.randomseed(3)
-- bunch of implings (40)
local xx, yy, zz = 3, 0, 3
for i = 1, 8, 1 do for j = 1, 5, 1 do
local imp = Object:new2DAnimated("imp",portrait.impling,xx+0.5*(i+1),yy+0,zz+0.5*(j+1),16,16)
load_animation(imp,animation.impling.idle,4,8)
table.insert(entities,imp)
end end
-- bunch of hellbeast pack (6)
local xx, yy, zz = -3, 0, 3
for i = 1, 3, 1 do for j = 1, 2, 1 do
local hellbeast = Object:new2DAnimated("hellbeast",portrait.hellbeast,xx+1*(i+1),yy+0,zz+1*(j+1),16,16)
load_animation(hellbeast,animation.hellbeast.idle,4,8)
table.insert(entities,hellbeast)
end end
-- hero archdemon (1)
local xx, yy, zz = 0, 0, 3
local archdemon = Object:new2DAnimated("archdemon",portrait.archdemon,xx,yy,zz,16,16)
load_animation(archdemon,animation.archdemon.idle,4,8)
table.insert(entities,archdemon)