public void Throw() { if (Baby == null) { if (holdingBaby) { Vector2 throwPos = new Vector2(pos.X + rect.Width / 2, pos.Y + rect.Height / 2); Baby = new Baby(throwPos, throwStrength * Input.GetThumbs(index).X, index, w); holdingBaby = false; int i = Config.rand.Next(SoundManager.cry.Length); if (!automate) { if (crySound != null) { if (crySound.State == SoundState.Playing) { crySound.Stop(); } } SoundEffectInstance swoosh = SoundManager.swoosh.CreateInstance(); swoosh.Volume = .8f; swoosh.Play(); crySound = SoundManager.cry[i].CreateInstance(); crySound.Volume = .1f; crySound.Play(); } } } }
public static void Update(float dt, Player p) { arrowTimer += (dt / 1000) * speed; wave = (float)Math.Sin(arrowTimer) * amplitude; if (counter == 0) { p.Baby = null; p.HoldingBaby = false; } if (counter < 4) { p.BabyLife = p.MaxBabyLife / 2; } if (done) { doneTimer += dt / 1000; } if (doneTimer > 2.2f) { Config.tutorial = false; } if (cueCounter) { timer += dt; if (timer >= cueTime) { if (counter == 0) { destination.X = Config.screenW / 17; destination.Y = (Config.screenH / 4) + (Config.screenH / 10); text = "welcome to glow, baby, glow!"; } else if (counter == 1) { Enemy e = new Enemy(new Point( Config.screenW / 3, (Config.screenH / 2) - Tile.Size), w); w.EnemyManager.Add(e); text = "shoot that nasty looking thing over there"; text2 = "using "; if (Input.keys) { text2 += "shift"; } else { text2 += "#"; } } else if (counter == 2) { destination.X = Config.screenW / 2 - (Config.screenW / 30); destination.Y = Config.screenH - (Config.screenH / 5); text = "so far so good"; text2 = "hey, go stand over there"; } else if (counter == 3) { for (int i = 0; i < 50; i++) { Vector2 pos = new Vector2(Config.screenW / 2, Config.screenH / 5); pos.X += (float)(Config.rand.NextDouble() * Config.screenW / 10) - Config.screenW / 20; GooParticle gp = new GooParticle(pos); w.ParticleManager.AddParticle(gp); } Baby b = new Baby(new Vector2( Config.screenW / 2, Config.screenH / 5), 0, p.Index, w); b.Velocity = new Vector2(0, 0); p.Baby = b; text = "catch the baby!"; text2 = ""; } else if (counter == 4) { text = "keep the baby alive by rocking it"; if (Input.keys) { text2 = "hold shift, mash left and right"; } else { text2 = "hold #, spin the control stick $"; } } else if (counter == 5) { destination.X = Config.screenW / 2; destination.Y = (Config.screenH / 4) + (Config.screenH / 10); text = "oh yeah, whatever you do-"; text2 = "dont drop the baby!!!"; } else if (counter == 6) { destination.X = Config.screenW / 17; destination.Y = (Config.screenH / 4) + (Config.screenH / 10); text = "you can give the baby a little toss-"; if (Input.keys) { text2 = "hold " + "space" + ", aim, and release!"; } else { text2 = "hold " + "@" + ", aim, and release!"; } } else if (counter == 7) { for (int i = 0; i < 5; i++) { w.EnemyManager.Spawn(); } text = "take care of these guys"; text2 = "coins will give you points!"; } else if (counter == 8) { text = "good job, man"; text2 = "you can figure the rest out yourself"; destination.X = (Config.screenW / 20); destination.Y = Config.screenH - (Config.screenH / 5); } counter++; timer = 0; cueCounter = false; return; } } else { if (counter == 1) { if (p.HitRect.Intersects(destination)) { cueCounter = true; } } else if (counter == 2) { if (w.EnemyManager.Enemies.Count == 0) { cueCounter = true; } } else if (counter == 3) { if (p.HitRect.Intersects(destination)) { cueCounter = true; } } else if (counter == 4) { if (p.HoldingBaby) { cueCounter = true; } } else if (counter == 5) { if (p.BabyLife >= p.MaxBabyLife - 1) { cueCounter = true; } } else if (counter == 6) { if (p.HitRect.Intersects(destination)) { cueCounter = true; } } else if (counter == 7) { if (p.HitRect.Intersects(destination)) { cueCounter = true; } } else if (counter == 8) { if (w.EnemyManager.Enemies.Count == 0) { cueCounter = true; } } else if (counter == 9) { if (p.HitRect.Intersects(destination)) { cueCounter = true; done = true; } } } }