public void EnemyThrowingStarCollide(Enemy enemy, ThrowingStar throwingStar) { enemy.TakeDamage(); game.level.deadThrowingStars.Add(throwingStar); mario.throwingStarCount--; game.gameHUD.Score += ValueHolder.enemyHurtPoints; }
public void BlockThrowingStarCollide(Block block, ThrowingStar throwingStar) { Rectangle blockRect = block.GetBoundingBox(); Rectangle throwingStarRect = throwingStar.GetBoundingBox(); Rectangle intersection = Rectangle.Intersect(blockRect, throwingStarRect); if (throwingStarRect.Bottom > blockRect.Top && throwingStarRect.Bottom < blockRect.Bottom) { throwingStar.position.Y = throwingStar.position.Y - intersection.Height; } if (!block.state.GetType().Equals((new GenericBlockState(SpriteFactory.sprites.ground).GetType()))) { game.level.deadThrowingStars.Add(throwingStar); mario.throwingStarCount--; } }
public void MakeNinjaMario() { state.MakeNinjaMario(); if (throwingStarCount < ValueHolder.maxThrowingStars) { if (projectileTimer == 0) { if (isLeft) { throwingStar = new ThrowingStar(new Vector2(position.X - ValueHolder.projectileXSpawn, position.Y + ValueHolder.projectileYSpawn), true); } else { throwingStar = new ThrowingStar(new Vector2(position.X + ValueHolder.projectileXSpawn, position.Y + ValueHolder.projectileYSpawn), false); } Game1.GetInstance().level.levelThrowingStars.Add(throwingStar); throwingStarCount++; } } isBig = true; }