public BossHandler(Hero heroReference) { heroRef = heroReference; this.CurrentState = BossState.IDLE; if (debug) { Console.WriteLine("BossHandler instantiated"); } }
private bool getIsItemNear(Hero heroRef) { bool near = false; float range = 100f; foreach (Sprite item in itemsHandler.itemSprites) { if (getIsWithinRange(heroRef.Position.X, item.Position.X, range)) { near = true; } } return near; }
/* * Loading texture and instantiating classes */ protected override void LoadContent() { hero = new Hero(); loadHeroTextures(); lateInit(); loadObstacleTextures(); loadForegroundTextures(); loadBackgroundTextures(); loadEnemyTextures(); loadItemsTextures(); loadExplosionTexure(); loadSkyTexture(); mainFont = Game.Content.Load<SpriteFont>("MainFont"); itemsHandler.createItem(); base.LoadContent(); }
public ItemsHandler(Hero heroReference) { heroRef = heroReference; }