Example #1
0
        //-------------------------------------------------------------------------------------
        // 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);
        }
        public GamePage(string launchArguments)
        {
            this.InitializeComponent();

            // Create the game.
            _game = XamlGame <OrbitingSpriteGame> .Create(launchArguments, Window.Current.CoreWindow, this);
        }
Example #3
0
        //-------------------------------------------------------------------------------------
        // 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);
        }