Exemple #1
0
        public BombController(GraphicsDevice gd, VoxelSprite sprite)
        {
            Instance = this;

            graphicsDevice = gd;

            spriteSheet = sprite;

            drawEffect = new BasicEffect(gd)
            {
                VertexColorEnabled = true
            };
        }
Exemple #2
0
        public BombController(GraphicsDevice gd, VoxelSprite sprite)
        {
            Instance = this;

            graphicsDevice = gd;

            spriteSheet = sprite;

            drawEffect = new BasicEffect(gd)
            {
                VertexColorEnabled = true
            };
        }
Exemple #3
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            AudioController.LoadContent(Content);

            tileSheet = new VoxelSprite(16, 16, 16);
            LoadVoxels.LoadSprite(Path.Combine(Content.RootDirectory, "tiles.vxs"), ref tileSheet);
            doorSheet = new VoxelSprite(16, 16, 16);
            LoadVoxels.LoadSprite(Path.Combine(Content.RootDirectory, "door.vxs"), ref doorSheet);
            objectSheet = new VoxelSprite(16, 16, 16);
            LoadVoxels.LoadSprite(Path.Combine(Content.RootDirectory, "dynamic.vxs"), ref objectSheet);

            gameCamera           = new Camera(GraphicsDevice, GraphicsDevice.Viewport);
            particleController   = new ParticleController(GraphicsDevice);
            projectileController = new ProjectileController(GraphicsDevice);
            bombController       = new BombController(GraphicsDevice, objectSheet);
            enemyController      = new EnemyController(GraphicsDevice);

            projectileController.LoadContent(Content);
            enemyController.LoadContent(Content);

            drawEffect = new BasicEffect(GraphicsDevice)
            {
                World              = gameCamera.worldMatrix,
                View               = gameCamera.viewMatrix,
                Projection         = gameCamera.projectionMatrix,
                VertexColorEnabled = true,
            };

            gameHero = new Hero(0, 0, Vector3.Zero);
            gameHero.LoadContent(Content, GraphicsDevice);

            ThreadPool.QueueUserWorkItem(delegate { CreateRoomsAsync(); });

            Doors.Add(new Door(VoxelWorld.ToScreenSpace((7 * 16) + 7, 7, 21) + new Vector3(Voxel.HALF_SIZE, Voxel.HALF_SIZE, Voxel.HALF_SIZE), 0, doorSheet));
            Doors.Add(new Door(VoxelWorld.ToScreenSpace((14 * 16) + 7, (4 * 16) + 7, 21) + new Vector3(Voxel.HALF_SIZE, Voxel.HALF_SIZE, Voxel.HALF_SIZE), 1, doorSheet));
            Doors.Add(new Door(VoxelWorld.ToScreenSpace((7 * 16) + 7, (8 * 16) + 7, 21) + new Vector3(Voxel.HALF_SIZE, Voxel.HALF_SIZE, Voxel.HALF_SIZE), 2, doorSheet));
            Doors.Add(new Door(VoxelWorld.ToScreenSpace(7, (4 * 16) + 7, 21) + new Vector3(Voxel.HALF_SIZE, Voxel.HALF_SIZE, Voxel.HALF_SIZE), 3, doorSheet));

            roomIcon = Content.Load <Texture2D>("roomicon");
            font     = Content.Load <SpriteFont>("font");
        }
Exemple #4
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            generatedPercent = 0;
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            if (firstRun)
            {
                AudioController.LoadContent(Content);

                tileSheet = new VoxelSprite(16, 16, 16);
                LoadVoxels.LoadSprite(Path.Combine(Content.RootDirectory, "tiles.vxs"), ref tileSheet);
                doorSheet = new VoxelSprite(16, 16, 16);
                LoadVoxels.LoadSprite(Path.Combine(Content.RootDirectory, "door.vxs"), ref doorSheet);
                objectSheet = new VoxelSprite(16, 16, 16);
                LoadVoxels.LoadSprite(Path.Combine(Content.RootDirectory, "dynamic.vxs"), ref objectSheet);
            }
            else if (AudioController.instances["roomscrape"].State == SoundState.Playing) AudioController.instances["roomscrape"].Pause();

            gameCamera = new Camera(GraphicsDevice, GraphicsDevice.Viewport);
            particleController = new ParticleController(GraphicsDevice);
            projectileController = new ProjectileController(GraphicsDevice);
            pickupController = new PickupController(GraphicsDevice);
            bombController = new BombController(GraphicsDevice, objectSheet);
            enemyController = new EnemyController(GraphicsDevice);

            projectileController.LoadContent(Content);
            pickupController.LoadContent(Content);
            enemyController.LoadContent(Content);

            drawEffect = new BasicEffect(GraphicsDevice)
            {
                World = gameCamera.worldMatrix,
                View = gameCamera.viewMatrix,
                Projection = gameCamera.projectionMatrix,
                VertexColorEnabled = true,
            };

            gameHero = new Hero(0, 0, Vector3.Zero, Vector3.Zero);
            gameHero.LoadContent(Content, GraphicsDevice);

            ThreadPool.QueueUserWorkItem(delegate { CreateRoomsAsync(); });

            doorCountdown = 10000;
            roomMovesLeft = 0;
            roomShift = null;
            roomState = RoomState.DoorsOpen;
            deadTime = 0;
            allRoomsComplete = false;
            shownComplete = false;
            showCompleteTime = 0;
            showCompleteAlpha = 0f;

            Doors.Clear();
            Doors.Add(new Door(VoxelWorld.ToScreenSpace((7 * 16) + 7, 7, 21) + new Vector3(Voxel.HALF_SIZE,Voxel.HALF_SIZE,Voxel.HALF_SIZE), 0, doorSheet));
            Doors.Add(new Door(VoxelWorld.ToScreenSpace((14 * 16) + 7, (4 * 16) + 7, 21) + new Vector3(Voxel.HALF_SIZE, Voxel.HALF_SIZE, Voxel.HALF_SIZE), 1, doorSheet));
            Doors.Add(new Door(VoxelWorld.ToScreenSpace((7 * 16) + 7, (8 * 16) + 7, 21) + new Vector3(Voxel.HALF_SIZE, Voxel.HALF_SIZE, Voxel.HALF_SIZE), 2, doorSheet));
            Doors.Add(new Door(VoxelWorld.ToScreenSpace(7, (4 * 16) + 7, 21) + new Vector3(Voxel.HALF_SIZE, Voxel.HALF_SIZE, Voxel.HALF_SIZE), 3, doorSheet));

            if (firstRun)
            {
                roomIcon = Content.Load<Texture2D>("roomicon");
                texHud = Content.Load<Texture2D>("hud");
                texTitle = Content.Load<Texture2D>("titlesheet");
                texTitleBG = Content.Load<Texture2D>("title-bg");
                texStingers = Content.Load<Texture2D>("stingers");
                font = Content.Load<SpriteFont>("font");
                timerFontLarge = Content.Load<SpriteFont>("timerfont-large");
                timerFontSmall = Content.Load<SpriteFont>("timerfont-small");
            }

            firstRun = false;
        }
