public BlackJack() { backSound.SoundLocation = "Casino.wav"; InitializeComponent(); lblBalance.Text = "CA$100"; this.btnHit.Hide(); this.btnStay.Hide(); this.btnDoubleDown.Hide(); this.lblCard1.Hide(); this.lblCard2.Hide(); this.lblCard3.Hide(); this.lblDealerCard1.Hide(); this.lblDealerCard2.Hide(); this.lblDealerCard3.Hide(); this.lblDealerCard4.Hide(); this.lblDealerTotal.Hide(); backSound.PlayLooping(); resumeToolStripMenuItem.Enabled = false; muteToolStripMenuItem.Enabled = true; }
/// <summary> /// 播放指定路径的Wav文件 /// </summary> /// <param name="FilePath">Wav路径</param> /// <param name="PlayTime">持续播放时间(单位:秒) /// <para /> /// -1:无限地循环播放; 0:只播放一次; 具体正整数:持续循环地播放指定时间 /// </param> public static void PlayWavFile(string FilePath, int PlayTime) { //增强判断 if (File.Exists(FilePath) == false) return; //加载Wav文件 SoundPlayer Player = new SoundPlayer(FilePath); //根据参数执行不同的行为 if (PlayTime < 0) Player.PlayLooping(); else if (PlayTime == 0) Player.Play(); else { lock (((ICollection)_playTimeList).SyncRoot) { Player.PlayLooping(); _playTimeList.Add(new PlayTime { Player = Player, EndTime = DateTime.Now.AddSeconds(PlayTime) }); } } }
public BlackJack() { // gives the variable " backSound" the casino sound file backSound.SoundLocation = "Casino.wav"; // gives the variable "shuffleSound" the shuffle sound file shuffleSound.SoundLocation = "shuffle.wav"; InitializeComponent(); // display the balance lblBalance.Text = "CA$100"; // hide certain features. this.btnHit.Hide(); this.btnStay.Hide(); this.btnDoubleDown.Hide(); this.picCard1.Hide(); this.picCard2.Hide(); this.picCard3.Hide(); this.picDealerCard1.Hide(); this.picDealerCard2.Hide(); this.picDealerCard3.Hide(); this.picDealerCard4.Hide(); this.lblDealerTotal.Hide(); // play music and disable the resume menu item. backSound.PlayLooping(); resumeToolStripMenuItem.Enabled = false; muteToolStripMenuItem.Enabled = true; }
public About() { InitializeComponent(); richTextBox1.Text = text; simpleSound = new SoundPlayer(Properties.Resources.about); simpleSound.PlayLooping(); }
internal MainWindow(Archive a) { InitializeComponent(); archive = a; if(!string.IsNullOrWhiteSpace(archive.settings.sound.backgroundSoundLoc)) { main = new SoundPlayer(); main.SoundLocation = archive.settings.sound.backgroundSoundLoc.RelativeTo(Program.ArchivePath(archive)); main.PlayLooping(); } if(!string.IsNullOrWhiteSpace(archive.settings.sound.correctSoundLoc)) { yes = new SoundPlayer(); yes.SoundLocation = archive.settings.sound.correctSoundLoc.RelativeTo(Program.ArchivePath(archive)); yes.LoadAsync(); } if(!string.IsNullOrWhiteSpace(archive.settings.sound.wrongSoundLoc)) { no = new SoundPlayer(); no.SoundLocation = archive.settings.sound.wrongSoundLoc.RelativeTo(Program.ArchivePath(archive)); no.LoadAsync(); } Text = a.name; BackColor = archive.settings.backgroundColor; if(!string.IsNullOrWhiteSpace(archive.settings.backgroundLoc)) { BackgroundImage = archive.settings.background ?? Extensions.LoadImage(Program.ArchivePath(archive), archive.settings.backgroundLoc); } Current = new ModeSelect(); }
public void Start_playing() { if (_player != null) return; _player = new SoundPlayer(@"tada.wav"); _player.PlayLooping(); }
private void Form1_Load(object sender, EventArgs e) { SoundPlayer alersound = new SoundPlayer(@"D:\University\Anul2\Sem2\IDE\FormAps\LOGINApp\LOGINApp\Stranger.wav"); //Play Sound On Click alersound.PlayLooping(); }
public static void PlayBattleSound() { try { using (SoundPlayer battleSound = new SoundPlayer("..\\..\\Sound\\SoundFiles\\TheBattle.wav")) { battleSound.PlayLooping(); } } catch (FileNotFoundException) { throw new FileNotFoundException(); } catch (DirectoryNotFoundException) { throw new DirectoryNotFoundException("The path to the file is incorrect!"); } catch (IOException) { throw new IOException("Cannot read from file!"); } catch (InvalidOperationException) { throw new InvalidOperationException(); } }
public TimesUp(String sMaMay, String sInfo, String sTimesIn, String sTimesUp, bool bRing) { InitializeComponent(); lbMay.Text = "Máy " + sMaMay; lbInfo.Text = sInfo; lbTimesIn.Text = "Giờ chơi: " + sTimesIn; lbTimesUp.Text = "Giờ nghỉ: " + sTimesUp; setSound(); if (bRing) { try { RingTone = new SoundPlayer(Sound); RingTone.PlayLooping(); } catch { // } timerRing.Enabled = true; } }
internal static void PlayDefaultSoundInLoop() { var streamResourceInfo = Application.GetResourceStream(new Uri("sounds/type.wav", UriKind.Relative)); if (streamResourceInfo == null) return; var player = new SoundPlayer(streamResourceInfo.Stream); player.PlayLooping(); }
public static void Play() { int rand = World.Rand (0, 5); var file = new FileStream (rand + ".wav", FileMode.Open, FileAccess.Read, FileShare.Read); player = new SoundPlayer(file); player.PlayLooping(); }
public Form1() { InitializeComponent(); sp.SoundLocation = @"F:\操作系统课设\PlantVsZombie\music\1.wav"; sp.PlayLooping(); MySqlConnection conn = new MySqlConnection(constring); //写入sql语句 string sql = "select * from login"; //创建命令对象 MySqlCommand cmd = new MySqlCommand(sql, conn); try { //打开数据库连接 conn.Open(); //执行命令,ExcuteReader返回的是DataReader对象 MySqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { label_name.Text = reader["name"].ToString(); label_number.Text = reader["number"].ToString(); user = label_name.Text; } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { conn.Close(); } }
public void PlayRepeating(string file, string message) { lock (_alarmSound) { if (_alarmSound.SoundLocation == "" || _playingOnce) { _playingOnce = false; _alarmSound = new SoundPlayer(file); _boxMessage = message; try { _alarmSound.PlayLooping(); } catch { // TODO: Logging here } finally { var stopSoundFunction = new ThreadStart(StopSound); var soundStoppingThread = new Thread(stopSoundFunction) { IsBackground = true }; soundStoppingThread.Start(); } } } }
private void PlayWaverFile(string filePath, bool playLooping) { if (_soundPlay != null) { _soundPlay.Stop(); _soundPlay.Dispose(); _soundPlay = null; } if (string.IsNullOrEmpty(filePath)) { return; } _soundPlay = new SM.SoundPlayer(filePath); if (playLooping) { _soundPlay.PlayLooping(); } else { _soundPlay.Play(); } }
public StartScreen() { InitializeComponent(); mp3Player = new MP3Player(); mp3Path = null; sp = new SoundPlayer(Resources.Initial_song); sp.PlayLooping(); }
private void Form1_Load(object sender, EventArgs e)//Програш звуку та завантаження рекорду { System.Media.SoundPlayer Audio; Audio = new System.Media.SoundPlayer(Properties.Resources.main); Audio.Load(); Audio.PlayLooping(); Int32.TryParse(bestT, out best); label2.Text = best.ToString(); }
public void Play() { SoundPlayer player = new SoundPlayer(Source); using (player) { player.PlayLooping(); } }
public FormTitleScreen() { InitializeComponent(); this.Icon = new Icon("Poker.ico"); this.StartPosition = FormStartPosition.CenterScreen; soundPlayer = new SoundPlayer("BackgroundMusic.wav"); soundPlayer.PlayLooping(); btnScore.Hide(); }
public Form1() { InitializeComponent(); score = new Scores(); dataWords = new Data(); player = new SoundPlayer(@"../../Resources/Blaues Licht - Afterworld.wav"); player.PlayLooping(); Sound = true; }
public Form1() { InitializeComponent(); // Plays and loops smooth Django Reinhardt music while you pick colours, might as well make it interesting! System.Media.SoundPlayer mPlayer = new System.Media.SoundPlayer(); mPlayer.SoundLocation = "Vamp.wav"; mPlayer.PlayLooping(); }
private void button4_Click(object sender, EventArgs e) { GameStartMenu gsm = new GameStartMenu(); gsm.Show(); Hide(); System.Media.SoundPlayer menuSound = new System.Media.SoundPlayer(@"C:\Users\FOladiji\Engineering45\WEEK3\Day5\Same Old Story.wav"); menuSound.PlayLooping(); }
private void button1_Click(object sender, EventArgs e) { //Stream str = Application.StartupPath + "\\" + katalogpacjenta + "notatki i nagrania" + listBox1.SelectedItem.ToString(); if (listBox1.SelectedIndex != -1) { SoundPlayer simpleSound = new SoundPlayer(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal) + "\\Badanie Neurologiczne by Konrad Stawiski\\" + katalogpacjenta + "notatki i nagrania\\" + listBox1.SelectedItem.ToString()); simpleSound.PlayLooping(); button3.Enabled = true; button1.Enabled = false; } }
static void Main(string[] args) { Console.OutputEncoding = Encoding.UTF8; System.Media.SoundPlayer player = new System.Media.SoundPlayer(); player.SoundLocation = Environment.CurrentDirectory + @"\Chill-house.wav"; player.PlayLooping(); AirMenu.StartProgram(); }
public void SoundChecker() { Options options = new Options(); if (options.checkBox2.Checked == false) { SoundPlayer backgroundSound = new SoundPlayer(Program.ResourcesFolder + "background.wav"); backgroundSound.PlayLooping(); } }
public void XuLyNhac() { if (Nhacplay == true) { nhac.PlayLooping(); } else { nhac.Stop(); } }
private static void PlayTrack(string audiofileName, bool loop = true) { var windowsFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.Windows); var audioFilePath = Path.Combine(windowsFolderPath, audiofileName); var player = new SoundPlayer(audioFilePath); if (loop) player.PlayLooping(); else player.Play(); }
public MainWindow() { InitializeComponent(); WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; NavigationService.Navigate(new Uri("WelcomePage.xaml", UriKind.Relative)); System.Media.SoundPlayer player = new System.Media.SoundPlayer(); player.SoundLocation = @"../../MySource/music/LobbyMusic.wav"; player.Load(); player.PlayLooping(); }
public menu() { InitializeComponent(); fond1 = new System.Media.SoundPlayer(param.ObtenirPosition() + "\\Sons\\1.wav"); fond1.PlayLooping(); Init_Graphics(); if (NomProfil == "") { Init_Profil(); } //Profil initialisé? }
public MenuForm() { InitializeComponent(); try { SoundPlayer bgm = new SoundPlayer(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Resources\\sakura.wav")); bgm.PlayLooping(); } catch(Exception e) { MessageBox.Show("Audio file missing. Copy the Resources folder to the location of the .exe file : " +e.Message); } }
public Form3() { // assigns the background music backSound.SoundLocation = "night.wav"; InitializeComponent(); // instructs the user on how to complete the level lblObjective.Text = ("OBJ: Obtain the armor"); // plays the background music backSound.PlayLooping(); }
/// <summary> /// Toggles background music on and off /// </summary> public void toggleMusic() { //Loops music in background, in separate thread, if music setting is on if ((bool)Settings.Default["Music"]) { Task.Factory.StartNew(() => { sp.PlayLooping(); }); } else { sp.Stop(); } }
public void Welcome() { //Console.BackgroundColor = ConsoleColor.DarkYellow; Music.SoundLocation = Directory.GetCurrentDirectory() + @"\music.wav"; Music.PlayLooping(); Console.WriteLine("\n"); Console.WriteLine("---------------------------"); Console.WriteLine(" SHARPMON "); Console.WriteLine("---------------------------"); }
public static void GameSound(bool isOn) { SoundPlayer player = new SoundPlayer(@"../../Sounds/Background Music - DJ Sona Ethereal.wav"); if (!isOn) { player.Stop(); } else { player.PlayLooping(); } }
private void playLongVersionToolStripMenuItem_Click(object sender, EventArgs e) { music = new System.Media.SoundPlayer(Resources.themesong_full); if (loopToolStripMenuItem.Checked == false) { music.Play(); } else { music.PlayLooping(); } }
public static void MainMenuSound(bool isOn) { SoundPlayer player = new SoundPlayer(@"..\..\music\02-overworld.wav"); if (isOn) { player.Stop(); } else { player.PlayLooping(); } }
private static void Main() { SetWindowsResolution(); EnterNickName(); Load(); while (true) { EffectsWithPrinting(); SoundPlayer menuSound = new SoundPlayer("menu.wav"); menuSound.PlayLooping(); Menu.Show(); } }
public static void PlayGameLoop() { try { SoundPlayer sound = new SoundPlayer(GameSoundPath); if (musicAvalible) { sound.PlayLooping(); } } catch (TypeInitializationException) { MessageBox.Show("The sound file is corrupted (is not in the correct format)! Sound will be disabled!", "Sound file is corrupted?!"); musicAvalible = false; } catch (ArgumentNullException) { MessageBox.Show("The sound file path is empty? The sound will be disabled!", "The sound file path is empty?!"); musicAvalible = false; } catch (ArgumentException) { MessageBox.Show("The sound file path is empty? The sound will be disabled!", "The sound file path is empty?!"); musicAvalible = false; } catch (FileNotFoundException) { MessageBox.Show(string.Format("The file {0} was not found! Sound will be disabled!", GameSoundPath), "File not found!"); musicAvalible = false; } catch (FileLoadException) { MessageBox.Show(string.Format("The file {0} cannot be loaded! The sound will be disabled!", GameSoundPath), "File cannot be loaded!"); musicAvalible = false; } catch (IOException) { MessageBox.Show(string.Format(@"Input Output error occured while trying to open {0} ! The sound will be disabled!", GameSoundPath), "Input Output error!"); } catch (UnauthorizedAccessException) { MessageBox.Show(string.Format(@"You don't have permission to access {0} ! The sound will be disabled!", GameSoundPath), "You don't have permission to access this file"); } catch (SecurityException) { MessageBox.Show(string.Format(@"You don't have permission to access {0} ! The sound will be disabled!", GameSoundPath), "You don't have permission to access this file"); } }
/// <summary> /// PlayMusicIntro method that takes boolean if mute option is enabled, /// and plays music file if it is not. /// </summary> /// <param name="playing">boolean true/false</param> /// <returns>boolean true/false just for unit testing</returns> public bool PlayMusicIntro(bool playing) { SoundPlayer sound = new SoundPlayer(Resources.music_intro); if (playing == true) { sound.PlayLooping(); return true; } else { sound.Stop(); return false; } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Simulation form = new Simulation(); form.Setup(); try { muzak = new SoundPlayer("..\\..\\muzak.wav"); muzak.PlayLooping(); } catch{}; Application.Run(form); }
//sp.SoundLocation = Properties.Resources.启动音乐; private void label3_Click(object sender, EventArgs e) { if (!sound_stop) { sp.Stop(); sound_stop = true; label3.Image = Properties.Resources.喇叭X; } else { sp.PlayLooping(); sound_stop = false; label3.Image = Properties.Resources.喇叭; } }
public Level2() { // assigns the file location to the background sound backSound.SoundLocation = "night.wav"; InitializeComponent(); // the objective label that instructs the user on what to do lblObjective.Text = ("OBJ: Obtain the sword"); // the label that displays the lives the user has remaining // instructs the user on how to complete the level lblLives.Text = ("Lives:" + lives); // plays the background music backSound.PlayLooping(); }
System.Media.SoundPlayer sound; // for music // initialize public void Init() { // load meshes teapot = new Mesh("../../assets/teapot.obj"); floor = new Mesh("../../assets/floor.obj"); city = new Mesh("../../assets/city.obj"); scraper = new Mesh("../../assets/scraper.obj"); mountain = new Mesh("../../assets/mountain.obj"); moon = new Mesh("../../assets/moon.obj"); // initialize stopwatch timer = new Stopwatch(); timer.Reset(); timer.Start(); // create shaders shader = new Shader("../../shaders/vs.glsl", "../../shaders/fs.glsl"); skyshader = new Shader("../../shaders/vs_skydome.glsl", "../../shaders/fs_skydome.glsl"); postproc = new Shader("../../shaders/vs_post.glsl", "../../shaders/fs_post.glsl"); // load the textures wood = new Texture("../../assets/wood.jpg"); skytex = new Texture("../../assets/space.jpg"); windows = new Texture("../../assets/city.jpg"); asphalt = new Texture("../../assets/asphalt.jpg"); skyscraper = new Texture("../../assets/skyscraper.jpg"); mnt = new Texture("../../assets/grass.jpg"); planet = new Texture("../../assets/moon.jpg"); // create the render target target = new RenderTarget(screen.width, screen.height); quad = new ScreenQuad(); // create scenegraph and main object sceneGraph = new SceneGraph(); teapots = new List <SceneObject>(); // initialize matrices cameraMatrix = Matrix4.Identity; worldMatrix = Matrix4.CreateFromAxisAngle(new Vector3(0, 1, 0), a); rotation = Matrix4.Identity; //no rotation at the beginning // ambient light preparation int ambientID = GL.GetUniformLocation(shader.programID, "ambientColor"); GL.UseProgram(shader.programID); GL.Uniform3(ambientID, 0.25f, 0.25f, 0.25f); // prepare sound sound = new System.Media.SoundPlayer(); sound.SoundLocation = "../../assets/ori.wav"; sound.LoadAsync(); sound.PlayLooping(); // prepare scene CreateScene(); }
public AlarmNotifyForm() { InitializeComponent(); this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Size.Width - this.Width, Screen.PrimaryScreen.WorkingArea.Size.Height - this.Height); this.TopMost = true; AlarmNotifyForm.DisableToUntilAlarm = false; AlarmNotifyForm.IsNotifying = true; this.Text = string.Format(Resources.AlarmNotifyForm_Title, NumberOfSensor); ckEnableSound.Checked = AlarmNotifyForm.EnableAudio; // play sound if (AlarmNotifyForm.EnableAudio) { player = new SoundPlayer(Resources.ALARM); player.PlayLooping(); } }
private void Form1_Load(object sender, EventArgs e) { try { FormBorderStyle = FormBorderStyle.None; WindowState = FormWindowState.Maximized; SoundPlayer sndplayr = new SoundPlayer(Funny.Properties.Resources.Deep_Acid_Bass_120bpm); sndplayr.PlayLooping(); } catch (Exception ex) { MessageBox.Show(ex.Message + ": " + ex.StackTrace.ToString(), "Error"); } }
private void play(String s) { System.Media.SoundPlayer sp = new SoundPlayer(); if (s == "start") { sp.SoundLocation = "start.wav"; sp.Load(); sp.PlayLooping(); } else { sp.SoundLocation = "stop.wav"; sp.Load(); sp.Play(); } }
private void button2_Click(object sender, EventArgs e) { if (player == null) { button2.Text = "Stop"; player = new SoundPlayer("bgm2.wav"); player.PlayLooping(); } else { button2.Text = "Start"; player.Stop(); player.Dispose(); player = null; } }
//om användaren trycker på knappen "Crazy Layout" protected void Button1_Click(object sender, EventArgs e) { //strängen style tilldelas länk till vald layout string style = "<LINK href=\'/1dv406/th222fa/Content/Crazy.css\' type=\"text/css\" rel=\"stylesheet\">"; string audioFile; //stylesheetlänken i min masterpage sätts till vald layout Literal1.Text = style; Page.SetTempData("Layout", Literal1.Text); //sökevägen till min ljudfil audioFile = System.IO.Path.Combine(AppDomain.CurrentDomain.GetData("APPBASE").ToString(), @"Content\Crazy.wav"); SoundPlayer sound = new SoundPlayer(audioFile); //Startar låten sound.PlayLooping(); }
static void PixelDust() { Console.Clear(); //SSS SoundPlayer player = new System.Media.SoundPlayer(Properties.Resources.sandstorm_9); player.PlayLooping(); Console.BackgroundColor = ConsoleColor.Blue; Random num = new Random(); while (true) { Console.Write(" "); Console.BackgroundColor = (ConsoleColor)(num.Next((15) + 1)); } }
public void EndGame() { var player = new System.Media.SoundPlayer(@"C:\Users\phill\Documents\GitHub\Martian_Attack\Martian_Attack\Alien.wav"); player.PlayLooping(); if (HighScores < Score) { HighScores = Score; } GameTimer.Stop(); GameOverLabel.Visible = true; MainMenuBtn.Visible = true; MainMenuBtn.Enabled = true; ScoreLabel.Visible = false; HighScore.Text = ($"Your Highest Score so far is {HighScores}"); FinalScore.Text = ($"Your Final Score is: {Score}"); FinalScore.Visible = true; HighScore.Visible = true; }
static void PlayMusic(string type) { if (type == "game") { System.Media.SoundPlayer bgm = new System.Media.SoundPlayer { SoundLocation = "../../bgm.wav" }; bgm.PlayLooping(); } else if (type == "main") { System.Media.SoundPlayer bgm = new System.Media.SoundPlayer { SoundLocation = "../../menumusic.wav" }; bgm.PlayLooping(); } }
public void Play(bool Loop = false) { try { player = new System.Media.SoundPlayer(filename); if (Loop == true) { player.PlayLooping(); } else { player.Play(); } } catch (Exception ex) { ExceptionHandler.TraceException(ex); } }
public Menu() { typewriter = Constants.getSoundPlayerInstance(); lockwrite = new Object(); String sss = typewriter.SoundLocation; if (typewriter.SoundLocation.CompareTo("mainMusic.wav") != 0) { typewriter.SoundLocation = "mainMusic.wav"; typewriter.PlayLooping(); } ranking = new Ranking(); Console.Clear(); currentCursorPosition = 0; titleCounter = 0; redrawTitleCounter = 0; menuItemPrintPositions = new int[3]; menuItemPrintPositions[0] = 14; menuItemPrintPositions[1] = 21; menuItemPrintPositions[2] = 29; titleList = new List<String[]>(); titleList.Add(Constants.title); titleList.Add(Constants.title1); titleList.Add(Constants.title2); titleList.Add(Constants.title3); titleList.Add(Constants.title4); titleList.Add(Constants.title5); titleList.Add(Constants.title6); titleList.Add(Constants.title7); timer = new System.Timers.Timer(); timer.Interval = 500; timer.Elapsed += OnTimedEvent; timer.AutoReset = true; checkKey = new ConsoleKeyInfo(); }
public void Start(ePhoneCallSoundType pSoundType) { this.Stop(); if (pSoundType == ePhoneCallSoundType.Ring) { m_SoundPlayer = new SoundPlayer(Resources.call_ring); m_SoundPlayer.PlayLooping(); } else if (pSoundType == ePhoneCallSoundType.HangUp) { m_SoundPlayer = new SoundPlayer(Resources.call_done); m_SoundPlayer.Play(); System.Threading.Thread.Sleep(500); } else if (pSoundType == ePhoneCallSoundType.Busy) { m_SoundPlayer = new SoundPlayer(Resources.call_busy); m_SoundPlayer.PlayLooping(); } }
private void timerUtil_Tick(object sender, EventArgs e) { try { sp.SoundLocation = filePath; sp.PlayLooping(); // 结束 this.radioGroupBox.Text = "开/关"; // 停止叮叮计时 this.timerDing.Stop(); // 定时关闭结束音乐 this.timerClose.Start(); } catch (Exception ex) { MessageBox.Show(msgNorHasFile); } }
public frmSimplified21() { InitializeComponent(); // Play the sound soundPlayer.Play(); // Loop sound soundPlayer.PlayLooping(); // call cards hide CardsHide(); CreateDeck(); // hide grb, labels, buttons, and etc grbHitOrStay.Hide(); grbTotal.Hide(); btnRestart.Hide(); picDealerCard4.Hide(); lblDealerWins.Hide(); lblPlayerWins.Hide(); }
public GameWindow() { pfc.AddFontFile("SHOWG.TTF"); gameOver = false; playerScore = 0; InitializeComponent(); Clouds.clouds = new Bitmap(Properties.Resources.clouds1, new Size(150, 30)); drawFont = new Font(pfc.Families[0], 18); int getHeight = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height; int getWidth = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width; this.Height = getHeight; this.Width = getWidth; this.DoubleBuffered = true; background = new Bitmap(Properties.Resources.clouds, new Size(this.Width, this.Height)); rectangles = new CloudDocs(this.Width, this.Height); createTimers(); Money.velocityX = 2; Bomb.velocityX = 2; player = new Player(this.Width / 2, -1800); backGroundMusic = new System.Media.SoundPlayer(Properties.Resources.Awawawawa___Super_Mario_Galaxy_2_1_converted); backGroundMusic.PlayLooping(); }
static void PlayMusic() { System.Media.SoundPlayer bgm = new System.Media.SoundPlayer(); bgm.SoundLocation = "../../bgm.wav"; bgm.PlayLooping(); }
private void Form1_Load(object sender, EventArgs e) { textBox1.Visible = false; timer1.Interval = 1000; timer1.Start(); load_json_file(); pictureBox1.Image = System.Drawing.Image.FromFile("穴道圖.gif"); sp.SoundLocation = @"background (2).wav"; sp.PlayLooping(); Global.pos = new Global.Pos[8][]; Global.pos[0] = new Global.Pos[25]; Global.pos[0][0].x = 289; Global.pos[0][0].y = 126; Global.pos[0][0].acu = "頭維穴"; Global.pos[0][1].x = 99; Global.pos[0][1].y = 113; Global.pos[0][1].acu = "頭維穴"; Global.pos[0][2].x = 297; Global.pos[0][2].y = 145; Global.pos[0][2].acu = "髮際穴"; Global.pos[0][3].x = 78; Global.pos[0][3].y = 143; Global.pos[0][3].acu = "髮際穴"; Global.pos[0][4].x = 245; Global.pos[0][4].y = 171; Global.pos[0][4].acu = "陽白穴"; Global.pos[0][5].x = 138; Global.pos[0][5].y = 172; Global.pos[0][5].acu = "陽白穴"; Global.pos[0][6].x = 194; Global.pos[0][6].y = 227; Global.pos[0][6].acu = "印堂穴"; Global.pos[0][7].x = 210; Global.pos[0][7].y = 224; Global.pos[0][7].acu = "攢竹穴"; Global.pos[0][8].x = 180; Global.pos[0][8].y = 224; Global.pos[0][8].acu = "攢竹穴"; Global.pos[0][9].x = 280; Global.pos[0][9].y = 239; Global.pos[0][9].acu = "外明穴"; Global.pos[0][10].x = 102; Global.pos[0][10].y = 243; Global.pos[0][10].acu = "外明穴"; Global.pos[0][11].x = 254; Global.pos[0][11].y = 253; Global.pos[0][11].acu = "睛明穴"; Global.pos[0][12].x = 143; Global.pos[0][12].y = 251; Global.pos[0][12].acu = "睛明穴"; Global.pos[0][13].x = 246; Global.pos[0][13].y = 286; Global.pos[0][13].acu = "承泣穴"; Global.pos[0][14].x = 137; Global.pos[0][14].y = 286; Global.pos[0][14].acu = "承泣穴"; Global.pos[0][15].x = 268; Global.pos[0][15].y = 288; Global.pos[0][15].acu = "球後穴"; Global.pos[0][16].x = 120; Global.pos[0][16].y = 289; Global.pos[0][16].acu = "球後穴"; Global.pos[0][17].x = 246; Global.pos[0][17].y = 307; Global.pos[0][17].acu = "四白穴"; Global.pos[0][18].x = 137; Global.pos[0][18].y = 310; Global.pos[0][18].acu = "四白穴"; Global.pos[0][19].x = 234; Global.pos[0][19].y = 346; Global.pos[0][19].acu = "迎香穴"; Global.pos[0][20].x = 149; Global.pos[0][20].y = 345; Global.pos[0][20].acu = "迎香穴"; Global.pos[0][21].x = 192; Global.pos[0][21].y = 368; Global.pos[0][21].acu = "人中穴"; Global.pos[0][22].x = 242; Global.pos[0][22].y = 404; Global.pos[0][22].acu = "地倉穴"; Global.pos[0][23].x = 143; Global.pos[0][23].y = 406; Global.pos[0][23].acu = "地倉穴"; Global.pos[0][24].x = 191; Global.pos[0][24].y = 445; Global.pos[0][24].acu = "承漿穴"; Global.pos[1] = new Global.Pos[8]; Global.pos[1][0].x = 190; Global.pos[1][0].y = 85; Global.pos[1][0].acu = "百會穴"; Global.pos[1][1].x = 191; Global.pos[1][1].y = 172; Global.pos[1][1].acu = "後頂穴"; Global.pos[1][2].x = 188; Global.pos[1][2].y = 427; Global.pos[1][2].acu = "風府穴"; Global.pos[1][3].x = 236; Global.pos[1][3].y = 428; Global.pos[1][3].acu = "風池穴"; Global.pos[1][4].x = 144; Global.pos[1][4].y = 428; Global.pos[1][4].acu = "風池穴"; Global.pos[1][5].x = 213; Global.pos[1][5].y = 458; Global.pos[1][5].acu = "天柱穴"; Global.pos[1][6].x = 162; Global.pos[1][6].y = 459; Global.pos[1][6].acu = "天柱穴"; Global.pos[1][7].x = 188; Global.pos[1][7].y = 455; Global.pos[1][7].acu = "啞門穴"; Global.pos[2] = new Global.Pos[76]; Global.pos[2][0].x = 197; Global.pos[2][0].y = 105; Global.pos[2][0].acu = "天突穴"; Global.pos[2][1].x = 197; Global.pos[2][1].y = 132; Global.pos[2][1].acu = "璇璣穴"; Global.pos[2][2].x = 197; Global.pos[2][2].y = 160; Global.pos[2][2].acu = "華蓋穴"; Global.pos[2][3].x = 197; Global.pos[2][3].y = 176; Global.pos[2][3].acu = "紫宮穴"; Global.pos[2][4].x = 197; Global.pos[2][4].y = 207; Global.pos[2][4].acu = "玉堂穴"; Global.pos[2][5].x = 197; Global.pos[2][5].y = 235; Global.pos[2][5].acu = "膻中穴"; Global.pos[2][6].x = 196; Global.pos[2][6].y = 260; Global.pos[2][6].acu = "中庭穴"; Global.pos[2][7].x = 195; Global.pos[2][7].y = 284; Global.pos[2][7].acu = "鳩尾穴"; Global.pos[2][8].x = 195; Global.pos[2][8].y = 306; Global.pos[2][8].acu = "巨闕穴"; Global.pos[2][9].x = 197; Global.pos[2][9].y = 329; Global.pos[2][9].acu = "上脘穴"; Global.pos[2][10].x = 196; Global.pos[2][10].y = 354; Global.pos[2][10].acu = "中脘穴"; Global.pos[2][11].x = 195; Global.pos[2][11].y = 376; Global.pos[2][11].acu = "建裡穴"; Global.pos[2][12].x = 195; Global.pos[2][12].y = 400; Global.pos[2][12].acu = "下脘穴"; Global.pos[2][13].x = 196; Global.pos[2][13].y = 424; Global.pos[2][13].acu = "水分穴"; Global.pos[2][14].x = 195; Global.pos[2][14].y = 442; Global.pos[2][14].acu = "神闕穴"; Global.pos[2][15].x = 196; Global.pos[2][15].y = 476; Global.pos[2][15].acu = "陰交穴"; Global.pos[2][16].x = 197; Global.pos[2][16].y = 488; Global.pos[2][16].acu = "氣海穴"; Global.pos[2][17].x = 197; Global.pos[2][17].y = 505; Global.pos[2][17].acu = "石門穴"; Global.pos[2][18].x = 197; Global.pos[2][18].y = 534; Global.pos[2][18].acu = "關元穴"; Global.pos[2][19].x = 198; Global.pos[2][19].y = 560; Global.pos[2][19].acu = "中極穴"; Global.pos[2][20].x = 197; Global.pos[2][20].y = 588; Global.pos[2][20].acu = "曲骨穴"; Global.pos[2][21].x = 197; Global.pos[2][21].y = 624; Global.pos[2][21].acu = "會陰穴"; Global.pos[2][22].x = 206; Global.pos[2][22].y = 588; Global.pos[2][22].acu = "橫骨穴"; Global.pos[2][23].x = 205; Global.pos[2][23].y = 560; Global.pos[2][23].acu = "大赫穴"; Global.pos[2][24].x = 205; Global.pos[2][24].y = 532; Global.pos[2][24].acu = "氣穴"; Global.pos[2][25].x = 208; Global.pos[2][25].y = 505; Global.pos[2][25].acu = "四滿穴"; Global.pos[2][26].x = 205; Global.pos[2][26].y = 476; Global.pos[2][26].acu = "中註穴"; Global.pos[2][27].x = 205; Global.pos[2][27].y = 444; Global.pos[2][27].acu = "盲俞穴"; Global.pos[2][28].x = 206; Global.pos[2][28].y = 401; Global.pos[2][28].acu = "商曲穴"; Global.pos[2][29].x = 205; Global.pos[2][29].y = 379; Global.pos[2][29].acu = "石關穴"; Global.pos[2][30].x = 206; Global.pos[2][30].y = 352; Global.pos[2][30].acu = "陰都穴"; Global.pos[2][31].x = 206; Global.pos[2][31].y = 328; Global.pos[2][31].acu = "腹通谷穴"; Global.pos[2][32].x = 205; Global.pos[2][32].y = 305; Global.pos[2][32].acu = "幽門穴"; Global.pos[2][33].x = 229; Global.pos[2][33].y = 270; Global.pos[2][33].acu = "步廊穴"; Global.pos[2][34].x = 228; Global.pos[2][34].y = 231; Global.pos[2][34].acu = "神封穴"; Global.pos[2][35].x = 228; Global.pos[2][35].y = 203; Global.pos[2][35].acu = "零墟穴"; Global.pos[2][36].x = 228; Global.pos[2][36].y = 172; Global.pos[2][36].acu = "神藏穴"; Global.pos[2][37].x = 226; Global.pos[2][37].y = 139; Global.pos[2][37].acu = "彧中穴"; Global.pos[2][38].x = 225; Global.pos[2][38].y = 104; Global.pos[2][38].acu = "俞府穴"; Global.pos[2][39].x = 253; Global.pos[2][39].y = 80; Global.pos[2][39].acu = "缺盆穴"; Global.pos[2][40].x = 253; Global.pos[2][40].y = 104; Global.pos[2][40].acu = "氣戶穴"; Global.pos[2][41].x = 257; Global.pos[2][41].y = 135; Global.pos[2][41].acu = "庫房穴"; Global.pos[2][42].x = 260; Global.pos[2][42].y = 172; Global.pos[2][42].acu = "屋翳穴"; Global.pos[2][43].x = 259; Global.pos[2][43].y = 202; Global.pos[2][43].acu = "鷹窗穴"; Global.pos[2][44].x = 263; Global.pos[2][44].y = 232; Global.pos[2][44].acu = "乳中穴"; Global.pos[2][45].x = 262; Global.pos[2][45].y = 258; Global.pos[2][45].acu = "乳根穴"; Global.pos[2][46].x = 227; Global.pos[2][46].y = 303; Global.pos[2][46].acu = "不容穴"; Global.pos[2][47].x = 226; Global.pos[2][47].y = 330; Global.pos[2][47].acu = "承滿穴"; Global.pos[2][48].x = 227; Global.pos[2][48].y = 350; Global.pos[2][48].acu = "梁門穴"; Global.pos[2][49].x = 228; Global.pos[2][49].y = 373; Global.pos[2][49].acu = "關門穴"; Global.pos[2][50].x = 229; Global.pos[2][50].y = 396; Global.pos[2][50].acu = "太乙穴"; Global.pos[2][51].x = 227; Global.pos[2][51].y = 417; Global.pos[2][51].acu = "滑肉門穴"; Global.pos[2][52].x = 226; Global.pos[2][52].y = 442; Global.pos[2][52].acu = "天樞穴"; Global.pos[2][53].x = 229; Global.pos[2][53].y = 475; Global.pos[2][53].acu = "外陵穴"; Global.pos[2][54].x = 228; Global.pos[2][54].y = 504; Global.pos[2][54].acu = "大巨穴"; Global.pos[2][55].x = 229; Global.pos[2][55].y = 533; Global.pos[2][55].acu = "水道穴"; Global.pos[2][56].x = 229; Global.pos[2][56].y = 559; Global.pos[2][56].acu = "歸來穴"; Global.pos[2][57].x = 229; Global.pos[2][57].y = 584; Global.pos[2][57].acu = "氣沖穴"; Global.pos[2][58].x = 291; Global.pos[2][58].y = 620; Global.pos[2][58].acu = "髀關穴"; Global.pos[2][59].x = 229; Global.pos[2][59].y = 645; Global.pos[2][59].acu = "足五里穴"; Global.pos[2][60].x = 229; Global.pos[2][60].y = 621; Global.pos[2][60].acu = "陰廉穴"; Global.pos[2][61].x = 241; Global.pos[2][61].y = 612; Global.pos[2][61].acu = "急脈穴"; Global.pos[2][62].x = 253; Global.pos[2][62].y = 581; Global.pos[2][62].acu = "衝門穴"; Global.pos[2][63].x = 263; Global.pos[2][63].y = 562; Global.pos[2][63].acu = "府舍穴"; Global.pos[2][64].x = 260; Global.pos[2][64].y = 476; Global.pos[2][64].acu = "腹結穴"; Global.pos[2][65].x = 262; Global.pos[2][65].y = 441; Global.pos[2][65].acu = "大橫穴"; Global.pos[2][66].x = 261; Global.pos[2][66].y = 375; Global.pos[2][66].acu = "腹哀穴"; Global.pos[2][67].x = 259; Global.pos[2][67].y = 324; Global.pos[2][67].acu = "日月穴"; Global.pos[2][68].x = 261; Global.pos[2][68].y = 292; Global.pos[2][68].acu = "期門穴"; Global.pos[2][69].x = 277; Global.pos[2][69].y = 231; Global.pos[2][69].acu = "天池穴"; Global.pos[2][70].x = 296; Global.pos[2][70].y = 229; Global.pos[2][70].acu = "食竇穴"; Global.pos[2][71].x = 293; Global.pos[2][71].y = 205; Global.pos[2][71].acu = "天溪穴"; Global.pos[2][72].x = 293; Global.pos[2][72].y = 181; Global.pos[2][72].acu = "胸鄉穴"; Global.pos[2][73].x = 288; Global.pos[2][73].y = 156; Global.pos[2][73].acu = "周榮穴"; Global.pos[2][74].x = 285; Global.pos[2][74].y = 120; Global.pos[2][74].acu = "中府穴"; Global.pos[2][75].x = 283; Global.pos[2][75].y = 96; Global.pos[2][75].acu = "雲門穴"; Global.pos[3] = new Global.Pos[59]; Global.pos[3][0].x = 189; Global.pos[3][0].y = 59; Global.pos[3][0].acu = "大椎穴"; Global.pos[3][1].x = 191; Global.pos[3][1].y = 84; Global.pos[3][1].acu = "陶道穴"; Global.pos[3][2].x = 192; Global.pos[3][2].y = 127; Global.pos[3][2].acu = "身柱穴"; Global.pos[3][3].x = 192; Global.pos[3][3].y = 189; Global.pos[3][3].acu = "神道穴"; Global.pos[3][4].x = 191; Global.pos[3][4].y = 217; Global.pos[3][4].acu = "靈臺穴"; Global.pos[3][5].x = 191; Global.pos[3][5].y = 243; Global.pos[3][5].acu = "至陽穴"; Global.pos[3][6].x = 192; Global.pos[3][6].y = 321; Global.pos[3][6].acu = "中樞穴"; Global.pos[3][7].x = 192; Global.pos[3][7].y = 344; Global.pos[3][7].acu = "脊中穴"; Global.pos[3][8].x = 194; Global.pos[3][8].y = 389; Global.pos[3][8].acu = "懸樞穴"; Global.pos[3][9].x = 192; Global.pos[3][9].y = 420; Global.pos[3][9].acu = "命門穴"; Global.pos[3][10].x = 192; Global.pos[3][10].y = 476; Global.pos[3][10].acu = "腰陽關穴"; Global.pos[3][11].x = 224; Global.pos[3][11].y = 56; Global.pos[3][11].acu = "肩中俞穴"; Global.pos[3][12].x = 238; Global.pos[3][12].y = 78; Global.pos[3][12].acu = "肩外俞穴"; Global.pos[3][13].x = 239; Global.pos[3][13].y = 102; Global.pos[3][13].acu = "附分穴"; Global.pos[3][14].x = 256; Global.pos[3][14].y = 72; Global.pos[3][14].acu = "肩井穴"; Global.pos[3][15].x = 256; Global.pos[3][15].y = 94; Global.pos[3][15].acu = "天髎穴"; Global.pos[3][16].x = 256; Global.pos[3][16].y = 110; Global.pos[3][16].acu = "曲桓穴"; Global.pos[3][17].x = 284; Global.pos[3][17].y = 107; Global.pos[3][17].acu = "秉風穴"; Global.pos[3][18].x = 283; Global.pos[3][18].y = 164; Global.pos[3][18].acu = "天宗穴"; Global.pos[3][19].x = 309; Global.pos[3][19].y = 126; Global.pos[3][19].acu = "臑俞穴"; Global.pos[3][20].x = 310; Global.pos[3][20].y = 193; Global.pos[3][20].acu = "肩貞穴"; Global.pos[3][21].x = 216; Global.pos[3][21].y = 83; Global.pos[3][21].acu = "大杼穴"; Global.pos[3][22].x = 216; Global.pos[3][22].y = 104; Global.pos[3][22].acu = "風門穴"; Global.pos[3][23].x = 216; Global.pos[3][23].y = 127; Global.pos[3][23].acu = "肺俞穴"; Global.pos[3][24].x = 217; Global.pos[3][24].y = 162; Global.pos[3][24].acu = "厥陰俞穴"; Global.pos[3][25].x = 216; Global.pos[3][25].y = 188; Global.pos[3][25].acu = "心俞穴"; Global.pos[3][26].x = 217; Global.pos[3][26].y = 217; Global.pos[3][26].acu = "督俞穴"; Global.pos[3][27].x = 215; Global.pos[3][27].y = 244; Global.pos[3][27].acu = "膈俞穴"; Global.pos[3][28].x = 215; Global.pos[3][28].y = 297; Global.pos[3][28].acu = "肝俞穴"; Global.pos[3][29].x = 216; Global.pos[3][29].y = 317; Global.pos[3][29].acu = "膽俞穴"; Global.pos[3][30].x = 218; Global.pos[3][30].y = 342; Global.pos[3][30].acu = "脾俞穴"; Global.pos[3][31].x = 216; Global.pos[3][31].y = 360; Global.pos[3][31].acu = "胃俞穴"; Global.pos[3][32].x = 218; Global.pos[3][32].y = 384; Global.pos[3][32].acu = "三焦俞穴"; Global.pos[3][33].x = 216; Global.pos[3][33].y = 416; Global.pos[3][33].acu = "腎俞穴"; Global.pos[3][34].x = 216; Global.pos[3][34].y = 446; Global.pos[3][34].acu = "氣海俞穴"; Global.pos[3][35].x = 216; Global.pos[3][35].y = 472; Global.pos[3][35].acu = "大腸俞穴"; Global.pos[3][36].x = 218; Global.pos[3][36].y = 497; Global.pos[3][36].acu = "關元俞穴"; Global.pos[3][37].x = 219; Global.pos[3][37].y = 515; Global.pos[3][37].acu = "小腸俞穴"; Global.pos[3][38].x = 219; Global.pos[3][38].y = 538; Global.pos[3][38].acu = "膀胱俞穴"; Global.pos[3][39].x = 179; Global.pos[3][39].y = 517; Global.pos[3][39].acu = "上髎穴"; Global.pos[3][40].x = 177; Global.pos[3][40].y = 537; Global.pos[3][40].acu = "次髎穴"; Global.pos[3][41].x = 180; Global.pos[3][41].y = 555; Global.pos[3][41].acu = "中髎穴"; Global.pos[3][42].x = 180; Global.pos[3][42].y = 572; Global.pos[3][42].acu = "下髎穴"; Global.pos[3][43].x = 194; Global.pos[3][43].y = 584; Global.pos[3][43].acu = "腰俞穴"; Global.pos[3][44].x = 205; Global.pos[3][44].y = 614; Global.pos[3][44].acu = "會陽穴"; Global.pos[3][45].x = 194; Global.pos[3][45].y = 650; Global.pos[3][45].acu = "長強穴"; Global.pos[3][46].x = 239; Global.pos[3][46].y = 129; Global.pos[3][46].acu = "魄戶穴"; Global.pos[3][47].x = 240; Global.pos[3][47].y = 160; Global.pos[3][47].acu = "膏肓穴"; Global.pos[3][48].x = 240; Global.pos[3][48].y = 188; Global.pos[3][48].acu = "神堂穴"; Global.pos[3][49].x = 240; Global.pos[3][49].y = 241; Global.pos[3][49].acu = "膈關穴"; Global.pos[3][50].x = 240; Global.pos[3][50].y = 296; Global.pos[3][50].acu = "魂門穴"; Global.pos[3][51].x = 240; Global.pos[3][51].y = 316; Global.pos[3][51].acu = "陽綱穴"; Global.pos[3][52].x = 238; Global.pos[3][52].y = 339; Global.pos[3][52].acu = "意舍穴"; Global.pos[3][53].x = 239; Global.pos[3][53].y = 360; Global.pos[3][53].acu = "胃倉穴"; Global.pos[3][54].x = 239; Global.pos[3][54].y = 383; Global.pos[3][54].acu = "肓門穴"; Global.pos[3][55].x = 238; Global.pos[3][55].y = 412; Global.pos[3][55].acu = "志室穴"; Global.pos[3][56].x = 240; Global.pos[3][56].y = 535; Global.pos[3][56].acu = "胞肓穴"; Global.pos[3][57].x = 241; Global.pos[3][57].y = 576; Global.pos[3][57].acu = "稚邊穴"; Global.pos[3][58].x = 221; Global.pos[3][58].y = 575; Global.pos[3][58].acu = "白環俞穴"; Global.pos[4] = new Global.Pos[25]; Global.pos[4][0].x = 164; Global.pos[4][0].y = 204; Global.pos[4][0].acu = "天泉穴"; Global.pos[4][1].x = 141; Global.pos[4][1].y = 223; Global.pos[4][1].acu = "天府穴"; Global.pos[4][2].x = 141; Global.pos[4][2].y = 242; Global.pos[4][2].acu = "俠白穴"; Global.pos[4][3].x = 205; Global.pos[4][3].y = 272; Global.pos[4][3].acu = "青靈穴"; Global.pos[4][4].x = 185; Global.pos[4][4].y = 320; Global.pos[4][4].acu = "曲澤穴"; Global.pos[4][5].x = 160; Global.pos[4][5].y = 322; Global.pos[4][5].acu = "尺澤穴"; Global.pos[4][6].x = 212; Global.pos[4][6].y = 316; Global.pos[4][6].acu = "少海穴"; Global.pos[4][7].x = 133; Global.pos[4][7].y = 418; Global.pos[4][7].acu = "孔最穴"; Global.pos[4][8].x = 151; Global.pos[4][8].y = 460; Global.pos[4][8].acu = "郄門穴"; Global.pos[4][9].x = 142; Global.pos[4][9].y = 500; Global.pos[4][9].acu = "間使穴"; Global.pos[4][10].x = 136; Global.pos[4][10].y = 523; Global.pos[4][10].acu = "內關穴"; Global.pos[4][11].x = 104; Global.pos[4][11].y = 520; Global.pos[4][11].acu = "列缺穴"; Global.pos[4][12].x = 107; Global.pos[4][12].y = 532; Global.pos[4][12].acu = "經渠穴"; Global.pos[4][13].x = 104; Global.pos[4][13].y = 550; Global.pos[4][13].acu = "太淵穴"; Global.pos[4][14].x = 130; Global.pos[4][14].y = 555; Global.pos[4][14].acu = "大陵穴"; Global.pos[4][15].x = 158; Global.pos[4][15].y = 525; Global.pos[4][15].acu = "靈道穴"; Global.pos[4][16].x = 157; Global.pos[4][16].y = 538; Global.pos[4][16].acu = "通裡穴"; Global.pos[4][17].x = 154; Global.pos[4][17].y = 545; Global.pos[4][17].acu = "陰郄穴"; Global.pos[4][18].x = 154; Global.pos[4][18].y = 559; Global.pos[4][18].acu = "神門穴"; Global.pos[4][19].x = 72; Global.pos[4][19].y = 579; Global.pos[4][19].acu = "魚際穴"; Global.pos[4][20].x = 44; Global.pos[4][20].y = 632; Global.pos[4][20].acu = "少商穴"; Global.pos[4][21].x = 113; Global.pos[4][21].y = 619; Global.pos[4][21].acu = "勞宮穴"; Global.pos[4][22].x = 144; Global.pos[4][22].y = 620; Global.pos[4][22].acu = "少府穴"; Global.pos[4][23].x = 117; Global.pos[4][23].y = 704; Global.pos[4][23].acu = "中衝穴"; Global.pos[4][24].x = 148; Global.pos[4][24].y = 644; Global.pos[4][24].acu = "少衝穴"; Global.pos[5] = new Global.Pos[42]; Global.pos[5][0].x = 98; Global.pos[5][0].y = 76; Global.pos[5][0].acu = "曲桓穴"; Global.pos[5][1].x = 138; Global.pos[5][1].y = 68; Global.pos[5][1].acu = "秉風穴"; Global.pos[5][2].x = 170; Global.pos[5][2].y = 64; Global.pos[5][2].acu = "巨骨穴"; Global.pos[5][3].x = 191; Global.pos[5][3].y = 81; Global.pos[5][3].acu = "肩髎穴"; Global.pos[5][4].x = 218; Global.pos[5][4].y = 77; Global.pos[5][4].acu = "肩髃穴"; Global.pos[5][5].x = 183; Global.pos[5][5].y = 94; Global.pos[5][5].acu = "臑俞穴"; Global.pos[5][6].x = 177; Global.pos[5][6].y = 141; Global.pos[5][6].acu = "肩貞穴"; Global.pos[5][7].x = 200; Global.pos[5][7].y = 172; Global.pos[5][7].acu = "臑會穴"; Global.pos[5][8].x = 240; Global.pos[5][8].y = 199; Global.pos[5][8].acu = "臂臑穴"; Global.pos[5][9].x = 200; Global.pos[5][9].y = 217; Global.pos[5][9].acu = "消濼穴"; Global.pos[5][10].x = 248; Global.pos[5][10].y = 274; Global.pos[5][10].acu = "手五里穴"; Global.pos[5][11].x = 215; Global.pos[5][11].y = 297; Global.pos[5][11].acu = "清冷淵穴"; Global.pos[5][12].x = 250; Global.pos[5][12].y = 316; Global.pos[5][12].acu = "肘髎穴"; Global.pos[5][13].x = 211; Global.pos[5][13].y = 326; Global.pos[5][13].acu = "天井穴"; Global.pos[5][14].x = 186; Global.pos[5][14].y = 341; Global.pos[5][14].acu = "小海穴"; Global.pos[5][15].x = 263; Global.pos[5][15].y = 332; Global.pos[5][15].acu = "曲池穴"; Global.pos[5][16].x = 274; Global.pos[5][16].y = 375; Global.pos[5][16].acu = "手三里穴"; Global.pos[5][17].x = 278; Global.pos[5][17].y = 392; Global.pos[5][17].acu = "上廉穴"; Global.pos[5][18].x = 280; Global.pos[5][18].y = 409; Global.pos[5][18].acu = "下廉穴"; Global.pos[5][19].x = 242; Global.pos[5][19].y = 435; Global.pos[5][19].acu = "四瀆穴"; Global.pos[5][20].x = 225; Global.pos[5][20].y = 471; Global.pos[5][20].acu = "支正穴"; Global.pos[5][21].x = 287; Global.pos[5][21].y = 470; Global.pos[5][21].acu = "溫溜穴"; Global.pos[5][22].x = 257; Global.pos[5][22].y = 487; Global.pos[5][22].acu = "三陽絡穴"; Global.pos[5][23].x = 262; Global.pos[5][23].y = 508; Global.pos[5][23].acu = "支溝穴"; Global.pos[5][24].x = 249; Global.pos[5][24].y = 508; Global.pos[5][24].acu = "會宗穴"; Global.pos[5][25].x = 290; Global.pos[5][25].y = 508; Global.pos[5][25].acu = "遍歷穴"; Global.pos[5][26].x = 248; Global.pos[5][26].y = 525; Global.pos[5][26].acu = "外關穴"; Global.pos[5][27].x = 253; Global.pos[5][27].y = 541; Global.pos[5][27].acu = "養老穴"; Global.pos[5][28].x = 250; Global.pos[5][28].y = 564; Global.pos[5][28].acu = "陽谷穴"; Global.pos[5][29].x = 270; Global.pos[5][29].y = 561; Global.pos[5][29].acu = "陽池穴"; Global.pos[5][30].x = 297; Global.pos[5][30].y = 560; Global.pos[5][30].acu = "陽溪穴"; Global.pos[5][31].x = 253; Global.pos[5][31].y = 579; Global.pos[5][31].acu = "腕骨穴"; Global.pos[5][32].x = 252; Global.pos[5][32].y = 620; Global.pos[5][32].acu = "後溪穴"; Global.pos[5][33].x = 272; Global.pos[5][33].y = 627; Global.pos[5][33].acu = "中渚穴"; Global.pos[5][34].x = 256; Global.pos[5][34].y = 644; Global.pos[5][34].acu = "前谷穴"; Global.pos[5][35].x = 273; Global.pos[5][35].y = 648; Global.pos[5][35].acu = "液門穴"; Global.pos[5][36].x = 265; Global.pos[5][36].y = 690; Global.pos[5][36].acu = "少澤穴"; Global.pos[5][37].x = 286; Global.pos[5][37].y = 699; Global.pos[5][37].acu = "關衝穴"; Global.pos[5][38].x = 332; Global.pos[5][38].y = 692; Global.pos[5][38].acu = "商陽穴"; Global.pos[5][39].x = 328; Global.pos[5][39].y = 640; Global.pos[5][39].acu = "二間穴"; Global.pos[5][40].x = 328; Global.pos[5][40].y = 620; Global.pos[5][40].acu = "三間穴"; Global.pos[5][41].x = 322; Global.pos[5][41].y = 606; Global.pos[5][41].acu = "合谷穴"; Global.pos[6] = new Global.Pos[26]; Global.pos[6][0].x = 201; Global.pos[6][0].y = 53; Global.pos[6][0].acu = "箕門穴"; Global.pos[6][1].x = 209; Global.pos[6][1].y = 134; Global.pos[6][1].acu = "血海穴"; Global.pos[6][2].x = 243; Global.pos[6][2].y = 108; Global.pos[6][2].acu = "陰包穴"; Global.pos[6][3].x = 262; Global.pos[6][3].y = 192; Global.pos[6][3].acu = "曲泉穴"; Global.pos[6][4].x = 289; Global.pos[6][4].y = 192; Global.pos[6][4].acu = "陰谷穴"; Global.pos[6][5].x = 229; Global.pos[6][5].y = 260; Global.pos[6][5].acu = "陰陵泉穴"; Global.pos[6][6].x = 253; Global.pos[6][6].y = 260; Global.pos[6][6].acu = "膝關穴"; Global.pos[6][7].x = 227; Global.pos[6][7].y = 339; Global.pos[6][7].acu = "地機穴"; Global.pos[6][8].x = 210; Global.pos[6][8].y = 416; Global.pos[6][8].acu = "中都穴"; Global.pos[6][9].x = 220; Global.pos[6][9].y = 448; Global.pos[6][9].acu = "漏谷穴"; Global.pos[6][10].x = 246; Global.pos[6][10].y = 472; Global.pos[6][10].acu = "築賓穴"; Global.pos[6][11].x = 207; Global.pos[6][11].y = 468; Global.pos[6][11].acu = "蠡溝穴"; Global.pos[6][12].x = 214; Global.pos[6][12].y = 525; Global.pos[6][12].acu = "三陰交穴"; Global.pos[6][13].x = 217; Global.pos[6][13].y = 549; Global.pos[6][13].acu = "交信穴"; Global.pos[6][14].x = 231; Global.pos[6][14].y = 549; Global.pos[6][14].acu = "复溜穴"; Global.pos[6][15].x = 185; Global.pos[6][15].y = 601; Global.pos[6][15].acu = "商丘穴"; Global.pos[6][16].x = 169; Global.pos[6][16].y = 597; Global.pos[6][16].acu = "中封穴"; Global.pos[6][17].x = 218; Global.pos[6][17].y = 597; Global.pos[6][17].acu = "太谿穴"; Global.pos[6][18].x = 230; Global.pos[6][18].y = 612; Global.pos[6][18].acu = "大鐘穴"; Global.pos[6][19].x = 215; Global.pos[6][19].y = 627; Global.pos[6][19].acu = "水泉穴"; Global.pos[6][20].x = 195; Global.pos[6][20].y = 610; Global.pos[6][20].acu = "照海穴"; Global.pos[6][21].x = 162; Global.pos[6][21].y = 628; Global.pos[6][21].acu = "然谷穴"; Global.pos[6][22].x = 93; Global.pos[6][22].y = 619; Global.pos[6][22].acu = "公孫穴"; Global.pos[6][23].x = 70; Global.pos[6][23].y = 624; Global.pos[6][23].acu = "太白穴"; Global.pos[6][24].x = 43; Global.pos[6][24].y = 624; Global.pos[6][24].acu = "大都穴"; Global.pos[6][25].x = 26; Global.pos[6][25].y = 624; Global.pos[6][25].acu = "隱白穴"; Global.pos[7] = new Global.Pos[43]; Global.pos[7][0].x = 166; Global.pos[7][0].y = 66; Global.pos[7][0].acu = "居髎穴"; Global.pos[7][1].x = 233; Global.pos[7][1].y = 86; Global.pos[7][1].acu = "環跳穴"; Global.pos[7][2].x = 116; Global.pos[7][2].y = 152; Global.pos[7][2].acu = "髀關穴"; Global.pos[7][3].x = 193; Global.pos[7][3].y = 253; Global.pos[7][3].acu = "風市穴"; Global.pos[7][4].x = 196; Global.pos[7][4].y = 285; Global.pos[7][4].acu = "中瀆穴"; Global.pos[7][5].x = 145; Global.pos[7][5].y = 274; Global.pos[7][5].acu = "伏兔穴"; Global.pos[7][6].x = 167; Global.pos[7][6].y = 328; Global.pos[7][6].acu = "陰市穴"; Global.pos[7][7].x = 176; Global.pos[7][7].y = 344; Global.pos[7][7].acu = "粱丘穴"; Global.pos[7][8].x = 214; Global.pos[7][8].y = 360; Global.pos[7][8].acu = "膝陽關穴"; Global.pos[7][9].x = 191; Global.pos[7][9].y = 404; Global.pos[7][9].acu = "犢鼻穴"; Global.pos[7][10].x = 233; Global.pos[7][10].y = 428; Global.pos[7][10].acu = "陽陵泉穴"; Global.pos[7][11].x = 193; Global.pos[7][11].y = 444; Global.pos[7][11].acu = "足三里穴"; Global.pos[7][12].x = 192; Global.pos[7][12].y = 486; Global.pos[7][12].acu = "上巨虛穴"; Global.pos[7][13].x = 196; Global.pos[7][13].y = 521; Global.pos[7][13].acu = "條口穴"; Global.pos[7][14].x = 213; Global.pos[7][14].y = 523; Global.pos[7][14].acu = "豐隆穴"; Global.pos[7][15].x = 231; Global.pos[7][15].y = 535; Global.pos[7][15].acu = "外丘穴"; Global.pos[7][16].x = 246; Global.pos[7][16].y = 535; Global.pos[7][16].acu = "陽交穴"; Global.pos[7][17].x = 267; Global.pos[7][17].y = 532; Global.pos[7][17].acu = "飛揚穴"; Global.pos[7][18].x = 230; Global.pos[7][18].y = 572; Global.pos[7][18].acu = "光明穴"; Global.pos[7][19].x = 217; Global.pos[7][19].y = 586; Global.pos[7][19].acu = "陽輔穴"; Global.pos[7][20].x = 222; Global.pos[7][20].y = 600; Global.pos[7][20].acu = "懸鍾穴"; Global.pos[7][21].x = 246; Global.pos[7][21].y = 602; Global.pos[7][21].acu = "跗陽穴"; Global.pos[7][22].x = 184; Global.pos[7][22].y = 625; Global.pos[7][22].acu = "解溪穴"; Global.pos[7][23].x = 159; Global.pos[7][23].y = 635; Global.pos[7][23].acu = "衝陽穴"; Global.pos[7][24].x = 187; Global.pos[7][24].y = 649; Global.pos[7][24].acu = "丘墟穴"; Global.pos[7][25].x = 107; Global.pos[7][25].y = 645; Global.pos[7][25].acu = "太衝穴"; Global.pos[7][26].x = 110; Global.pos[7][26].y = 653; Global.pos[7][26].acu = "陷谷穴"; Global.pos[7][27].x = 125; Global.pos[7][27].y = 660; Global.pos[7][27].acu = "足臨泣穴"; Global.pos[7][28].x = 114; Global.pos[7][28].y = 666; Global.pos[7][28].acu = "第五地穴"; Global.pos[7][29].x = 72; Global.pos[7][29].y = 663; Global.pos[7][29].acu = "內庭穴"; Global.pos[7][30].x = 63; Global.pos[7][30].y = 659; Global.pos[7][30].acu = "行間穴"; Global.pos[7][31].x = 44; Global.pos[7][31].y = 661; Global.pos[7][31].acu = "大敦穴"; Global.pos[7][32].x = 41; Global.pos[7][32].y = 672; Global.pos[7][32].acu = "厲兌穴"; Global.pos[7][33].x = 70; Global.pos[7][33].y = 681; Global.pos[7][33].acu = "足竅陰穴"; Global.pos[7][34].x = 90; Global.pos[7][34].y = 684; Global.pos[7][34].acu = "至陰穴"; Global.pos[7][35].x = 96; Global.pos[7][35].y = 673; Global.pos[7][35].acu = "俠溪穴"; Global.pos[7][36].x = 117; Global.pos[7][36].y = 680; Global.pos[7][36].acu = "足通谷穴"; Global.pos[7][37].x = 137; Global.pos[7][37].y = 680; Global.pos[7][37].acu = "束骨穴"; Global.pos[7][38].x = 171; Global.pos[7][38].y = 675; Global.pos[7][38].acu = "京骨穴"; Global.pos[7][39].x = 191; Global.pos[7][39].y = 665; Global.pos[7][39].acu = "金門穴"; Global.pos[7][40].x = 215; Global.pos[7][40].y = 663; Global.pos[7][40].acu = "申脈穴"; Global.pos[7][41].x = 249; Global.pos[7][41].y = 668; Global.pos[7][41].acu = "僕參穴"; Global.pos[7][42].x = 247; Global.pos[7][42].y = 646; Global.pos[7][42].acu = "崑崙穴"; }
public void PlayGameOverMusic() { gameOverMusic.PlayLooping(); }
public void Battle(ref BattleBot battleBot) { if (!blnIsBattleSoundPlaying) { battleSound.PlayLooping(); blnIsBattleSoundPlaying = true; } if (battleBot.Fuel > 0 && battleBot.HP > 0) { intBattleStartTime = intTimeSinceGameStart; string computerWeapon = WEAPONS[rGen.Next(WEAPONS.Length)]; Console.ForegroundColor = GetColorForWeapon(battleBot.Weapon); Console.WriteLine("███████████████████████████"); SpeakingConsole.WriteLine("\n\t" + battleBot.Weapon + " "); Console.ForegroundColor = ConsoleColor.White; SpeakingConsole.WriteLine("\n\t----- VS ----- "); Console.ForegroundColor = GetColorForWeapon(computerWeapon); SpeakingConsole.WriteLine("\n\t" + computerWeapon); // Pokemon Console.WriteLine("███████████████████████████"); Console.ForegroundColor = ConsoleColor.White; //SpeakingConsole.WriteLine("\nYou are being attacked by a " + computerWeapon + ". What do you do?"); bool blnValidAction = false; char charReadKey = '\0'; while (!blnValidAction) { bool blnCheatCodeWorked = false; SpeakingConsole.WriteLine("\nAttack, Defend, or Retreat"); for (int i = 0; i < KONAMI_CODE.Length; i++) { ConsoleKeyInfo key = Console.ReadKey(); charReadKey = key.KeyChar; if (key.Key != KONAMI_CODE[i]) { break; } if (i == KONAMI_CODE.Length - 1) { battleBot.addScore(20); SpeakingConsole.WriteLine("\nYou have cheated, trainer!! But you will get 20 extra points because that's just how the world is (unfair)"); blnCheatCodeWorked = true; } } if (blnCheatCodeWorked) { continue; } string strAction = SpeakingConsole.SpeakAndReturn(charReadKey + Console.ReadLine()); switch (strAction.Trim().ToLower()) { case "attack": blnValidAction = true; if (CanBeat(battleBot.Weapon, computerWeapon)) { if (IsCriticalTo(battleBot.Weapon, computerWeapon)) { battleBot.addScore(rGen.Next(6, 11)); SpeakingConsole.WriteLine("You have critically destroyed your opponent!!"); } else { battleBot.addScore(5); SpeakingConsole.WriteLine("You have destroyed your opponent!!"); } } else { if (IsCriticalTo(battleBot.Weapon, computerWeapon)) { battleBot.HPDown(rGen.Next(6, 11)); SpeakingConsole.WriteLine("You have tragically lost!!"); } else { battleBot.HPDown(5); SpeakingConsole.WriteLine("You have lost!!"); } } battleBot.FuelDown(2 * intTimeElapsed); break; case "defend": blnValidAction = true; if (CanBeat(battleBot.Weapon, computerWeapon)) { battleBot.addScore(2); SpeakingConsole.WriteLine("You have defended yourself like a noble man!!"); } else { if (IsCriticalTo(battleBot.Weapon, computerWeapon)) { battleBot.HPDown(rGen.Next(3, 5)); SpeakingConsole.WriteLine("Whoops, your shield has completely failed!!"); } else { battleBot.HPDown(2); SpeakingConsole.WriteLine("Whoops, your shield has failed!!"); } } battleBot.FuelDown(intTimeElapsed); break; case "retreat": blnValidAction = true; if (rGen.Next(0, 4) == 0) { SpeakingConsole.WriteLine("Unfortunately, you couldn't escape in time!!"); battleBot.HPDown(7); } else { SpeakingConsole.WriteLine("You have succesfully escaped from the battle like a coward!! No points for you!!"); } battleBot.FuelDown(3 * intTimeElapsed); break; case "absorb": if (battleBot.Weapon == computerWeapon) { blnValidAction = true; SpeakingConsole.WriteLine("You have succesfully absorbed the opponent's power!! This tastes yummy OwO"); Console.WriteLine("Professor Oak<> MMMMMmmmm... Fried " + battleBot.Weapon); battleBot.Refuel(10); battleBot.Heal(10); } break; } if (blnValidAction) { GetSoundForWeapon(battleBot.Weapon).PlaySync(); battleSound.Play(); } } Thread.Sleep(1000); SpeakingConsole.WriteLine("\nBot stats:\nName: " + battleBot.Name + "\nWeapon: " + battleBot.Weapon + "\nHP: " + battleBot.HP + "\nPower Points Left: " + battleBot.Fuel + "\nTurn Time: " + intTimeElapsed + "\nTotal Battle Time: " + intTimeSinceGameStart + "\nPoints: " + battleBot.Score + "\nHighest Score: " + battleBot.HighestScore); Thread.Sleep(1000); Battle(ref battleBot); } else { battleBot.UpdateHighScore(battleBot.Score); SpeakingConsole.WriteLine("Your bot has lost. Do you want to play again?"); string strInput = ""; if ((strInput = SpeakingConsole.ReadLine()) != "" && strInput.Trim().ToLower()[0] == 'y') { battleBot = PromptUserForBot(battleBot.HighestScore); Battle(ref battleBot); } } }