예제 #1
0
        public PlayerLayer(CollisionManager collMgr, DrawManager drawMgr, TimeManager timeMgr)
            : base(collMgr, drawMgr, timeMgr)
        {
            backdrop = new Sprite(ContentLoader.Content.Load<Texture2D>(Assets.TOP_DOWN_FIELD));
            backdrop.Scale = new Vector2(5, 5);
            Add(backdrop);

            player = new SmileyWalkDude();
            player.Position = new Vector2(300, 300);
            player.Scale = new Vector2(3, 3);
            Add(player);
        }
예제 #2
0
        private void SetUpWorldObjects()
        {
            // get user input object
            Input = new InputManager();
            Input.AddBinding(PAUSE, Keys.Escape);
            Input.AddBinding(TOGGLE_OFFSET, Keys.T);
            Add(Input);

            // create the center marker
            CenterMarker = new Sprite(ContentLoader.Content.Load<Texture2D>("ItemGlimer"));
            CenterMarker.Center();
            CenterMarker.Scale = new Vector2(0.1f, 0.1f);
            CenterMarker.Position = new Vector2(1920 / 2, 1080 / 2);
            CenterMarker.Color = Color.Red;
            Add(CenterMarker);

            // create the center colliders
            centerCircleCollider = new CircleCollider(100);
            centerCircleCollider.WireFrame = WireFrames.CircleWireFrame(centerCircleCollider.Bounds);
            centerCircleCollider.Position = new Vector2(1920 / 2, 1080 / 2);
            Add(centerCircleCollider);
            centerBoxCollider = new BoxCollider(new Point(200, 200));
            centerBoxCollider.WireFrame = WireFrames.BoxWireFrame(centerBoxCollider.Bounds);
            centerBoxCollider.Position = new Vector2(1920 / 2, 1080 / 2);
            centerBoxCollider.Center();
            //Add(centerBoxCollider);

            // create the screen size marker
            ScreenSizeMarker = new Sprite(ContentLoader.Content.Load<Texture2D>("ItemGlimer"));
            ScreenSizeMarker.Center();
            ScreenSizeMarker.Scale = new Vector2(0.1f, 0.1f);
            ScreenSizeMarker.Position = new Vector2(1920, 1080);
            ScreenSizeMarker.Color = Color.Red;
            Add(ScreenSizeMarker);

            // create smiley
            smiley = new SmileyWalkDude();
            smiley.Position = new Vector2(1920 / 4, 1080 / 4);
            Add(smiley);

            // create the instruction text
            instructions = new InstructionText("Move the Character off of the screen to continue.");
            instructions.Position = new Vector2(200, 50);
            instructions.DrawOrder = 1;
            Add(instructions);

            // create the outerBounds
            Point size = new Point(1920 - 10, 1080 - 10);
            outerBounds = new Corral(size, smiley);
            outerBounds.Position = new Vector2(5, 5);
            Add(outerBounds);
        }