public void EnemyFireballCollide(Enemy enemy, Fireball fireball) { enemy.TakeDamage(); game.ach.AchievementAdjustment(AchievementsManager.AchievementType.Fireball); game.level.deadFireballs.Add(fireball); mario.fireballCount--; game.gameHUD.Score += ValueHolder.enemyHurtPoints; }
public void BlockFireballCollide(Block block, Fireball fireball) { Rectangle blockRect = block.GetBoundingBox(); Rectangle fireballRect = fireball.GetBoundingBox(); Rectangle intersection = Rectangle.Intersect(blockRect, fireballRect); if (fireballRect.Bottom > blockRect.Top && fireballRect.Bottom < blockRect.Bottom) { fireball.position.Y = fireball.position.Y - intersection.Height; } if (!block.state.GetType().Equals((new GenericBlockState(SpriteFactory.sprites.ground).GetType()))) { game.level.deadFireballs.Add(fireball); mario.fireballCount--; } }
public void MakeFireballMario() { state.MakeFireballMario(); isFireball = true; isNinja = false; if (fireballCount < ValueHolder.maxFireballs && isFire) { if (projectileTimer == 0) { if (isLeft) { fireball = new Fireball(new Vector2(position.X - ValueHolder.projectileXSpawn, position.Y + ValueHolder.projectileYSpawn), true); } else { fireball = new Fireball(new Vector2(position.X + ValueHolder.projectileXSpawn, position.Y + ValueHolder.projectileYSpawn), false); } Game1.GetInstance().level.levelFireballs.Add(fireball); fireballCount++; } } }