Ejemplo n.º 1
0
        /// <summary>
        /// Spawn the bricks for this level, as defined by LevelDef
        /// </summary>
        public void SpawnBricks()
        {
            var levelInfo = LevelDef.GetLevel(mLevelIndex);

            if (levelInfo == null)
            {
                return;
            }

            int bx = 0;
            int by = 0;

            for (int x = 8; x + C.BRICK_WIDTH < RB.DisplaySize.width; x += C.BRICK_WIDTH)
            {
                for (int y = C.BRICK_HEIGHT * 3; y < C.BRICK_HEIGHT * 32; y += C.BRICK_HEIGHT)
                {
                    var brickType = levelInfo.GetBrickAt(bx, by);

                    if (brickType != Brick.BrickType.None)
                    {
                        AddBrick(new Brick(new Vector2i(x, y), brickType));
                    }

                    by++;
                }

                bx++;
                by = 0;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initialize your game here.
        /// </summary>
        /// <returns>Return true if successful</returns>
        public bool Initialize()
        {
            // You can load a spritesheet here
            RB.SpriteSheetSetup(0, "Demos/BrickBust/Sprites", new Vector2i(10, 10));
            RB.SpriteSheetSet(0);

            mMainMenu = new MainMenu();

            RB.EffectSet(RB.Effect.Scanlines, 0.2f);
            RB.EffectSet(RB.Effect.Noise, 0.01f);

            RB.ShaderSetup(C.SHADER_SHADOW, "Demos/BrickBust/DrawShaderShadow");
            RB.ShaderSpriteSheetTextureSet(C.SHADER_SHADOW, "_SpritesTexture", 0);

            RB.SoundSetup(C.SOUND_HIT_BRICK, "Demos/BrickBust/Sounds/hit");
            RB.SoundSetup(C.SOUND_HIT_WALL, "Demos/BrickBust/Sounds/hit2");
            RB.SoundSetup(C.SOUND_EXPLODE, "Demos/BrickBust/Sounds/explode");
            RB.SoundSetup(C.SOUND_DEATH, "Demos/BrickBust/Sounds/death");
            RB.SoundSetup(C.SOUND_START, "Demos/BrickBust/Sounds/start");
            RB.SoundSetup(C.SOUND_POWERUP, "Demos/BrickBust/Sounds/powerup");
            RB.SoundSetup(C.SOUND_LASERSHOT, "Demos/BrickBust/Sounds/lasershot");
            RB.SoundSetup(C.SOUND_LASERHIT, "Demos/BrickBust/Sounds/laserhit");

            RB.MusicSetup(C.MENU_MUSIC, "Demos/BrickBust/Music/BossFight");
            RB.MusicSetup(C.LEVEL_MUSIC, "Demos/BrickBust/Music/Stage2");

            RB.MusicVolumeSet(0.4f);

            LevelDef.Initialize();

            ChangeState(GameState.MAIN_MENU);

            if (UnityEngine.Application.isMobilePlatform)
            {
                C.ACTION_VERB = "TAP";
            }

            return(true);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initialize your game here.
        /// </summary>
        /// <returns>Return true if successful</returns>
        public bool Initialize()
        {
            assets.LoadAll();

            mMainMenu = new MainMenu();

            RB.EffectSet(RB.Effect.Scanlines, 0.2f);
            RB.EffectSet(RB.Effect.Noise, 0.01f);

            RB.MusicVolumeSet(0.4f);

            LevelDef.Initialize();

            ChangeState(GameState.MAIN_MENU);

            if (UnityEngine.Application.isMobilePlatform)
            {
                Global.ACTION_VERB = "TAP";
            }

            return(true);
        }