Beispiel #1
0
 public void addReactiveAgent()
 {
     ReactiveAgent ra = new ReactiveAgent(_gameManager, _game, _camera, _team + 1);
     playerList.Add(ra);
     Thread playerThread = new Thread(new ParameterizedThreadStart(ra.update));
     playerThreads.Add(ra, playerThread);
     _team = (_team + 1) % 2;
 }
Beispiel #2
0
 /* -------------------------- AGENTS --------------------------- */
 public void newPlayerWithDisk(ReactiveAgent player)
 {
     player.removePlayerDisk();
     _playerWithDisk = player;
 }
Beispiel #3
0
 // Direction coordinates must be beetween 0 and 1
 public void shoot(Vector2 direction)
 {
     displayState.Velocity = direction*_maxVelocity*5;
     _playerWithDisk = null;
 }
Beispiel #4
0
 public bool sameTeam(ReactiveAgent agent)
 {
     if(agent != null)
         return agent.getTeam() == _team;
     return false;
 }