Beispiel #1
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();
        }
 public void setPos(float x, float y)
 {
     sprite.setPosition(x, y);
 }
Beispiel #3
0
 public void UpdatePos()
 {
     sprite.setPosition(x, y);
     collisionSprite.setPosition(x, y);
 }