Exemple #1
0
        public static void renderSpineEntities(Matrix camera, List <Entity> entList, Entity cameraEntity, TileMap map, ParticleSet set, List <MutantAcidSpitter> spitters)
        {
            skeletonRenderer.setCameraMatrix(camera);
            skeletonRenderer.Begin();

            skeletonRenderer.DrawSpriteToSpineVertexArray(Game1.whitePixel, new Rectangle(0, 0, 1, 1), new Vector2(cameraEntity.CenterPoint.X - GlobalGameConstants.GameResolutionWidth / 2, cameraEntity.CenterPoint.Y - GlobalGameConstants.GameResolutionHeight / 2), Color.Black, 0.0f, new Vector2(GlobalGameConstants.GameResolutionWidth, GlobalGameConstants.GameResolutionHeight));

            map.renderSPINEBATCHTEST(skeletonRenderer, 0.5f, spitters);

            for (int i = 0; i < entList.Count; i++)
            {
                if (Vector2.Distance(cameraEntity.Position, entList[i].Position) > (GlobalGameConstants.GameResolutionWidth * 0.75f))
                {
                    continue;
                }

                entList[i].draw(skeletonRenderer);

                if (entList[i] is SpineEntity)
                {
                    ((SpineEntity)entList[i]).spinerender(skeletonRenderer);
                }
            }

            set.drawSpineSet(skeletonRenderer, cameraEntity.Position, 0.5f);

            skeletonRenderer.End();
        }
        private void loadLevel()
        {
            for (int i = 0; i < GameCampaign.CampaignIntroductionValues[GameCampaign.PlayerLevelProgress].Length; i++)
            {
                GameCampaign.AvailableEntityTypes.Add(GameCampaign.CampaignIntroductionValues[GameCampaign.PlayerLevelProgress][i]);
            }

            nodeMap = generateFourDungeons();
            //nodeMap = DungeonGenerator.generateEntityZoo();
            map = new TileMap(this, nodeMap, GlobalGameConstants.TileSize);

            string tileSetName = "deathStar";

            if (GameCampaign.PlayerFloorHeight == 0)
            {
                tileSetName = "hightech";
            }
            if (GameCampaign.PlayerFloorHeight == 1)
            {
                tileSetName = "factory";
            }
            if (GameCampaign.PlayerFloorHeight == 2)
            {
                tileSetName = "prisoncell";
            }

            map.TileSkin[0] = TextureLib.getLoadedTexture(tileSetName + "/0.png");
            map.TileSkin[1] = TextureLib.getLoadedTexture(tileSetName + "/1.png");
            map.TileSkin[2] = TextureLib.getLoadedTexture(tileSetName + "/2.png");
            map.TileSkin[3] = TextureLib.getLoadedTexture(tileSetName + "/3.png");

            map.ElevatorRoomSkin = TextureLib.getLoadedTexture("elevator/0.png");

            Thread.Sleep(250);

            endFlagReached = false;

            gui       = new InGameGUI(this);
            keyModule = new LevelKeyModule();

            particleSet = new ParticleSet();

            Thread.Sleep(250);

            entityList   = new List <Entity>();
            acidSpitters = new List <MutantAcidSpitter>();

            coinPool      = new Coin[coinPoolSize];
            freeCoinIndex = 0;
            for (int i = 0; i < coinPoolSize; i++)
            {
                coinPool[i] = new Coin(this, new Vector2(-100, -100));
                entityList.Add(coinPool[i]);
            }

            Thread.Sleep(250);

            populateRooms(nodeMap, currentSeed);

            Thread.Sleep(250);

            for (int i = 0; i < entityList.Count; i++)
            {
                if (entityList[i] is Player && ((Player)entityList[i]).Index == InputDevice2.PPG_Player.Player_1)
                {
                    cameraFocus = entityList[i];
                }
            }

            fadeOutTime = 0.0f;

            elapsedLevelTime  = 0.0f;
            elapsedCoinAmount = 0;

            player1Dead     = false;
            end_flag_placed = false;

            BackGroundAudio.playSong("RPG Game", true);
            BackGroundAudio.changeVolume(1.0f);

            state = LoadingState.LevelRunning;
        }