Esempio n. 1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
Esempio n. 2
0
        public AnimationComponent(int ownerID)
            : base(ownerID, Vector2.Zero, 0, 0, null)
        {
            _game1 = Game1.Instance;

            _startFrameX = 0;
            _startFrameY = 0;

            _framePlayLength = 0.0f; // How long we stay on each frame, ie how fast it plays.
            _frameTimer = 0.0f; // How long the current frame has been playing.

            _playCount = 0;
            _playCountMax = 0;

            _numberOfFrames = 0;

            _reverse = false;

            _currentFrame = 0;

            _continuous = false;

            _isRunning = false;

            _name = null;
        }
Esempio n. 3
0
        public Game1()
        {
            _graphics = new GraphicsDeviceManager(this);
            _graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);

            Content.RootDirectory = "Content";

            Instance = this;
        }
Esempio n. 4
0
        public AnimationComponent( int ownerID, int startX, int startY, double playLength, int playMax, int numberOfFrames, bool reverse, string name,
            Vector2 position, int width, int height, Texture2D texture, bool isRunning = false, bool continuous = false, bool glow = false,
            Nullable<Color> tint = null, float rotation = 0.0f, Nullable<Vector2> origin = null,
            float scale = 1.0f, SpriteEffects spriteEffect = SpriteEffects.None, float layer = 1.0f)
            : base(ownerID, position, width, height, texture, null, glow, tint, rotation, origin, scale, spriteEffect, layer)
        {
            // Start Constructor.

            _game1 = Game1.Instance;

            _startFrameX = startX;
            _startFrameY = startY;

            _framePlayLength = playLength; // How long we stay on each frame, ie how fast it plays.
            _frameTimer = 0.0f; // How long the current frame has been playing.

            _playCount = 0;
            _playCountMax = playMax;

            _numberOfFrames = numberOfFrames;

            _reverse = reverse;

            if (reverse)
            {
                _currentFrame = _numberOfFrames - 1;
            }
            else
            {
                _currentFrame = 0;
            }

            _continuous = continuous;

            _isRunning = isRunning;

            _name = name;
        }