Exemplo n.º 1
0
        void Start()
        {
            _authModule = new FirebaseAuthModule();
            FB.Init();
            _authModule.Init();
            _messagesService = new SharedMessagesService();
            var firebaseStorage = new FirebaseSharedMessagesStorage();

            firebaseStorage.Init(_authModule);
            _messageStorage = firebaseStorage;
            _textProcessor  = new TextSharedMessageProcessor();
            _messagesService.RegisterProcessor <TextSharedMessage>(_textProcessor);
            _messagesService.Init(_authModule, _messageStorage);
            _messageControls.Init(_messagesService, _authModule);

            _loginControls.Init(_authModule);

            _remoteObjectsProvider = new FirebaseRemoteDataProvider();
            _mutableObjectFactory  = new MutableObjectFactory(_remoteObjectsProvider);
            _batchUpdater          = new FirebaseBatchUpdater();
            _queries = new FirebasePvpQueries(_remoteObjectsProvider);
            _profileControls.Init(_mutableObjectFactory, _authModule, _batchUpdater);
            _functionControls.Init(_queries);
            _transactionControls.Init(_remoteObjectsProvider, _authModule);
        }
Exemplo n.º 2
0
        public GameState(IStateChanger stateChanger, GraphicsDevice graphicsDevice, ContentManager content)
            : base(stateChanger, graphicsDevice, content)
        {
            scale       = 1.6f;
            movement    = new Movement(6, 12, 24);
            aniCreator  = new AnimationCreator();
            levelBinder = new LevelBinder();
            collidy     = new CollisionManager();
            spriteBatch = new SpriteBatch(graphicsDevice);

            Texture2D texture        = content.Load <Texture2D>("LightBandit_Spritesheet");
            Texture2D tileset        = content.Load <Texture2D>("tileset");
            Texture2D LavaTexture    = content.Load <Texture2D>("pngkey.com-lava-png-2333904");
            Texture2D portalTexture  = content.Load <Texture2D>("Green Portal Sprite Sheet");
            Texture2D HeartTexture   = content.Load <Texture2D>("heart-sprite-png-2");
            Texture2D NumbersTexture = content.Load <Texture2D>("aGOgp");

            remote = new KeyBoard();
            ((KeyBoard)remote).downk   = Keys.Down;
            ((KeyBoard)remote).upk     = Keys.Space;
            ((KeyBoard)remote).leftk   = Keys.A;
            ((KeyBoard)remote).rightk  = Keys.D;
            ((KeyBoard)remote).sprintk = Keys.LeftShift;

            gravity      = new Gravity(4, 0.3f, 0.7f);
            player       = new Player(new Vector2(100, 800), 60, 52, scale, texture, remote, movement, aniCreator, gravity);
            lava         = new LavaSheet(LavaTexture, new Vector2(-10, 1100), scale);
            currentLevel = new Level(player, tileset, portalTexture, new Vector2(-10, -40), levelBinder, lava, scale);
            levelcollidy = new LevelCollision(player, currentLevel, collidy);
            gameOver     = new GameOver(player, lava, collidy, currentLevel);
            nextLevel    = new NextLevel(player, currentLevel, collidy, stateChanger, graphicsDevice, content, lava);
            hud          = new HUD(HeartTexture, NumbersTexture, aniCreator, player);

            batchUpdater = new BatchUpdater(gravity, player, levelcollidy, currentLevel, gameOver, nextLevel, hud);
        }