Example #1
0
 public TankSinTur(string name, GameObjInfo objInfo, string texPath, GameObjData skinData,
                   float raderLength, float raderAng, Color raderColor, float raderAzi,
                   float maxForwardSpeed, float maxBackwardSpeed, float maxRotaSpeed,
                   float maxTurretRotaSpeed, float maxRaderRotaSpeed, float fireCDTime,
                   Vector2 pos, float baseRota, float turretRota)
 {
     this.name    = name;
     this.objInfo = objInfo;
     this.skin    = new TankSkinSinTur(new TankSkinSinTurData(texPath, skinData));
     skin.Initial(pos, baseRota, turretRota);
     controller            = new TankContrSinTur(objInfo, new Sprite[] { skin.Sprites[0] }, pos, baseRota, maxForwardSpeed, maxBackwardSpeed, maxRotaSpeed, maxTurretRotaSpeed, maxRaderRotaSpeed, Math.Max(0, fireCDTime));
     colChecker            = controller;
     phisicalUpdater       = controller;
     controller.onShoot   += new EventHandler(controller_onShoot);
     controller.OnCollied += new OnCollidedEventHandler(controller_OnCollied);
     controller.OnOverlap += new OnCollidedEventHandler(controller_OnOverlap);
     rader = new Rader(raderAng, raderLength, pos, raderAzi + baseRota, raderColor);
 }
Example #2
0
 public TankSinTur(string name, GameObjInfo objInfo, string texPath, GameObjData skinData,
     float raderLength, float raderAng, Color raderColor, float raderAzi,
     float maxForwardSpeed, float maxBackwardSpeed, float maxRotaSpeed,
     float maxTurretRotaSpeed, float maxRaderRotaSpeed, float fireCDTime,
     Vector2 pos, float baseRota, float turretRota)
 {
     this.name = name;
     this.objInfo = objInfo;
     this.skin = new TankSkinSinTur(new TankSkinSinTurData(texPath, skinData));
     skin.Initial(pos, baseRota, turretRota);
     controller = new TankContrSinTur(objInfo, new Sprite[] { skin.Sprites[0] } , pos, baseRota, maxForwardSpeed, maxBackwardSpeed, maxRotaSpeed, maxTurretRotaSpeed, maxRaderRotaSpeed, Math.Max(0, fireCDTime));
     colChecker = controller;
     phisicalUpdater = controller;
     controller.onShoot += new EventHandler(controller_onShoot);
     controller.OnCollied += new OnCollidedEventHandler(controller_OnCollied);
     controller.OnOverlap += new OnCollidedEventHandler(controller_OnOverlap);
     controller.posAziChanged += new SmartTank.PhiCol.NonInertiasPhiUpdater.PosAziChangedEventHandler(controller_OnPosAziChanged);
     rader = new Rader(raderAng, raderLength, pos, raderAzi + baseRota, raderColor);
 }