Beispiel #1
0
        protected override void Initiate()
        {
            Console.Clear();
            var pallet = ParentGrid.GetPallet(typeof(SakuraBlue.Entities.Tiles.Forest).Assembly);

            map = new ParentGrid($"{AppDomain.CurrentDomain.BaseDirectory}\\Maps\\map1.bmp", pallet);

            //Player.SetPlayer(fromCharacterCreaton);

            PlayerInstanceManager.SetPlayer(map.AddAgent <Entities.Agent.Player>(Entities.Agent.Gender.Female, Singleton <Entities.Agent.Race.Human> .GetInstance(), Singleton <Entities.Agent.Class.MageClass> .GetInstance(), "NotInstantiated", 3, 5));
            var hostileDjin = map.AddAgent <Entities.Agent.NPCBase>(Entities.Agent.Gender.Female, Singleton <Entities.Agent.Race.Djin> .GetInstance(), Singleton <Entities.Agent.Class.WarriorClass> .GetInstance(), "Hostile Djin female", 8, 25);

            hostileDjin.AI        = new Entities.Agent.AI.HostileAI(hostileDjin);
            hostileDjin.IsHostile = true;
            hostileDjin.ArmStarterGear();
            hostileDjin.AddPartyMember(Gender.Male, Singleton <Entities.Agent.Race.Narugan> .GetInstance(), Singleton <Entities.Agent.Class.MageClass> .GetInstance(), "Narugan Mage");



            Singleton <Music> .GetInstance().Play(@"\Music\Good Night.mp3");

            keyInterface = new KeyInterface(
                new KeyHook(ConsoleKey.UpArrow, () => { desciription = PlayerInstanceManager.GetPlayer(map)?.AgentMove(map, Entities.Agent.Direction.Up); if (desciription != null)
                                                        {
                                                            RedrawNext();
                                                        }
                            }),
                new KeyHook(ConsoleKey.DownArrow, () => { desciription = PlayerInstanceManager.GetPlayer(map)?.AgentMove(map, Entities.Agent.Direction.Down); if (desciription != null)
                                                          {
                                                              RedrawNext();
                                                          }
                            }),
                new KeyHook(ConsoleKey.LeftArrow, () => { desciription = PlayerInstanceManager.GetPlayer(map)?.AgentMove(map, Entities.Agent.Direction.Left); if (desciription != null)
                                                          {
                                                              RedrawNext();
                                                          }
                            }),
                new KeyHook(ConsoleKey.RightArrow, () => { desciription = PlayerInstanceManager.GetPlayer(map)?.AgentMove(map, Entities.Agent.Direction.Right); if (desciription != null)
                                                           {
                                                               RedrawNext();
                                                           }
                            }),
                new KeyHook(ConsoleKey.Escape, () => {
                Program.currentState = Singleton <Menu.TopMenu> .GetInstance();
                Console.Clear();
                Program.currentState.RedrawNext();
            }));
        }