public override void loadContent(ContentManager content) { background = content.Load <Texture2D>("maps/map1_1"); Mario.loadContent(content); Brick.loadContent(content); ItemBlock.loadContent(content); FireBall.loadContent(content); Item.loadContent(content); Enemy.loadContent(content); }
public void addFireBall(GameTime gameTime) { FireBall newFireBall; if (mario.movingRight) { newFireBall = new FireBall(mario.positionRectangle.Right + 10, mario.positionRectangle.Center.Y, gameTime, true); } else { newFireBall = new FireBall(mario.positionRectangle.Left - 10, mario.positionRectangle.Center.Y, gameTime, false); } sprites.Add(newFireBall); }
public FireballEnemyHandler(CollisionObject collision, Level level) { if (collision.LeftSlot is FireBall) { fireBall = (FireBall)collision.LeftSlot; enemy = (IEnemy)collision.RightSlot; } else { fireBall = (FireBall)collision.RightSlot; enemy = (IEnemy)collision.LeftSlot; } commandList = new List <ICommand>(); commandList.Add(new DeleteObjectCommand(level, fireBall)); commandList.Add(new StompEnemyCommand(level, enemy)); }
public FireballBlockHandler(CollisionObject collision, Level level) { if (collision.LeftSlot is FireBall) { fireBall = (FireBall)collision.LeftSlot; } else { fireBall = (FireBall)collision.RightSlot; } direction = (int)collision.CollisionType; commandList = new List <ICommand>(); if (direction == 0) { commandList.Add(new DeleteObjectCommand(level, fireBall)); } if (direction == 1) { commandList.Add(new DeleteObjectCommand(level, fireBall)); } }