示例#1
0
 public Chicken(string name, Tranform.Position position) : base()
 {
     this.tag                    = "chicken";
     this.name                   = name;
     this.mask                   = new Bitmap(HungTrung.Properties.Resources.chicken);
     this.tranform               = new Tranform();
     this.tranform.position      = position;
     this.rigitbody              = new Rigidbody(this);
     this.rigitbody.isColision   = false;
     this.rigitbody.isKinematic  = false;
     this.rigitbody.isUseGravity = false;
     this.rigitbody.Start();
 }
示例#2
0
        protected Eggs(Chicken chicken)
        {
            this.chicken  = chicken;
            this.tag      = "egg";
            this.tranform = new Tranform();
            Tranform.Position startPos = new Tranform.Position(chicken.tranform.position.X + chicken.mask.Width / 2, chicken.tranform.position.Y + chicken.mask.Height);
            this.tranform.position = startPos;


            this.rigitbody              = new Rigidbody(this);
            this.rigitbody.isColision   = true;
            this.rigitbody.isKinematic  = false;
            this.rigitbody.isUseGravity = true;

            this.rigitbody.colider = new Colider(this.rigitbody);
            this.rigitbody.colider.OnHitColision += Colider_OnHitColision;
        }