Esempio n. 1
0
        void CustomActivity(bool firstTimeCalled)
        {
            PlayerCharacterInstance.CollideAgainst(() => mTileSolidCollision.CollideAgainstSolid(PlayerCharacterInstance.Collision), false);

            //this.PlayerCharacterInstance.CollideAgainst(SolidCollisions);
            this.PlayerCharacterInstance.DetermineMovementValues();
            Camera.Main.X = PlayerCharacterInstance.X;


            Cursor cursor = GuiManager.Cursor;

            if (cursor.PrimaryClick)
            {
                float x = cursor.WorldXAt(0);
                float y = cursor.WorldYAt(0);

                if (mTileSolidCollision.GetTileAt(x, y) == null)
                {
                    mTileSolidCollision.AddCollisionAtWorld(x, y);
                }
                else
                {
                    mTileSolidCollision.RemoveCollisionAtWorld(x, y);
                }
            }
        }
Esempio n. 2
0
        void CustomInitialize()
        {
            FlatRedBallServices.Game.IsMouseVisible = true;

            Camera.Main.OrthogonalHeight /= 2.0f;
            Camera.Main.FixAspectRatioYConstant();

            FlatRedBallServices.GraphicsOptions.TextureFilter = Microsoft.Xna.Framework.Graphics.TextureFilter.Point;

            Visuals.Shift(new Vector3(0, 400, 0));



            mTileSolidCollision          = new TileShapeCollection();
            mTileSolidCollision.GridSize = 16;
            mTileSolidCollision.Visible  = true;

            foreach (var sprite in Visuals.Sprites)
            {
                if (sprite.Name == "CollisionTile")
                {
                    mTileSolidCollision.AddCollisionAtWorld(sprite.X, sprite.Y);
                }
            }



            PlayerCharacterInstance.X = 32;
            PlayerCharacterInstance.Y = 80;

            Camera.Main.OrthogonalHeight *= 1;
            Camera.Main.FixAspectRatioYConstant();
            Camera.Main.Y = 100;
        }
Esempio n. 3
0
        void CustomInitialize()
        {
            mCollision          = new TileShapeCollection();
            mCollision.GridSize = 32;
            mCollision.Visible  = true;

            for (int i = 0; i < 10; i++)
            {
                mCollision.AddCollisionAtWorld(i * 32 + 16, 16);
            }
        }