Пример #1
0
        public void Initialize(CavemanRunner game, Texture2D texture, Vector2 velocity, int mass,
            bool isStatic = false, Renderer.AnchorPoint anchor = Renderer.AnchorPoint.Center)
        {
            physics = new Physics(mass, isStatic, velocity);
            physics.Initialize(this);

            this.Initialize(game, texture, anchor);
        }
Пример #2
0
        public void Initialize(Renderer renderer, Texture2D texture, int frameWidth, int frameHeight, int frameCount, int frametime, Color color, float scale, bool looping, bool tieToTempo)
        {
            // Keep a local copy of the values passed in
            this.renderer = renderer;
            this.color = color;
            this.FrameWidth = frameWidth;
            this.FrameHeight = frameHeight;
            this.frameCount = frameCount;
            this.frameTime = originalFrameTime = frametime;
            this.scale = scale;

            Looping = looping;
            spriteStrip = texture;
            TieToTempo = tieToTempo;

            // Set the time to zero
            elapsedTime = 0;
            currentFrame = 0;

            // Set the Animation to active by default
            Active = true;
        }
Пример #3
0
        public void Initialize(CavemanRunner game, Texture2D texture, Renderer.AnchorPoint anchor)
        {
            this.game = game;

            collider = new Collider();
            collider.Bounds = texture.Bounds;

            renderer = new Renderer();
            renderer.Texture = texture;
            renderer.Initialize(this, anchor);

            collider.Initialize(this);

            if(physics == null)
            {
                physics = new Physics();
                physics.Initialize(this);
            }

            transform = new Transform(this);

            spriteBatch = game.spriteBatch;
        }
Пример #4
0
 public void Initialize(CavemanRunner game, Texture2D[] textureArray, Vector2 velocity, int mass,
     bool isStatic = false, Renderer.AnchorPoint anchor = Renderer.AnchorPoint.Center)
 {
     textures = new Texture2D[textureArray.Length];
     this.Initialize(game, textures[0], anchor);
 }
Пример #5
0
 public void Initialize(CavemanRunner game, Texture2D texture, Renderer.AnchorPoint anchor)
 {
     base.Initialize(game, texture, anchor);
 }