예제 #1
0
        public Level()
        {
            Gravity    = 358.0f;
            this.Score = 0;
            this.Stage = 1;

            Player          = new Player(this, new Vector3(0.5f * (float)(MAP_WIDTH * Tile.SIDE_LENGTH), 0.5f * (float)(MAP_HEIGHT * Tile.SIDE_LENGTH), 50));
            Camera          = new Camera();
            Camera.Position = new Vector2(Tile.SIDE_LENGTH * 4.0f);

            this.PossibleColours = new List <Color>();
            this.PossibleColours.Add(Color.Crimson);
            this.PossibleColours.Add(Color.Orange);
            //this.PossibleColours.Add(Color.Gold); // Too close to orange
            this.PossibleColours.Add(Color.MediumSpringGreen);
            this.PossibleColours.Add(Color.PowderBlue);
            //this.PossibleColours.Add(Color.CornflowerBlue); // Too close to purple
            this.PossibleColours.Add(Color.MediumPurple);
            this.PossibleColours.Add(Color.White);

            Rows = new List <MapRow>();
            for (int y = 0; y < MAP_HEIGHT; ++y)
            {
                MapRow newRow = new MapRow();
                newRow.Columns = new List <Tile>();
                for (int x = 0; x < MAP_WIDTH; ++x)
                {
                    newRow.Columns.Add(new Tile(new Vector2(x * Tile.SIDE_LENGTH, y * Tile.SIDE_LENGTH)));
                }

                Rows.Add(newRow);
            }

            this.Bounds = new Rectangle(0, 0, MAP_WIDTH * Tile.SIDE_LENGTH, MAP_HEIGHT * Tile.SIDE_LENGTH);

            InputManager.Instance.LockMouse();
        }
예제 #2
0
        public Level()
        {
            Gravity = 358.0f;
            this.Score = 0;
            this.Stage = 1;

            Player = new Player(this, new Vector3(0.5f * (float)(MAP_WIDTH * Tile.SIDE_LENGTH), 0.5f * (float)(MAP_HEIGHT * Tile.SIDE_LENGTH), 50));
            Camera = new Camera();
            Camera.Position = new Vector2(Tile.SIDE_LENGTH * 4.0f);

            this.PossibleColours = new List<Color>();
            this.PossibleColours.Add(Color.Crimson);
            this.PossibleColours.Add(Color.Orange);
            //this.PossibleColours.Add(Color.Gold); // Too close to orange
            this.PossibleColours.Add(Color.MediumSpringGreen);
            this.PossibleColours.Add(Color.PowderBlue);
            //this.PossibleColours.Add(Color.CornflowerBlue); // Too close to purple
            this.PossibleColours.Add(Color.MediumPurple);
            this.PossibleColours.Add(Color.White);

            Rows = new List<MapRow>();
            for (int y = 0; y < MAP_HEIGHT; ++y)
            {
                MapRow newRow = new MapRow();
                newRow.Columns = new List<Tile>();
                for (int x = 0; x < MAP_WIDTH; ++x)
                {
                    newRow.Columns.Add(new Tile(new Vector2(x * Tile.SIDE_LENGTH, y * Tile.SIDE_LENGTH)));
                }

                Rows.Add(newRow);
            }

            this.Bounds = new Rectangle(0, 0, MAP_WIDTH * Tile.SIDE_LENGTH, MAP_HEIGHT * Tile.SIDE_LENGTH);

            InputManager.Instance.LockMouse();
        }