Finally wrote the monster manager API

This commit is contained in:
Kayne Ruse
2015-05-08 23:17:35 +10:00
parent 07faf1b96b
commit 102ba18b7b
7 changed files with 98 additions and 7 deletions
+14 -1
View File
@@ -27,6 +27,8 @@ print("Lua script check")
--requirements
roomManagerAPI = require("room_manager")
roomAPI = require("room")
monsterManagerAPI = require("monster_manager")
monsterAPI = require("monster")
mapMaker = require("map_maker")
mapSaver = require("map_saver")
@@ -43,7 +45,7 @@ roomManagerAPI.SetOnCreate(function(room, index)
end)
roomAPI.ForEachMonster(room, function(monster)
--
--TODO: move ForEachMonster to the monster manager API
end)
end)
end)
@@ -62,4 +64,15 @@ roomAPI.Initialize(underworld, mapSaver.Load, mapSaver.Save, mapMaker.DebugGrass
--call the monstrosity
doorUtility.createDoorPair("pair 1", overworld, -64, -64, underworld, 64, 64)
--testing the monster creation
print("testing monsters")
local monsterMgr = roomAPI.GetMonsterMgr(overworld)
local monster, mIndex = monsterManagerAPI.Create(monsterMgr, "skume.bmp", 0)
print("Monster count: ", monsterManagerAPI.GetLoadedCount(monsterMgr))
print("Monster avatar: ", monsterAPI.GetAvatar(monster), mIndex)
monsterManagerAPI.UnloadAll(monsterMgr)
print("Finished the lua script")