Exemple #5
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            generatedPercent = 0;
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            if (firstRun)
            {
                AudioController.LoadContent(Content);

                tileSheet = new VoxelSprite(16, 16, 16);
                LoadVoxels.LoadSprite(Path.Combine(Content.RootDirectory, "tiles.vxs"), ref tileSheet);
                doorSheet = new VoxelSprite(16, 16, 16);
                LoadVoxels.LoadSprite(Path.Combine(Content.RootDirectory, "door.vxs"), ref doorSheet);
                objectSheet = new VoxelSprite(16, 16, 16);
                LoadVoxels.LoadSprite(Path.Combine(Content.RootDirectory, "dynamic.vxs"), ref objectSheet);
            }
            else if (AudioController.instances["roomscrape"].State == SoundState.Playing)
            {
                AudioController.instances["roomscrape"].Pause();
            }

            gameCamera           = new Camera(GraphicsDevice, GraphicsDevice.Viewport);
            particleController   = new ParticleController(GraphicsDevice);
            projectileController = new ProjectileController(GraphicsDevice);
            pickupController     = new PickupController(GraphicsDevice);
            bombController       = new BombController(GraphicsDevice, objectSheet);
            enemyController      = new EnemyController(GraphicsDevice);

            projectileController.LoadContent(Content);
            pickupController.LoadContent(Content);
            enemyController.LoadContent(Content);

            drawEffect = new BasicEffect(GraphicsDevice)
            {
                World              = gameCamera.worldMatrix,
                View               = gameCamera.viewMatrix,
                Projection         = gameCamera.projectionMatrix,
                VertexColorEnabled = true,
            };

            gameHero = new Hero(0, 0, Vector3.Zero, Vector3.Zero);
            gameHero.LoadContent(Content, GraphicsDevice);

            ThreadPool.QueueUserWorkItem(delegate { CreateRoomsAsync(); });

            doorCountdown     = 10000;
            roomMovesLeft     = 0;
            roomShift         = null;
            roomState         = RoomState.DoorsOpen;
            deadTime          = 0;
            allRoomsComplete  = false;
            shownComplete     = false;
            showCompleteTime  = 0;
            showCompleteAlpha = 0f;

            Doors.Clear();
            Doors.Add(new Door(VoxelWorld.ToScreenSpace((7 * 16) + 7, 7, 21) + new Vector3(Voxel.HALF_SIZE, Voxel.HALF_SIZE, Voxel.HALF_SIZE), 0, doorSheet));
            Doors.Add(new Door(VoxelWorld.ToScreenSpace((14 * 16) + 7, (4 * 16) + 7, 21) + new Vector3(Voxel.HALF_SIZE, Voxel.HALF_SIZE, Voxel.HALF_SIZE), 1, doorSheet));
            Doors.Add(new Door(VoxelWorld.ToScreenSpace((7 * 16) + 7, (8 * 16) + 7, 21) + new Vector3(Voxel.HALF_SIZE, Voxel.HALF_SIZE, Voxel.HALF_SIZE), 2, doorSheet));
            Doors.Add(new Door(VoxelWorld.ToScreenSpace(7, (4 * 16) + 7, 21) + new Vector3(Voxel.HALF_SIZE, Voxel.HALF_SIZE, Voxel.HALF_SIZE), 3, doorSheet));

            if (firstRun)
            {
                roomIcon       = Content.Load <Texture2D>("roomicon");
                texHud         = Content.Load <Texture2D>("hud");
                texTitle       = Content.Load <Texture2D>("titlesheet");
                texTitleBG     = Content.Load <Texture2D>("title-bg");
                texStingers    = Content.Load <Texture2D>("stingers");
                font           = Content.Load <SpriteFont>("font");
                timerFontLarge = Content.Load <SpriteFont>("timerfont-large");
                timerFontSmall = Content.Load <SpriteFont>("timerfont-small");
            }

            firstRun = false;
        }