Beispiel #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);
        }
Beispiel #2
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;
        }