A_RTS/scripts/levels.lua

105 lines
3.4 KiB
Lua
Raw Normal View History

2021-03-18 16:28:10 +00:00
levels = {}
levels.main_menu = {
2021-03-23 16:18:59 +00:00
skybox = nil,
2021-03-19 18:58:05 +00:00
entities = {},
units = {}
2021-03-18 16:28:10 +00:00
}
total_model_count = 0
2021-03-23 16:18:59 +00:00
skybox = levels.main_menu.skybox
local entities = levels.main_menu.entities
2021-03-19 18:58:05 +00:00
local units = levels.main_menu.units
2021-03-18 16:28:10 +00:00
2021-03-23 16:18:59 +00:00
-- skybox
skybox = g3d.newModel("assets/objects/box.obj","assets/textures/misc/skybox.png", {0,0,0}, {0,0,0}, { 10000, 10000, 10000})
2021-03-18 16:28:10 +00:00
-- grass ground
local radius = math.random(50,50)
2021-03-18 16:28:10 +00:00
for r1 = 0, radius, 1 do for r2= 0, radius, 1 do
local tex = math.random(1,15)
2021-03-18 16:28:10 +00:00
local ori = math.random(0,3)
if tex <= 1 then
2021-03-18 16:28:10 +00:00
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} ) )
2021-03-18 16:28:10 +00:00
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} ) )
2021-03-18 16:28:10 +00:00
end
end end
math.randomseed(3)
-- bunch of implings (40)
2021-03-19 18:58:05 +00:00
local nu = Unit:newUnit("Succubi Army",player.id,portrait._ariel,statTable.implings)
2021-03-19 18:58:05 +00:00
local xx, yy, zz = 3, 0, 0
local model_count = 0
2021-03-19 18:58:05 +00:00
for i = 1, 8, 1 do for j = 1, 5, 1 do
model_count = model_count + 1
total_model_count = total_model_count + 1
-- create and define
local imp = Object:new2DAnimated("ariel",portrait._ariel,xx+0.5*(i+1),yy+0,zz+0.5*(j+1),16,16)
imp.num = model_count
imp.tnum = total_model_count
2021-03-19 18:58:05 +00:00
load_animation(imp,animation._ariel.idle,4,8)
-- add to unit
addToUnit(nu,imp)
2021-03-19 18:58:05 +00:00
end end
table.insert(units,nu)
2021-03-20 12:12:03 +00:00
--[[local nu = Unit:newUnit("Implings",player.id,portrait.impling,statTable.implings)
local xx, yy, zz = 3, 0, 3
for i = 1, 8, 1 do for j = 1, 5, 1 do
2021-03-19 18:58:05 +00:00
local imp = Object:new2DAnimated("implings",portrait.impling,xx+0.5*(i+1),yy+0,zz+0.5*(j+1),16,16)
load_animation(imp,animation.impling.idle,4,8)
2021-03-19 18:58:05 +00:00
table.insert(nu.troops,imp)
2021-03-18 16:28:10 +00:00
end end
2021-03-19 18:58:05 +00:00
table.insert(units,nu)
local nu = Unit:newUnit("Implings",player.id,portrait.impling,statTable.implings)
2021-03-18 16:28:10 +00:00
2021-03-19 18:58:05 +00:00
local xx, yy, zz = 3, 0, -3
for i = 1, 8, 1 do for j = 1, 5, 1 do
local imp = Object:new2DAnimated("implings",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(nu.troops,imp)
end end
table.insert(units,nu)]]
2021-03-19 18:58:05 +00:00
-- bunch of hellbeast pack (6)
--[[local nu = Unit:newUnit("Hellbeast Pack",player.id,portrait.hellbeast,statTable.implings)
local xx, yy, zz = -3, 0, 3
2021-03-20 10:17:05 +00:00
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(nu.troops,hellbeast)
end end
table.insert(units,nu)--
2021-03-19 18:58:05 +00:00
2021-03-20 10:17:05 +00:00
-- bunch of hellbeast pack (6)
--[[local nu = Unit:newUnit("Hellbeast Pack",player.id,portrait.hellbeast,statTable.implings)
2021-03-20 10:17:05 +00:00
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)
2021-03-20 10:17:05 +00:00
table.insert(nu.troops,hellbeast)
end end
table.insert(units,nu)]]
2021-03-18 16:28:10 +00:00
-- create class
local nu = Unit:newUnit("Hero Azifer",player.id,portrait._yari,statTable.implings)
local xx, yy, zz = 0, 0, 3
-- create and define
local azifer = Object:new2DAnimated("Azifer",portrait._yari,xx,yy,zz,16,16)
azifer.num = 1
total_model_count = total_model_count + 1
azifer.tnum = total_model_count
load_animation(azifer,animation._yari.idle,4,8)
addToUnit(nu,azifer)
2021-03-23 16:18:59 +00:00
table.insert(units,nu)