コード例 #1
0
ファイル: Program.cs プロジェクト: xyl1t/XylitAlpha
        static void player_StandingTileAction(MoveableObject sender, StandingEventArgs e)
        {
            if (e.StandingTile.ObjectType == "Pistol")
            {
                shoot     = false;
                hasPistol = true;
                bullets  += 5;

                UpdateBullets();

                player.Collect();
            }
            else if (e.StandingTile.ObjectType == "Amunition" && hasPistol)
            {
                shoot    = false;
                bullets += 5;

                UpdateBullets();

                player.Collect();
            }
            else if (e.StandingTile.ObjectType == "Coin")
            {
                newScore++;

                UpdateScore();

                player.Collect();
            }
            else if (e.StandingTile.ObjectType == "SuperCoin")
            {
                newScore += 5;

                UpdateScore();

                player.Collect();
            }
            else if (e.StandingTile.ObjectType == "Health")
            {
                if (health < 15)
                {
                    health++;
                    player.Collect();
                }

                UpdateHealth();
            }
            else if (e.StandingTile.ObjectType == "Goal")
            {
                Alive = false;

                int width = 13, height = 5;
                int x = region.Width / 2 - width / 2, y = (region.Height / 2 - height / 2) - 5;

                Window youWin = new Window(screen, x, y, width, height, "Game", "YOU WIN", ConsoleColor.White, ConsoleColor.Black, ConsoleColor.DarkGreen, ConsoleColor.White);
                youWin.Show();
                Console.ReadKey(true);
            }
            //moves++;
            //UpdateMoves();
            // /-| X... |-\
        }