Esempio n. 1
0
        public static void Start()
        {
            int NumSpace = Variables.MaxSpace;

            try
            {
                if ((int)Num == 0)
                {
                    NumSpace = Variables.MaxSpace;
                }
                else if ((int)Num == 1)
                {
                    NumSpace = Variables.TrampolineSpace;
                }
            }
            catch (NullReferenceException) {}

            ShiftVariable.SpaceThread = true;

            for (int append = 0; append < NumSpace - 1; append++)
            {
                ReDrawing.Draw();

                if (Collision.UpSpace())
                {
                    break;
                }

                Variables.YPlayer--;

                for (int fps = 0; fps < 25; fps++)
                {
                    ReDrawing.Draw();

                    if (Num == 0)
                    {
                        Thread.Sleep(1);
                    }
                }
            }

            new Thread(DownPlayer).Start();

            ShiftVariable.SpaceThread = false;
        }
Esempio n. 2
0
        public static void DownPlayer()
        {
            ShiftVariable.SpaceThread = true;

            while (true)
            {
                ReDrawing.Draw();

                if (Collision.DownSpace())
                {
                    break;
                }

                Variables.YPlayer++;

                for (int fps = 0; fps < 25; fps++)
                {
                    ReDrawing.Draw();
                    Thread.Sleep(1);
                }
            }

            ShiftVariable.SpaceThread = false;
        }
Esempio n. 3
0
        public static void Start()
        {
            do
            {
                Console.SetCursorPosition(Variables.XCursor, Variables.YCursor); // Set cursor position

                ConsoleKeyInfo PressedKey = Console.ReadKey();                   // Player press key

                SoundPlayer player = new SoundPlayer();

                switch (PressedKey.Key)
                {
                case ConsoleKey.LeftArrow:


                    player.Stream = GameFolder.Misc.Music.run;
                    player.Play();

                    Collision.Left();

                    break;

                case ConsoleKey.RightArrow:

                    player.Stream = GameFolder.Misc.Music.run;
                    player.Play();

                    Collision.Right();

                    break;

                case ConsoleKey.Spacebar:

                    if (!ShiftVariable.SpaceThread)
                    {
                        player.Stream = GameFolder.Misc.Music.smolJump;
                        player.Play();

                        SpacePlayer.Num = 0;
                        ThreadingSpace  = new Thread(SpacePlayer.Start);
                        ThreadingSpace.Start();
                    }

                    break;

                case ConsoleKey.UpArrow:

                    Collision.Up();

                    break;

                case ConsoleKey.DownArrow:

                    Collision.Down();

                    break;

                case ConsoleKey.F:

                    Variables.Dead = 0;

                    if (Maps.NumMap == 1)
                    {
                        Variables.XPlayerStart = Maps.Map0X;
                        Variables.YPlayerStart = Maps.Map0Y;
                    }
                    else if (Maps.NumMap == 2)
                    {
                        Variables.XPlayerStart = Maps.Map1X;
                        Variables.YPlayerStart = Maps.Map1Y;
                    }
                    else if (Maps.NumMap == 3)
                    {
                        Variables.XPlayerStart = Maps.Map2X;
                        Variables.YPlayerStart = Maps.Map2Y;
                    }
                    else if (Maps.NumMap == 4)
                    {
                        Variables.XPlayerStart = Maps.Map3X;
                        Variables.YPlayerStart = Maps.Map3Y;
                    }
                    else if (Maps.NumMap == 5)
                    {
                        Variables.XPlayerStart = Maps.Map4X;
                        Variables.YPlayerStart = Maps.Map4Y;
                    }
                    else if (Maps.NumMap == 6)
                    {
                        Variables.XPlayerStart = Maps.Map5X;
                        Variables.YPlayerStart = Maps.Map5Y;
                    }
                    Maps.EnumMap(false);

                    ReTitle.Counter();
                    break;

                case ConsoleKey.R:

                    Maps.EnumMap(false);
                    break;

                default:
                    ReDrawing.Draw();
                    break;
                }
            } while (true);
        }
Esempio n. 4
0
        public static void EnumMap(bool NewMap)
        {
            if (NewMap)
            {
                if (NumMap + 1 != 7)
                {
                    NumMap++;
                }
                else
                {
                    NumMap = 7;
                }

                LevelTable.DrawLevel(NumMap);

                if (NumMap == 7)
                {
                    NumMap = 1;
                }
            }


            if (NumMap == 1)
            {
                CurrentMap = Map0;

                if (NewMap)
                {
                    Variables.XPlayerStart = Map0X;
                    Variables.YPlayerStart = Map0Y;
                }
                Variables.XPlayer = Variables.XPlayerStart;
                Variables.YPlayer = Variables.YPlayerStart;
            }
            if (NumMap == 2)
            {
                CurrentMap = Map1;

                if (NewMap)
                {
                    Variables.XPlayerStart = Map1X;
                    Variables.YPlayerStart = Map1Y;
                }

                Variables.XPlayer = Map1X;
                Variables.YPlayer = Map1Y;
            }
            if (NumMap == 3)
            {
                CurrentMap = Map2;

                if (NewMap)
                {
                    Variables.XPlayerStart = Map2X;
                    Variables.YPlayerStart = Map2Y;
                }

                Variables.XPlayer = Map2X;
                Variables.YPlayer = Map2Y;
            }
            if (NumMap == 4)
            {
                CurrentMap = Map3;

                if (NewMap)
                {
                    Variables.XPlayerStart = Map3X;
                    Variables.YPlayerStart = Map3Y;
                }

                Variables.XPlayer = Map3X;
                Variables.YPlayer = Map3Y;
            }
            if (NumMap == 5)
            {
                CurrentMap = Map4;

                if (NewMap)
                {
                    Variables.XPlayerStart = Map4X;
                    Variables.YPlayerStart = Map4Y;
                }

                Variables.XPlayer = Map4X;
                Variables.YPlayer = Map4Y;
            }
            if (NumMap == 6)
            {
                CurrentMap = Map5;

                if (NewMap)
                {
                    Variables.XPlayerStart = Map5X;
                    Variables.YPlayerStart = Map5Y;
                }

                Variables.XPlayer = Map5X;
                Variables.YPlayer = Map5Y;
            }
            ReDrawing.Draw();
            SpacePlayer.DownPlayer();
        }