std.include("scripts/common.lua")

function init_level()
   set_ambient_light(0.5,0.5,0.5)
   -----------------------------------
   -- Create new game portal
   local spawn_point=get_trigger_point(65280)
   local p=get_trigger_point_world_pos(spawn_point)
   local portal=instance_game_sprite("new_game","portal",p)
   set_hostile(portal,false)
   set_shadow(portal,false)
   -- Create load game portal
   local spawn_point=get_trigger_point(65281)
   local p=get_trigger_point_world_pos(spawn_point)
   local portal=instance_game_sprite("load_game","portal",p)
   set_hostile(portal,false)
   set_shadow(portal,false)
   -- Create exit game portal
   local spawn_point=get_trigger_point(65282)
   local p=get_trigger_point_world_pos(spawn_point)
   local portal=instance_game_sprite("exit_game","gate",p)
   set_hostile(portal,false)
   set_shadow(portal,false)
   -----------------------------------
   -- Particle system
   local spawn_point=get_trigger_point(1)
   local p=add_vec3(get_trigger_point_world_pos(spawn_point),{ 1.5,0,4.5 })
   instance_particle_system("puff_white_smoke",p)
   -- Old man
   wait_time(1000)
   local old_man=instance_game_sprite("old_man","old_man",p)
   set_frame(old_man,frame_south)
   bind_script_to_game_sprite(old_man,"scripts/main_menu_old_man.lua")
   set_hostile(old_man,false)
end
