コード例 #1
0
 public void Setup()
 {
     _player1 = new Player(null, "Player 1", CanonicalString.Null, CanonicalString.Null, CanonicalString.Null, new UI.PlayerControls());
     _player2 = new Player(null, "Player 2", CanonicalString.Null, CanonicalString.Null, CanonicalString.Null, new UI.PlayerControls());
     _arena = new Arena();
     _source = new Gob { ID = 1, Owner = _player1, MaxDamageLevel = 100, Arena = _arena, Pos = Vector2.Zero };
     _hostileGob1 = new Gob { ID = 2, Owner = _player2, MaxDamageLevel = 100, Arena = _arena };
     _hostileGob2 = new Gob { ID = 3, Owner = _player2, MaxDamageLevel = 100, Arena = _arena };
     _neutralGob = new Gob { ID = 4, Owner = null, MaxDamageLevel = 100, Arena = _arena };
     _friendlyGob = new Gob { ID = 5, Owner = _player1, MaxDamageLevel = 100, Arena = _arena };
     _targetSelector = new TargetSelector(700);
 }
コード例 #2
0
ファイル: Rocket.cs プロジェクト: vvnurmi/assaultwing
 public override void Activate()
 {
     base.Activate();
     _thruster.Activate(this);
     _targetSelector = new TargetSelector(_findTargetRange) { AngleWeight = 5 };
     _thrustEndTime = Arena.TotalTime + TimeSpan.FromSeconds(_thrustDuration);
     // Avoid choosing the initial target on the first frame. This helps the case
     // where the rocket was shot from the owner's position (when the owner doesn't
     // have weapon barrels marked in its 3D model). Otherwise the rocket will
     // target the owner because it's so close.
     _nextFindTarget = Arena.TotalTime + TimeSpan.FromSeconds(0.1);
 }