Exemplo n.º 1
0
 /// <summary>
 ///  Will load images and other recourses required for the game
 /// </summary>
 /// <param name="resources"></param>
 /// <remarks>Note this function is called automatically once the game has started. and should not b called manualy</remarks>
 public static void preLoadResources(ResourceLibrary resources)
 {
     Life.preLoadResources(resources);
     BaseEnemy.preLoadResources(resources);
     Frankenstein.preLoadResources(resources);
     Cat.preLoadResources(resources);
     Ghost.preLoadResources(resources);
     Player.preLoadResources(resources);
     LightBeam.preLoadResources(resources);
     Mummy.preLoadResources(resources);
     Pumpkin.preLoadResources(resources);
     Spider.preLoadResources(resources);
     Vampire.preLoadResources(resources);
     Zombie.preLoadResources(resources);
     LightButton.preLoadResources(resources);
     EnemySoundManager.preLoadResources(resources);
 }
Exemplo n.º 2
0
        /**
         * Will initialize the objects used in game play
         * This includes the player, Light Buttons Power Bar, enemySet, and various text Objects
         */
        protected void initializeGamePlay()
        {
            //enemySet
            enemies = new EnemySet(base.getLocalLibrary(), BaseCode.worldWidth, BaseCode.worldHeight);
            enemies.setSetPadding(8f, 15f, 5f, 9f);
            //player
            player           = new Player();
            player.fillColor = Color.Blue;

            //power bar
            powerBar = new PowerBar();

            //score text
            typeSelectedText = new Text();
            BaseCode.activeDrawSet.addToDrawSet(typeSelectedText);
            typeSelectedText.setPriority(9);
            typeSelectedText.textColor  = Color.White;
            typeSelectedText.targetFont = defaultFont;

            //user text
            userText = new Text();
            BaseCode.activeDrawSet.addToDrawSet(userText);
            userText.setPriority(9);
            userText.textColor  = Color.White;
            userText.targetFont = defaultFont;

            //light type indicator buttons
            mediumButton = new LightButton();
            mediumButton.setResponsibility(player.getLight(), LightBeam.BeamType.REVEAL);
            mediumButton.removeFromDrawSet();

            wideButton = new LightButton();
            wideButton.setResponsibility(player.getLight(), LightBeam.BeamType.WIDE);
            wideButton.removeFromDrawSet();

            laserButton = new LightButton();
            laserButton.setResponsibility(player.getLight(), LightBeam.BeamType.LASER);
            laserButton.removeFromDrawSet();
        }