//-------------------------------------------------------------------------------------
        // Class constructors

        public PlanetObject(OrbitingSpriteGame game, Vector2 position, Texture2D texture, float size)
            : base(game, position, texture)
        {
            // Set the origin to the center of the planet
            Origin = new Vector2(texture.Width / 2, texture.Height / 2);
            Scale  = new Vector2(size, size);
        }
Пример #2
0
        // Constructor
        public GamePage()
        {
            InitializeComponent();

            _game = XamlGame <OrbitingSpriteGame> .Create("", this);

            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();
        }
        //-------------------------------------------------------------------------------------
        // Class constructors

        public MoonObject(OrbitingSpriteGame game, Texture2D texture, SpriteObject targetObject, float speed, float distance, float size, Color color)
            : base(game, Vector2.Zero, texture)
        {
            // Apply the constructor parameters
            _targetObject = targetObject;
            _speed        = speed;
            _distance     = distance;
            Scale         = new Vector2(size, size);
            SpriteColor   = color;
            // Set the origin to the center of the moon
            Origin = new Vector2(texture.Width / 2, texture.Height / 2);
        }