示例#1
0
        public void LoadContent(ContentManager content, GraphicsDevice gd)
        {
            spriteSheet = new VoxelSprite(16, 16, 16);
            LoadVoxels.LoadSprite(Path.Combine(content.RootDirectory, "dude.vxs"), ref spriteSheet);

            drawEffect = new BasicEffect(gd)
            {
                VertexColorEnabled = true
            };
        }
示例#2
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");
        }
示例#3
0
        public void LoadContent(ContentManager content)
        {
            VoxelSprite manhack = new VoxelSprite(16, 16, 16);

            LoadVoxels.LoadSprite(Path.Combine(content.RootDirectory, "enemies", "manhack.vxs"), ref manhack);
            spriteSheets.Add("Manhack", manhack);

            VoxelSprite sentinel = new VoxelSprite(16, 16, 16);

            LoadVoxels.LoadSprite(Path.Combine(content.RootDirectory, "enemies", "sentinel.vxs"), ref sentinel);
            spriteSheets.Add("Sentinel", sentinel);

            VoxelSprite head = new VoxelSprite(16, 16, 16);

            LoadVoxels.LoadSprite(Path.Combine(content.RootDirectory, "enemies", "head.vxs"), ref head);
            spriteSheets.Add("Head", head);

            VoxelSprite ooze = new VoxelSprite(16, 16, 16);

            LoadVoxels.LoadSprite(Path.Combine(content.RootDirectory, "enemies", "ooze.vxs"), ref ooze);
            spriteSheets.Add("Ooze", ooze);
        }
示例#4
0
 public void LoadContent(ContentManager content)
 {
     projectileStrip = new VoxelSprite(5, 5, 5);
     LoadVoxels.LoadSprite(Path.Combine(content.RootDirectory, "projectiles.vxs"), ref projectileStrip);
 }
示例#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;
        }
示例#6
0
 public void LoadContent(ContentManager content)
 {
     pickupStrip = new VoxelSprite(16, 16, 16);
     LoadVoxels.LoadSprite(Path.Combine(content.RootDirectory, "dynamic.vxs"), ref pickupStrip);
 }