コード例 #1
0
        public BossHandler(Hero heroReference)
        {
            heroRef = heroReference;
            this.CurrentState = BossState.IDLE;

            if (debug)
            {
                Console.WriteLine("BossHandler instantiated");
            }
        }
コード例 #2
0
        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;
        }
コード例 #3
0
        /*
         * 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();
        }
コード例 #4
0
 public ItemsHandler(Hero heroReference)
 {
     heroRef = heroReference;
 }