Exemplo n.º 1
0
        protected override void Initiate()
        {
            Console.Clear();
            RedrawNext();
            keyInterface = new KeyInterface(
                new KeyHook(ConsoleKey.UpArrow, () => {
                Selected--;
                RedrawNext();
            }),
                new KeyHook(ConsoleKey.DownArrow, () => {
                Selected++;
                RedrawNext();
            }),
                new KeyHook(ConsoleKey.Enter, () => {
                Action();
            }),
                new KeyHook(ConsoleKey.LeftArrow, () => {
                Decrement();
            }),

                new KeyHook(ConsoleKey.RightArrow, () => {
                Increment();
            }),


                new KeyHook(ConsoleKey.Escape, () => {
                Back();
            })



                );
        }
Exemplo n.º 2
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();
            }));
        }
Exemplo n.º 3
0
        protected override void Initiate()
        {
            Console.Clear();
            keyInterface = new KeyInterface(
                new KeyHook(ConsoleKey.UpArrow, () =>
            {
                selected--;
                RedrawNext();
            }),
                new KeyHook(ConsoleKey.DownArrow, () =>
            {
                selected++;
                RedrawNext();
            }),
                new KeyHook(ConsoleKey.LeftArrow, () =>
            {
                if (options[selected] == textToSpeechLabel)
                {
                    speechVolume--;
                    if (speechVolume < 0)
                    {
                        speechVolume = 0;
                    }
                    RedrawNext();
                }
                else
                if (options[selected] == musicVolumeLabel)
                {
                    musicVolume--;
                    if (musicVolume < 0)
                    {
                        musicVolume = 0;
                    }
                    RedrawNext();
                }
                else
                if (options[selected] == soundVolumeLabel)
                {
                    soundVolume--;
                    if (soundVolume < 0)
                    {
                        soundVolume = 0;
                    }
                    RedrawNext();
                }
            }),
                new KeyHook(ConsoleKey.RightArrow, () =>
            {
                if (options[selected] == textToSpeechLabel)
                {
                    speechVolume++;
                    if (speechVolume > 10)
                    {
                        speechVolume = 10;
                    }
                    RedrawNext();;
                }
                else
                if (options[selected] == musicVolumeLabel)
                {
                    musicVolume++;
                    if (musicVolume > 10)
                    {
                        musicVolume = 10;
                    }
                    RedrawNext();
                }
                else
                if (options[selected] == soundVolumeLabel)
                {
                    soundVolume++;
                    if (soundVolume > 10)
                    {
                        soundVolume = 10;
                    }
                    RedrawNext();
                }
            }),
                new KeyHook(ConsoleKey.Enter, () =>
            {
                if (options[selected] == "Back")
                {
                    Back();
                }
            }),

                new KeyHook(ConsoleKey.Escape, () => { Back(); })

                );
        }