Exemplo n.º 1
0
 public virtual void Attach(GameObject gameObject)
 {
     this.gameObject = gameObject;
     if (gameObject is AnimatedGameObject)
     {
         animatedGameObject = (AnimatedGameObject)gameObject;
     }
 }
Exemplo n.º 2
0
        public override GameObject Create(string type, Vector2 startPos)
        {
            AnimatedGameObject g = new AnimatedGameObject(10, 10);

            switch (type)
            {
            case "Player":

                g.AddComponent(new SpriteRenderer("cat_fighter_sprite"));
                g.AddComponent(new Collider());
                g.AddComponent(Player.Instance);
                g.AddComponent(new Gravity());
                //g.LoadContent(Content);
                break;
            }

            g.Transform.Position = startPos;
            return(g);
        }