private void InitObjects() { Map.LoadMap(0); items = new ItemManager(); enemies = new EnemyManager(random); chests = new ChestManager(items, random); town = new Town("Cido", "There is a Bandit Lord on a small island in the east.\nThere is an old boat to the south you can use."); npc.Dialogue = "To my north is water. You cannot cross without a boat.\nTo my east is a mountain. You cannot hike up the mountain."; HUD = new Hud(); player = new Player(enemies, chests, town, shops, npc, HUD, items); town.SetPlayer(player); HUD.findTargets(player, enemies.enemy); chests.chestInitialize(); enemies.enemyInitialize(player, enemies); chests.FindPlayer(player); Renderer.FindPlayer(player); Map.FindPlayer(player); SetUpShops(); gameLoop = new GameLoopConditionals(enemies, player); }
public Player(EnemyManager enemyManagerTarget, ChestManager chestManager, Town townTarget, FriendlyNPC npcTarget, Hud HUDTarget, ItemManager itemTarget) { npc = npcTarget; chests = chestManager; town = townTarget; enemies = enemyManagerTarget; maxHealth = 100; health = maxHealth; name = Global.PLAYER_NAME; Alive = true; CharacterX = 14; CharacterY = 5; attack = baseAttack; SetSpeciesType(0); HUD = HUDTarget; items = itemTarget; }