예제 #1
0
 public GameplayScreen(String name)
 {
     HumanReadableName = name;
     TransitionOnTime = TimeSpan.FromSeconds(1.5);
     TransitionOffTime = TimeSpan.FromSeconds(0.5);
     gWorld = new gameWorld(new Vector2(0,20), MeterInPixels, 10000f, 5000f);
 }
예제 #2
0
        /// <summary>
        /// Intializes the Demo Level
        /// Takes in gameWorld which is an instance of "gameWorld"
        /// content is the content manager from gameplayscreen
        /// screencenter is the center of the screen
        /// </summary>
        /// <param name="gameWorld"></param>
        /// <param name="content"></param>
        /// <param name="_screenCenter"></param>
        public DemoLevel(gameWorld gameWorld, ContentManager content, Vector2 _screenCenter)
        {
            // get the world
            gWorld = gameWorld;

            #region staticObjects

            //First/Starting ground/level
            float w = 5505f; // THIS IS PIXELS - GETS CONVERTED IN STATIC OBJECT
            float wHalf = (5505f / gWorld.MeterInPixels) / 2;
            float viewX = _screenCenter.X / gWorld.MeterInPixels;
            float offset = wHalf - viewX;

            _startGround = new staticObject(content.Load<Texture2D>("groundSprite"),
                (_screenCenter / gWorld.MeterInPixels) + new Vector2(offset, 1.25f),
                gWorld._world,
                gWorld.MeterInPixels,
                true,
                0.3f,
                0.5f,
                w,
                58f,
                1f,
                "ground");

            // MidAir Object (?)
            _midAirObject = new staticObject(content.Load<Texture2D>("stoneSprite"),
                (_screenCenter / gWorld.MeterInPixels) + new Vector2(.89f, 0),
                gWorld._world,
                gWorld.MeterInPixels,
                true,
                0.3f,
                0.5f,
                10f,
                5f,
                1f,
                "ground-wall");

            // Ground Object (?)
            _groundObject = new staticObject(content.Load<Texture2D>("stoneSprite"),
                (_screenCenter / gWorld.MeterInPixels) + new Vector2(-2.5f, 0.75f),
                gWorld._world,
                gWorld.MeterInPixels,
                true,
                0.3f,
                0.5f,
                10f,
                5f,
                1f,
                "ground");

            #endregion
        }