/// <summary> /// Shoot if we have the laser powerup /// </summary> private void Shoot() { if (!mLaser) { return; } BrickBustGame game = (BrickBustGame)RB.Game; var level = game.Level; LaserShot shot; if (mLaserTurn == 0) { shot = new LaserShot(new Vector2i(Rect.x + 1, Rect.y - 8)); level.AddShot(shot); } else { shot = new LaserShot(new Vector2i(Rect.x + Rect.width, Rect.y - 8)); level.AddShot(shot); } level.Particles.Impact(new Vector2i(shot.Rect.x + 3, shot.Rect.y + 5), new Vector2(0, -1), C.COLOR_GREEN_BRICK); mLaserTurn = (mLaserTurn == 0) ? 1 : 0; RB.SoundPlay(C.SOUND_LASERSHOT, 1, UnityEngine.Random.Range(0.9f, 1.1f)); }
/// <summary> /// Add a laser shot /// </summary> /// <param name="shot">Lasershot to add</param> public void AddShot(LaserShot shot) { mLaserShots.Add(shot); }