60 lines
2.6 KiB
Lua
60 lines
2.6 KiB
Lua
|
levels = {}
|
||
|
|
||
|
levels.main_menu = {
|
||
|
obj_list = { }
|
||
|
}
|
||
|
|
||
|
local obj_list = levels.main_menu.obj_list
|
||
|
|
||
|
-- campfire
|
||
|
obj_list.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(5,5)
|
||
|
for r1 = 0, radius, 1 do for r2= 0, radius, 1 do
|
||
|
local tex = math.random(1,10)
|
||
|
local ori = math.random(0,3)
|
||
|
if tex >= 9 then
|
||
|
tex = math.random(1,7)+1
|
||
|
table.insert(obj_list,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(obj_list,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
|
||
|
|
||
|
--walls
|
||
|
--[[
|
||
|
for r1 = 0, radius, 1 do for h = 0, 2, 1 do
|
||
|
table.insert(obj_list,g3d.newModel("assets/objects/vertical_plane.obj","assets/textures/wall/wooden.png", {r1-radius/2, -h, 1/2+radius/2},{0,0,0},{16,16,16}))
|
||
|
table.insert(obj_list,g3d.newModel("assets/objects/vertical_plane.obj","assets/textures/wall/wooden.png", {r1-radius/2, -h,-1/2-radius/2},{0,math.rad(180),0},{16,16,16}))
|
||
|
end end
|
||
|
for r2 = 0, radius, 1 do for h = 0, 2, 1 do
|
||
|
table.insert(obj_list,g3d.newModel("assets/objects/vertical_plane.obj","assets/textures/wall/wooden.png", {1/2+radius/2, -h, r2-radius/2},{0,math.rad(90),0},{16,16,16,0}))
|
||
|
table.insert(obj_list,g3d.newModel("assets/objects/vertical_plane.obj","assets/textures/wall/wooden.png", {-1/2-radius/2, -h,r2-radius/2},{0,math.rad(270),0},{16,16,16}))
|
||
|
end end
|
||
|
]]--
|
||
|
|
||
|
-- handsome yale
|
||
|
local rx = math.random(1,2)
|
||
|
local rz = math.random(1,2)
|
||
|
|
||
|
--obj_list.yale = Object:new2DAnimated("yale","assets/textures/characters/_sive/idle5.png",rx,0,rz,32,32)
|
||
|
--load_animation(obj_list.yale,"assets/textures/characters/_sive/idle",32,5)
|
||
|
|
||
|
|
||
|
imp = Object:new2DAnimated("imp","assets/textures/characters/imp2/idle1.png",0.5,0,0.5,16,16)
|
||
|
load_animation(imp,"assets/textures/characters/imp2/idle",4,8)
|
||
|
table.insert(obj_list,imp)
|
||
|
imp = Object:new2DAnimated("imp","assets/textures/characters/imp1/idle1.png",0.5,0,-0.5,16,16)
|
||
|
load_animation(imp,"assets/textures/characters/imp1/idle",4,8)
|
||
|
table.insert(obj_list,imp)
|
||
|
imp = Object:new2DAnimated("imp","assets/textures/characters/imp1/idle1.png",-0.5,0,0.5,16,16)
|
||
|
load_animation(imp,"assets/textures/characters/imp1/idle",4,8)
|
||
|
table.insert(obj_list,imp)
|
||
|
imp = Object:new2DAnimated("imp","assets/textures/characters/imp1/idle1.png",-0.5,0,-0.5,16,16)
|
||
|
load_animation(imp,"assets/textures/characters/imp1/idle",4,8)
|
||
|
table.insert(obj_list,imp)
|