public void Execute() { int score = ScoreKeeper.Instance.IncreaseScore(); PlayerLevel.Instance.ScoreArray.Add(ScoreFactory.CreateScore(score, secondEntity.Location)); ScoreKeeper.Instance.IncMultiplier(); if (firstEntity is StarMario) { secondEntity.PopOff(); SoundFactory.Instance.PlaySoundEffect("SOUND_KICK"); int scoreDisp = ScoreKeeper.Instance.IncreaseScore(); PlayerLevel.Instance.ScoreArray.Add(ScoreFactory.CreateScore(scoreDisp, secondEntity.Location)); } firstEntity.Location = new Vector2(firstEntity.Location.X, firstEntity.Location.Y - collision.Overlap.Height); firstEntity.MovementState = new MarioRightJumpState(firstEntity); IPhysics secondEntityPhysics = (IPhysics)secondEntity; if (secondEntityPhysics.Velocity.X != 0) { secondEntityPhysics.Velocity = new Vector2(0, 0); SoundFactory.Instance.PlaySoundEffect("SOUND_STOMP"); } else { secondEntityPhysics.Velocity = new Vector2(SHELLSPEED, 0); SoundFactory.Instance.PlaySoundEffect("SOUND_STOMP"); } secondEntity.RunLeft(); secondEntity.TakeDamage(); }
public void Execute() { if (firstEntity is StarMario) { secondEntity.PopOff(); SoundFactory.Instance.PlaySoundEffect("SOUND_KICK"); int score = ScoreKeeper.Instance.IncreaseScore(); PlayerLevel.Instance.ScoreArray.Add(ScoreFactory.CreateScore(score, secondEntity.Location)); } if (secondEntity.ConditionState is EnemyDefeatedState) { IPhysics secondEntityPhysics = (IPhysics)secondEntity; if (secondEntityPhysics.Velocity.X == 0) { SoundFactory.Instance.PlaySoundEffect("SOUND_KICK"); secondEntity.RunRight(); secondEntityPhysics.Velocity = new Vector2((float)2.5, secondEntityPhysics.Velocity.Y); } else if (secondEntityPhysics.Velocity.X < 0) { firstEntity.TakeDamage(); } } else { firstEntity.TakeDamage(); } }
public void Execute() { firstEntity.CreateStarMario(); int score = ScoreKeeper.Instance.IncreaseCustomScore(1000); SuperPixelBrosGame.Level.PlayerLevel.Instance.ScoreArray.Add(ScoreFactory.CreateScore(score, secondEntity.Location)); SuperPixelBrosGame.Level.PlayerLevel.Instance.ItemArray.Remove(secondEntity); }
public void Execute() { secondEntity.PopOff(); SoundFactory.Instance.PlaySoundEffect("SOUND_KICK"); int score = ScoreKeeper.Instance.IncreaseScore(); PlayerLevel.Instance.ScoreArray.Add(ScoreFactory.CreateScore(score, secondEntity.Location)); PlayerLevel.Instance.DespawnList.Add((ICollidable)firstEntity); }
public void Execute() { int score = ScoreKeeper.Instance.IncreaseScore(); SuperPixelBrosGame.Level.PlayerLevel.Instance.ScoreArray.Add(ScoreFactory.CreateScore(score, secondEntity.Location)); SuperPixelBrosGame.Level.PlayerLevel.Instance.ItemArray.Remove(secondEntity); if (secondEntity is Coin) { ScoreKeeper.Instance.IncrementCoins(); SoundFactory.Instance.PlaySoundEffect("SOUND_COIN"); } else if (secondEntity is OneUpMushroom) { SoundFactory.Instance.PlaySoundEffect("SOUND_1UP"); } }
public void CreateOddBarScore() { ScoreFactory sf = new ScoreFactory(); IScore score = sf.CreateScore(); score.Measures.Add(sf.CreateMeasure(4, false)); score.Measures.Add(sf.CreateMeasure(3, false)); score.Measures.Add(sf.CreateMeasure(4, false)); score.Measures.Add(sf.CreateMeasure(3, false)); score.Measures.Add(sf.CreateMeasure(3, false)); score.Measures.Add(sf.CreateMeasure(4, false)); ScoreWriter sw = new ScoreWriter(score, 6); Image img = sw.RenderPage(0); img.Save("c:\\tmp\\varBarScore.bmp"); Assert.IsNotNull(img); }
public void CreateScoreWithFlats() { ScoreFactory sf = new ScoreFactory(); IScore score = sf.CreateScore(true); score.Measures.Add(sf.CreateMeasure(4, false)); score.Measures.Add(sf.CreateMeasure(3, false)); score.Measures[0].Notes.Add(sf.CreateNote(0, 13, 4)); score.Measures[0].Notes.Add(sf.CreateNote(2, 14, 4)); score.Measures[0].Notes.Add(sf.CreateNote(4, 15, 4)); score.Measures[0].Notes.Add(sf.CreateNote(14, 39, 4)); score.Measures[0].Notes.Add(sf.CreateNote(14, 40, 4)); score.Measures[1].Notes.Add(sf.CreateNote(0, 42, 4)); ScoreWriter sw = new ScoreWriter(score, 6); Image img = sw.RenderPage(0); img.Save("c:\\tmp\\flatScore.bmp"); Assert.IsNotNull(img); }
public void Execute() { int score = ScoreKeeper.Instance.IncreaseScore(); PlayerLevel.Instance.ScoreArray.Add(ScoreFactory.CreateScore(score, secondEntity.Location)); ScoreKeeper.Instance.IncMultiplier(); if (!(secondEntity.ConditionState is EnemyDefeatedState)) { if (!(firstEntity is StarMario)) { firstEntity.Location = new Vector2(firstEntity.Location.X, firstEntity.Location.Y - collision.Overlap.Height); secondEntity.TakeDamage(); firstEntity.Idle(); firstEntity.Jump(); SoundFactory.Instance.PlaySoundEffect("SOUND_STOMP"); } else { secondEntity.PopOff(); SoundFactory.Instance.PlaySoundEffect("SOUND_KICK"); } } }