public SStarSpawning(IPowerUp powerup) { this.counter = 0; this.Powerup = powerup; Powerup.Velocity = Vector2.Zero; SoundPanel.PlaySoundEffect(Sound.powerupappearsEffect); }
public void Spawn() { Vine v = ((VineSpawner)Powerup).vine; v.Position = new Vector2(Powerup.Position.X, Powerup.Position.Y - v.Hitbox.Height()); Powerup.IsActive = false; SoundPanel.PlaySoundEffect(Sound.vineEffect); }
public void CollisionRight(ITangible obj) { if (obj is BowserFireball || obj is Hammer) { ICommand c = new PowerDownPlayerCommand(subject); CommandScheduler.Queue(c); } if (obj is Axe) { DestroyBowserBridge(); subject.Velocity = new Vector2(subject.Velocity.X, 0f); subject.AutoMove = new FinishCastleAutoMovement(subject); } if (obj is FlagpoleFlag) { subject.AutoMove = new FinishLevelAutoMovement(subject); SoundPanel.PlaySoundEffect(Sound.flagpoleEffect); } else if (obj is FireFlower || (obj is Mushroom && subject.State is ISmallMarioState)) { ICommand c = new PowerUpPlayerCommand(subject); CommandScheduler.Queue(c); SoundPanel.PlaySoundEffect(Sound.powerupEffect); } else if (obj is Star) { ICommand c = new StarPlayerCommand(subject); CommandScheduler.Queue(c); SoundPanel.PlaySoundEffect(Sound.powerupEffect); } else if (obj is IEnemy) { if (!(obj.State is SHammerBroDead || obj.State is SKoopaShelled || obj.State is SKoopaShelledUpsideDown || obj.State is SKoopaWarning || obj.State is SKoopaWarningUpsideDown || obj.State is SGoombaStomped || obj.State is SBuzzyBeetleShelled || obj.State is SBuzzyBeetleShelledUpsideDown || obj.State is SKoopaShellMovingRight || obj.State is SKoopaUpsideDownShellMovingRight || obj.State is SBuzzyBeetleShellMovingRight || obj.State is SBuzzyBeetleUpsideDownShellMovingRight)) { ICommand c = new PowerDownPlayerCommand(subject); CommandScheduler.Queue(c); } } else if (obj is IBlock && !(obj is BlockHidden && obj.State is SBlockIdle) && !(obj is LevelTransitionPoint || obj is MazeCheckpoint || obj is MazeFinish)) { // handle block collision subject.Position = new Vector2(((IBlock)obj).Hitbox.Left() - Hitboxes.BLOCK_WIDTH + Hitboxes.SMALL_MARIO_IDLE_OFFSET_X, subject.Position.Y); subject.Velocity = new Vector2(0f, subject.Velocity.Y); } if (obj is IRope) { if (!(subject.State is IClimbingMarioState) && subject.State is IRightMarioState) { subject.Position = new Vector2(((IRope)obj).Hitbox.Left() - Hitboxes.SMALL_MARIO_CLIMBING_WIDTH, subject.Position.Y); ((IPlayerState)subject.State).Climb(); } else if (obj.Hitbox.Top() - subject.Hitbox.Bottom() > -5 || subject.Hitbox.Top() - obj.Hitbox.Bottom() > -5) { subject.Position = new Vector2(subject.Position.X, subject.Position.Y + 1); } } }
public void CollisionRight(ITangible type) { if (type is IPlayer) { subject.IsActive = false; HUD.SCORE[HUD.currentPlayer] += HotDAMN.SCORE_COLLECT_COIN; HUD.COINS[HUD.currentPlayer]++; SoundPanel.PlaySoundEffect(Sound.coinEffect); } }
public Fireworks(Vector2 position) { this.Position = position; this.Velocity = Vector2.Zero; this.State = new SParticleExplosion(this, 25); this.Sprite = new Animation(Textures.particleExplosion, 3, 12); this.IsActive = true; SoundPanel.PlaySoundEffect(Sound.fireworksEffect); HUD.SCORE[HUD.currentPlayer] += HotDAMN.SCORE_COLLECT_FIREWORK; }
public void CollisionRight(ITangible obj) { if ((obj is IPlayer && ((IPlayer)obj).Decorator is StarPlayer) || obj is IProjectile || (obj.State is SKoopaShellMovingLeft || obj.State is SKoopaShellMovingRight || obj.State is SKoopaUpsideDownShellMovingLeft || obj.State is SKoopaUpsideDownShellMovingRight || obj.State is SBuzzyBeetleShellMovingLeft || obj.State is SBuzzyBeetleShellMovingRight || obj.State is SBuzzyBeetleUpsideDownShellMovingLeft || obj.State is SBuzzyBeetleUpsideDownShellMovingRight)) { HUD.SCORE[HUD.currentPlayer] += HotDAMN.SCORE_KILL_PIRANHAPLANT; HUD.level.AddParticle(new Score(subject.Position, HotDAMN.SCORE_KILL_PIRANHAPLANT)); SoundPanel.PlaySoundEffect(Sound.kickEffect); subject.IsActive = false; } }
public SBowserFireballLeft(IProjectile projectile) { this.counter = 0; this.Projectile = projectile; Projectile.Hitbox.Clear(); SetHitbox(); Projectile.Velocity = new Vector2(-2f, 0f); SoundPanel.PlaySoundEffect(Sound.bowerfireEffect); }
public void CollisionAbove(ITangible type) { if (type is IPlayer) { subject.IsActive = false; HUD.LIVES[HUD.currentPlayer]++; HUD.level.AddParticle(new Score(subject.Position, 0)); SoundPanel.PlaySoundEffect(Sound.powerup1upEffect); } }
public SBlooperDead(IEnemy enemy) { this.Enemy = enemy; Enemy.Sprite = new Animation(Textures.blooperDead); Enemy.Hitbox.Clear(); SetHitbox(); Enemy.Acceleration = Physics.GRAVITY; counter = 0; SoundPanel.PlaySoundEffect(Sound.kickEffect); }
public SCoinSpawning(IPowerUp powerup) { this.counter = 0; this.Powerup = powerup; Powerup.Sprite = new Animation(Textures.powerupCoinSpinning, 4, 4); Powerup.Velocity = new Vector2(0, -7f); Powerup.Acceleration = Physics.GRAVITY / 2; SoundPanel.PlaySoundEffect(Sound.coinEffect); HUD.COINS[HUD.currentPlayer]++; HUD.SCORE[HUD.currentPlayer] += HotDAMN.SCORE_COLLECT_COIN; }
public SFireballBouncingLeft(IProjectile projectile) { this.Projectile = projectile; Projectile.Sprite = new Animation(Textures.powerup1up); Projectile.Hitbox.Clear(); SetHitbox(); Projectile.Velocity = new Vector2(-6f, Projectile.Velocity.Y); SoundPanel.PlaySoundEffect(Sound.fireballEffect); }
public void CollisionRight(ITangible type) { if (!(type is IPlayer || type is IProjectile)) { HUD.level.AddParticle(new Explosion(subject.Position)); subject.IsActive = false; if (!(type is IEnemy)) { SoundPanel.PlaySoundEffect(Sound.bumpEffect); } } }
public SGoombaStomped(IEnemy enemy) { this.Enemy = enemy; Enemy.Sprite = new SettingDependentAnimation(Textures.goombaStomped); Enemy.Hitbox.Clear(); SetHitbox(); Enemy.Velocity = Vector2.Zero; timer = 0; SoundPanel.PlaySoundEffect(Sound.stompEffect); }
public void LevelTransition(IPlayer player) { String go = ((Vine)subject).go; HUD.MARIO_STATE[HUD.currentPlayer] = (IPlayerState)player.State; int time = HUD.TIME; HUD.level.game.state = new SInLevel(HUD.level.game, go); SoundPanel.PlaySoundEffect(Sound.vineEffect); HUD.TIME = time; }
public SGoombaDead(IEnemy enemy) { this.Enemy = enemy; Enemy.Sprite = new SettingDependentAnimation(Textures.goombaDead); Enemy.Hitbox.Clear(); SetHitbox(); Enemy.Velocity = new Vector2(0, -5f); Enemy.Acceleration = Physics.GRAVITY / 2; counter = 0; SoundPanel.PlaySoundEffect(Sound.kickEffect); }
public SMarioTansition(IPlayer player, Type newState, TextureMap newSprite) { this.oldAcceleration = player.Acceleration; this.oldVelocity = player.Velocity; this.Player = player; this.newState = newState; Player.Acceleration = Vector2.Zero; Player.Sprite = new MarioAnimation(HUD.currentPlayer == 0 ? Textures.marioTransition : Textures.luigiTransition, newSprite); if (newSprite == Textures.bigSmallTransitionLeft || newSprite == Textures.bigSmallTransitionRight) { SoundPanel.PlaySoundEffect(Sound.pipeEffect); } }
public SSpinyDeadLeft(IEnemy enemy) { this.Enemy = enemy; Enemy.Sprite = new Animation(Textures.spinyDeadLeft); Enemy.Hitbox.Clear(); SetHitbox(); Enemy.Velocity = new Vector2(0, -5f); Enemy.Acceleration = Physics.GRAVITY / 2; counter = 0; SoundPanel.PlaySoundEffect(Sound.kickEffect); }
public SBuzzyBeetleShelled(IEnemy enemy) { this.Enemy = enemy; Enemy.Sprite = new Animation(Textures.buzzyBeetleInShell); Enemy.Hitbox.SetOffset(Hitboxes.BUZZYBEETLE_SHELL_OFFSET_X, Hitboxes.BUZZYBEETLE_SHELL_OFFSET_Y); Enemy.Hitbox.Clear(); SetHitbox(); Enemy.Velocity = new Vector2(0, 0); timer = 0; SoundPanel.PlaySoundEffect(Sound.stompEffect); }
public SLakituDead(IEnemy enemy) { this.Enemy = enemy; Enemy.Sprite = new Animation(Textures.lakituDead); Enemy.Hitbox.Clear(); SetHitbox(); Enemy.Velocity = Vector2.Zero; Enemy.Acceleration = Physics.GRAVITY / 2; counter = 0; SoundPanel.PlaySoundEffect(Sound.stompEffect); }
public SBulletDead(IEnemy enemy) { this.Enemy = enemy; Enemy.Hitbox.Clear(); SetHitbox(); Enemy.Velocity = new Vector2(0, -5f); Enemy.Acceleration = Physics.GRAVITY / 2; counter = 0; SoundPanel.PlaySoundEffect(Sound.kickEffect); }
public SBulletStomped(IEnemy enemy) { this.Enemy = enemy; Enemy.Hitbox.Clear(); SetHitbox(); Enemy.Velocity = Vector2.Zero; Enemy.Acceleration = Physics.GRAVITY; timer = 0; SoundPanel.PlaySoundEffect(Sound.stompEffect); }
public SKoopaShelled(IEnemy enemy) { this.Enemy = enemy; Enemy.Sprite = new SettingDependentAnimation(Textures.koopaInShell); Enemy.Hitbox.SetOffset(Hitboxes.KOOPA_SHELL_OFFSET_X, Hitboxes.KOOPA_SHELL_OFFSET_Y); Enemy.Hitbox.Clear(); SetHitbox(); Enemy.Velocity = new Vector2(0, 0); this.timer = 0; SoundPanel.PlaySoundEffect(Sound.stompEffect); }
public void CollisionAbove(ITangible obj) { if (obj is BowserFireball || obj is Hammer) { ICommand c = new PowerDownPlayerCommand(subject); CommandScheduler.Queue(c); } if (obj is Axe) { DestroyBowserBridge(); subject.Velocity = new Vector2(subject.Velocity.X, 0f); subject.AutoMove = new FinishCastleAutoMovement(subject); } if (obj is FlagpoleFlag) { subject.AutoMove = new FinishLevelAutoMovement(subject); SoundPanel.PlaySoundEffect(Sound.flagpoleEffect); } else if (obj is FireFlower || (obj is Mushroom && subject.State is ISmallMarioState)) { ICommand c = new PowerUpPlayerCommand(subject); CommandScheduler.Queue(c); SoundPanel.PlaySoundEffect(Sound.powerupEffect); } else if (obj is Star) { ICommand c = new StarPlayerCommand(subject); CommandScheduler.Queue(c); SoundPanel.PlaySoundEffect(Sound.powerupEffect); } else if (obj is IEnemy) { if (!(obj.State is SHammerBroDead || obj.State is SKoopaShelled || obj.State is SKoopaShelledUpsideDown || obj.State is SGoombaStomped || obj.State is SBuzzyBeetleShelled || obj.State is SBuzzyBeetleShelledUpsideDown)) { ICommand c = new PowerDownPlayerCommand(subject); CommandScheduler.Queue(c); } } else if (obj is IBlock && !(obj is LevelTransitionPoint || obj is MazeCheckpoint || obj is MazeFinish)) { if (subject.State is ISmallMarioState) { subject.Position = new Vector2(subject.Position.X, ((IBlock)obj).Hitbox.Bottom() - Hitboxes.SMALL_MARIO_IDLE_OFFSET_Y); } else { subject.Position = new Vector2(subject.Position.X, ((IBlock)obj).Hitbox.Bottom() - Hitboxes.BIG_MARIO_IDLE_OFFSET_Y); } subject.Velocity = new Vector2(subject.Velocity.X, 1f); } }
public SRedKoopaDead(IEnemy enemy) { this.Enemy = enemy; Enemy.Sprite = new Animation(Textures.redKoopaInShellUpsideDown); Enemy.Hitbox.SetOffset(Hitboxes.KOOPA_SHELL_OFFSET_X, Hitboxes.KOOPA_SHELL_OFFSET_Y); Enemy.Hitbox.Clear(); SetHitbox(); Enemy.Velocity = new Vector2(0, -5f); Enemy.Acceleration = Physics.GRAVITY / 2; counter = 0; SoundPanel.PlaySoundEffect(Sound.kickEffect); }
public void CollisionAbove(ITangible obj) { if (obj is Fireball || obj.State is SKoopaShellMovingRight || obj.State is SKoopaShellMovingLeft || obj.State is SKoopaUpsideDownShellMovingLeft || obj.State is SKoopaUpsideDownShellMovingRight || obj.State is SRedKoopaShellMovingRight || obj.State is SRedKoopaShellMovingLeft || obj.State is SRedKoopaUpsideDownShellMovingLeft || obj.State is SRedKoopaShellMovingLeft || obj.State is SRedKoopaUpsideDownShellMovingRight || obj.State is SBuzzyBeetleShellMovingLeft || obj.State is SBuzzyBeetleShellMovingRight || obj.State is SBuzzyBeetleUpsideDownShellMovingLeft || obj.State is SBuzzyBeetleUpsideDownShellMovingRight) { if (obj is IProjectile) { HUD.SCORE[HUD.currentPlayer] += HotDAMN.SCORE_KILL_KOOPA; HUD.level.AddParticle(new Score(subject.Position, HotDAMN.SCORE_KILL_KOOPA)); } else { HUD.KoopaShellSequence(obj); } subject.State = new SKoopaDead(subject); } if (obj is IPlayer) { if (((IPlayer)obj).Decorator is StarPlayer) { HUD.SCORE[HUD.currentPlayer] += HotDAMN.SCORE_KILL_KOOPA; HUD.level.AddParticle(new Score(subject.Position, HotDAMN.SCORE_KILL_KOOPA)); subject.State = new SKoopaDead(subject); } else if (subject.State is SKoopaBouncingLeft) { SoundPanel.PlaySoundEffect(Sound.stompEffect); HUD.SCORE[HUD.currentPlayer] += HotDAMN.SCORE_DEWING_KOOPA; HUD.level.AddParticle(new Score(subject.Position, HotDAMN.SCORE_DEWING_KOOPA)); subject.State = new SKoopaWalkingLeft(subject); } else if (subject.State is SKoopaBouncingRight) { SoundPanel.PlaySoundEffect(Sound.stompEffect); HUD.SCORE[HUD.currentPlayer] += HotDAMN.SCORE_DEWING_KOOPA; HUD.level.AddParticle(new Score(subject.Position, HotDAMN.SCORE_DEWING_KOOPA)); subject.State = new SKoopaWalkingRight(subject); } else if (!(subject.State is SKoopaShelledUpsideDown || subject.State is SKoopaUpsideDownShellMovingLeft || subject.State is SKoopaUpsideDownShellMovingRight)) { HUD.StompingPoints(obj); subject.State = new SKoopaShelled(subject); } else { HUD.StompingPoints(obj); subject.State = new SKoopaShelledUpsideDown(subject); } } }
public void CollisionRight(ITangible type) { if (type is IPlayer) { HUD.LIVES[HUD.currentPlayer]++; subject.IsActive = false; HUD.level.AddParticle(new Score(subject.Position, 0)); SoundPanel.PlaySoundEffect(Sound.powerup1upEffect); } else if (!(type is IEnemy || type is IPowerUp)) { subject.State = new S1UpMovingLeft(subject); } }
public SKoopaShelledUpsideDown(IEnemy enemy) { this.Enemy = enemy; Enemy.Sprite = new SettingDependentAnimation(Textures.koopaInShellUpsideDown); Enemy.Hitbox.SetOffset(Hitboxes.KOOPA_SHELL_OFFSET_X, Hitboxes.KOOPA_SHELL_OFFSET_Y); Enemy.Hitbox.Clear(); SetHitbox(); Enemy.Velocity = new Vector2(0, -5f); Enemy.Acceleration = Physics.GRAVITY / 2; timer = 0; SoundPanel.PlaySoundEffect(Sound.stompEffect); }
public void CollisionBelow(ITangible type) { if (type is IPlayer) { subject.IsActive = false; HUD.LIVES[HUD.currentPlayer]++; HUD.level.AddParticle(new Score(subject.Position, 0)); SoundPanel.PlaySoundEffect(Sound.powerup1upEffect); } else if (type is IBlock && !(type is BlockHidden && type.State is SBlockIdle)) { subject.Position = new Vector2(subject.Position.X, ((IBlock)type).Hitbox.Top() - Hitboxes.ONE_UP_HEIGHT - Hitboxes.ONE_UP_OFFSET_Y); subject.Velocity = new Vector2(subject.Velocity.X, 0); } }
public SJumpingRightIdleFireMario(IPlayer player) { this.Player = player; Player.Sprite = new MarioAnimation(HUD.currentPlayer == 0 ? Textures.mario0 : Textures.luigi0, Textures.fireRightJumping); Player.Hitbox.SetOffset(Hitboxes.BIG_MARIO_JUMP_OFFSET_X, Hitboxes.BIG_MARIO_JUMP_OFFSET_Y); Player.Hitbox.Clear(); SetHitbox(); if (!(player.State is IJumpingMarioState)) { Player.Velocity += new Vector2(0f, -6f); SoundPanel.PlaySoundEffect(Sound.jumpsuperEffect); } Player.Acceleration = Physics.GRAVITY; }
public SJumpingLeftSmallMario(IPlayer player) { this.Player = player; Player.Sprite = new MarioAnimation(HUD.currentPlayer == 0 ? Textures.mario0 : Textures.luigi0, Textures.smallLeftJumping); Player.Hitbox.SetOffset(Hitboxes.SMALL_MARIO_JUMP_OFFSET_X, Hitboxes.SMALL_MARIO_JUMP_OFFSET_Y); Player.Hitbox.Clear(); SetHitbox(); if (!(player.State is IJumpingMarioState)) { Player.Velocity += new Vector2(0f, -6f); SoundPanel.PlaySoundEffect(Sound.jumpsmallEffect); } Player.Acceleration = new Vector2(-0.1f, Player.Acceleration.Y); }