public Sprite createExplosion()
        {
            Sprite temp = new ProxySprite(SpriteType.Explosion, RealSpriteFactory.getSprite(SpriteType.Explosion));

            temp.setSprite(sprite);
            manager.createActive(temp);
            temp.setScale(SizeFactory.getFactory.alienScale.spriteWidth, SizeFactory.getFactory.alienScale.spriteHeight);
            return(temp);
        }
 public ProxyExplosionSpriteFactory()
 {
     manager = SpriteManagerFactory.createSpriteManager(SpriteType.Explosion, 0);
     sprite  = RealSpriteFactory.getSprite(SpriteType.Explosion);
     sprite.setScale(SizeFactory.getFactory.alienScale.spriteWidth, SizeFactory.getFactory.alienScale.spriteHeight);
 }
        public ProxyLetterSprite createLetter(char c)
        {
            ProxyLetterSprite temp = new ProxyLetterSprite(SpriteType.Letter, ImageFactoryLetter.getFactory().getImage(c), RealSpriteFactory.getSprite(SpriteType.Letter));

            manager.createActive(temp);
            temp.setScale(SizeFactory.getFactory.letterScale.spriteWidth, SizeFactory.getFactory.letterScale.spriteHeight);
            return(temp);
        }
Ejemplo n.º 4
0
 public static AnimationManager makeAnimation(SpriteType name)
 {
     return(new AnimationManager(ManagerConstructor.getImageManager(name), RealSpriteFactory.getSprite(name), name));
 }
Ejemplo n.º 5
0
 public Projectile editEnemyProjectile(Projectile projectile)
 {
     projectile.swapSprite(RealSpriteFactory.getSprite(SpriteType.EnemyProjectile));
     return(projectile);
 }
Ejemplo n.º 6
0
        public override void Load()
        {
            Receiver.instance.clearTime();
            if (isLoaded == false)
            {
                resetCommand = new PlayGameResetCommand();
                explosion    = RealSpriteFactory.getSprite(SpriteType.Explosion);
                CollisionSubjectFactory.getFactory.getAlienVictorySubject().setPos(800, 100);
                CollisionSubjectFactory.getFactory.getAlienVictorySubject().setScale(100, 30);
                ufoController = UFOSpawnControllerFactory.getFactory.getController;
                isLoaded      = true;
                it            = CollisionControllerFactory.getFactor.getIterator;

                shieldList = ShieldListFactory.getFactory.getShieldList();
                //collisionBox = new Azul.SpriteBox(new Azul.Rect(1,1,1,1), new Azul.Color(1.0f, 1.0f, 1.0f, 1.0f));
                Azul.Texture f = new Azul.Texture("Font.tga");

                GameObjectTreeFactory.getFactory.getUfo().setPos(100, 100);
                GameObjectTreeFactory.getFactory.getUfo().setStatus(Status.Active);

                m = AnimationManagerList.instance.findManager(SpriteType.Crab);
                //letterManager = LetterManagerFactory.getFactory().createManager("HELLO BOYS");
                //letterManager.setPos(100, 100);

                //---------------------------------------------------------------------------------------------------------
                // Load the Textures
                //---------------------------------------------------------------------------------------------------------


                movement = MovementControllerFactory.getFactory.getController();

                /*colObserver = new MovementCollisionObserver(movement);
                 * colSubject = new AlienGridCollisionSubject(GameObjectTreeFactory.getFactory.alien, SpriteType.Unitialized);
                 * colSubject.addObserver(new MovementCollisionObserver(movement));*/
                //colSubject = CollisionSubjectFactory.getFactory.getAlienSubject();
                //colSubject.addCollisionTest(collisionTest);
                wallList = GridWallCollisionListFactory.getFactory().getList();
                player   = PlayerFactory.instance.getPlayer();

                //player.setSpriteScale(100, 100);
                inputController = PlayerInputControllerFactory.getFactory.getController();



                projectileController = ProjectileControllerFactory.instance.controller;
                controller           = CommandProjectileFactory.getFactory.controller;
                score = ScoreFactory.getFactory.player_1;
                //score.setPos(100, 100);
                //ScoreFactory.getFactory.player_2.setPos(400,100);
                //ScoreFactory.getFactory.high_score.setPos(300, 900);
                score.addScore(0);
                score.setImages();
                explosion.setPosition(300, 100);
            }
            if (start == false)
            {
                movement.setMovementDirection(MovementStateFactory.right);
                PlayerStatusControllerFactory.getFactory.getController.setAllPos(100, 600);
                PlayerStatusControllerFactory.getFactory.getController.setAllLives(3);
                ScoreFactory.getFactory.player_1.setScore(0);
                ScoreFactory.getFactory.player_2.setScore(0);
                ScoreFactory.getFactory.player_1.setImages();
                PlayScoreControllerFactory.getFactory.playController.setPlayerScoreController(ScoreFactory.getFactory.player_1);
                ScoreFactory.getFactory.player_2.setImages();
                //ufoController.getUfo().setStatus(Status);
                start = true;
            }
            CollisionSpawnFactory.getFactory.setAllInactive();
            setAllActive();
            resetPosition();
            addToRecevier();

            /*ufoController.addToReceiver();
             * movement.addCommandToReceiver();
             *
             * Scale sh = SizeFactory.getFactory.shieldScale;
             * GameObjectTreeFactory.getFactory.alien.setPos(100, 600, SizeFactory.getFactory.alienScale.spriteWidth, SizeFactory.getFactory.alienScale.spriteHeight);
             * movement.setActive(Status.Active);
             * movement.setAllActive(Status.Active);
             * shieldList.setAllActive(Status.Active);
             * shieldList.setPos(100, 200, sh.colWidth, sh.colHeight, 0);
             * shieldList.setPos(300, 200, sh.colWidth, sh.colHeight, 1);
             * shieldList.setPos(500, 200, sh.colWidth, sh.colHeight, 2);
             * shieldList.setPos(700, 200, sh.colWidth, sh.colHeight, 3);
             * player.setPos(100, 100);
             * controller.addToReceiver();
             * player.setStatus(Status.Active);*/
            projectileController.deactiateProjectiles();
        }
Ejemplo n.º 7
0
 public static Sprite makeProxySprite(SpriteType name)
 {
     return(new ProxySprite(name, RealSpriteFactory.getSprite(name)));
 }