public CommandProjectileFactory()
        {
            command = new CommandProjectileSpawnController();
            CommandProjectileSpawn s = new CommandProjectileSpawn(MovementControllerFactory.getFactory.getController());

            for (int i = 0; i < 10; i = i + 2)
            {
                s.addColumn(i);
            }

            s.addOffset(2500);
            command.addCommand(s);
            s = new CommandProjectileSpawn(MovementControllerFactory.getFactory.getController());
            for (int i = 9; i > 0; i = i - 2)
            {
                s.addColumn(i);
            }

            s.addOffset(2000);
            command.addCommand(s);
        }
Beispiel #2
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();
        }