Exemplo n.º 1
0
        public override void UpdateFrame(float dt)
        {
            if (ticker60Fps.isTime(dt))
            {
                tracker.Update();
                tracker.ChangeCurrentTarget(target.GetPosition());

                nowShootDis += tracker.Speed;
                if (nowShootDis > maxShootDis)
                {
                    HP = 0;
                }
            }

            base.UpdateFrame(dt);
        }
Exemplo n.º 2
0
        public BMissile(Node node,Vector2 pos,BWarship target,float Speed,float rots,float rotsInc,
            float w, float h, WeapRanType wrt, ContactType ctype,float att, string path)
            : base(node,0,0,pos,w,h,ctype,null,null)
        {
            this.Att =att;
            this. Speed = Speed;
            this.target = target;

            body = new SpriteX(path,pos);
            body.ChangeFather(this);
            body.CenterSprite(TRS.Local.Center);
            body.Scale = new Vector2(0.4f,0.4f);

            tracker =new BTracker(body,ref this.Speed,rots,rotsInc);
            tracker.SetTarger(target.GetPosition());

            body.Color = BWarship.ColorID;
            maxShootDis = BWeapon.GetRangeByType(wrt);
        }
Exemplo n.º 3
0
        public BMissile(Node node, Vector2 pos, BWarship target, float Speed, float rots, float rotsInc,
                        float w, float h, WeapRanType wrt, ContactType ctype, float att, string path) :
            base(node, 0, 0, pos, w, h, ctype, null, null)
        {
            this.Att    = att;
            this.Speed  = Speed;
            this.target = target;

            body = new SpriteX(path, pos);
            body.ChangeFather(this);
            body.CenterSprite(TRS.Local.Center);
            body.Scale = new Vector2(0.4f, 0.4f);

            tracker = new BTracker(body, ref this.Speed, rots, rotsInc);
            tracker.SetTarger(target.GetPosition());

            body.Color  = BWarship.ColorID;
            maxShootDis = BWeapon.GetRangeByType(wrt);
        }
Exemplo n.º 4
0
 public Vector2 GetPosition()
 {
     return(mainship.GetPosition());
 }