Esempio n. 1
0
 public ReactiveAgentManager(GameManager gameManager, Game game, Camera camera)
 {
     _gameManager = gameManager;
     _game = game;
     _camera = camera;
     _team = 0;
 }
Esempio n. 2
0
 public AgentsManager(GameManager gameManager, Game game, Camera camera)
 {
     _gameManager = gameManager;
     _game = game;
     _camera = camera;
     _team = 0;
 }
Esempio n. 3
0
 public MultiplayerManager(Game game, Camera camera, GameManager gameManager, NetworkSession networkSession)
 {
     _game = game;
     _camera = camera;
     _gameManager = gameManager;
     _networkSession = networkSession;
 }
Esempio n. 4
0
File: Court.cs Progetto: Nesokas/hs
 public Court(Game game, Camera camera, GameManager gameManager)
     : base(game, camera)
 {
     _model = game.Content.Load<Model>(@"Models\court2");
     _effect = game.Content.Load<Effect>(@"Effects\SimpleEffect");
     _gameManager = gameManager;
 }
Esempio n. 5
0
File: Ice.cs Progetto: shadowpt/hs
        public Ice(Game game, Camera camera, GameManager gameManager)
            : base(game, camera)
        {
            _content = game.Content;
            _graphics = game.GraphicsDevice;
            _model = _content.Load<Model>("Models/Plane2");

            _iceEffect = _content.Load<Effect>("Effects/IceEffect");
            _iceEffect.Parameters["IceSurfaceTexture"].SetValue(_content.Load<Texture2D>("Textures/IceSurface2"));

            _playersTrace = _content.Load<Effect>("Effects/PlayersTrace");
            _traceTexture = _content.Load<Texture2D>("Textures/trace");

            _traceFadeEffect = _content.Load<Effect>("Effects/TraceFade");

            _reflectionTarg = new RenderTarget2D(_graphics, _graphics.Viewport.Width, _graphics.Viewport.Height,
                                                false, SurfaceFormat.Color, DepthFormat.Depth24);
            _playersTarget = new RenderTarget2D(_graphics, _graphics.Viewport.Width, _graphics.Viewport.Height,
                                                false, SurfaceFormat.Color, DepthFormat.Depth24);
            _traceFadeTarget = new RenderTarget2D(_graphics, _graphics.Viewport.Width, _graphics.Viewport.Height,
                                                false, SurfaceFormat.Color, DepthFormat.Depth24);

            _traceFadeTexture = new Texture2D(_graphics, _traceFadeTarget.Width, _traceFadeTarget.Height);

            _renderTargetTexture = new Texture2D(_graphics, _playersTarget.Width, _playersTarget.Height);

            Color[] c = new Color[_playersTarget.Width*_playersTarget.Height];
            for(int i = 0; i < c.Length; i++)
                c[i] = Color.Black;
            _traceFadeTexture.SetData<Color>(c);

            _gameManager = gameManager;
            _numPlayers = 0;
            _lastTime = TimeSpan.Zero;
        }
Esempio n. 6
0
 public ParticleManager(GameManager gameManager, Game game, Camera camera, NetworkSession networkSession)
 {
     this.game = game;
     this.camera = camera;
     this.networkSession = networkSession;
     this.gameManager = gameManager;
 }
Esempio n. 7
0
 public Player(GameManager gameManager, Game game, Camera camera, int team, bool isSinglePlayer)
     : base(game, camera)
 {
     _model = game.Content.Load<Model>(@"Models\player");
     _gameManager = gameManager;
     _isSinglePlayer = isSinglePlayer;
     _team = team;
 }
Esempio n. 8
0
File: Disk.cs Progetto: Nesokas/hs
 public Disk(GameManager gameManager, Game game, Camera camera, bool isSinglePlayer)
     : base(game, camera)
 {
     _model = game.Content.Load<Model>(@"Models\disk");
     _game = game;
     _camera = camera;
     _gameManager = gameManager;
     _isSinglePlayer = isSinglePlayer;
 }
Esempio n. 9
0
        public BDIAgent(GameManager gameManager, Game game, Camera camera, int team)
            : base(gameManager, game, camera, team)
        {
            agentBeliefs.hasFoundDisk = false;
            if (team == 1)
                agentBeliefs.teamGoalPosition = _court.getTeam1GoalPosition();
            else if (team == 2)
                agentBeliefs.teamGoalPosition = _court.getTeam2GoalPosition();

            agentsManager = (AgentsManager)gameManager.getGameEntity("agentsManager");

            agentBeliefs.sameTeamPositions = new Dictionary<Agent, Vector3>();
            agentBeliefs.otherTeamPositions = new Dictionary<Agent, Vector3>();
            agentBeliefs.sawAgents = new List<Agent>();

            agentBeliefs.positionToPass = new Vector3(1000, 1000, 1000);

            intention = Intention.SEARCH_DISK;
        }
Esempio n. 10
0
File: Agent.cs Progetto: Nesokas/hs
        public Agent(GameManager gameManager, Game game, Camera camera, int team)
        {
            _player = new Player(gameManager, game, camera, team, true);
            _game = game;
            _camera = camera;
            _fovRotation = 0;
            float x, y, z;
            x = (float)Math.Cos(_fovRotation) * _viewDistance;
            z = (float)Math.Sin(_fovRotation) * _viewDistance;
            y = _player.getPositionVector().Y;
            view = Matrix.CreateLookAt(_player.getPositionVector(), new Vector3(x, y, z), Vector3.Up);

            _farPlane = _viewDistance;

            projection = Matrix.CreatePerspectiveFieldOfView(
                MathHelper.PiOver4,
                (float)game.Window.ClientBounds.Width /
                (float)game.Window.ClientBounds.Height,
                1, _farPlane);

            _fov = new BoundingFrustum(view * projection);

            DebugManager dm = (DebugManager)gameManager.getGameEntity("debugManager");
            dm.registerDebugEntities(this);

            _court = (Court)gameManager.getGameEntity("court");
            _disk = (Disk)gameManager.getGameEntity("disk");

            _boundingSphere = new BoundingSphere(_player.getPositionVector(), 3f);

            _randomGenerator = new Random();
            _direction = Vector2.Zero;
            _direction.Y = -1;

            _player.Initialize();
            _player.LoadContent();

            _team = team;
            _hasShoot = false;

            _lastPositionWithDisk = Vector3.Zero;
        }
Esempio n. 11
0
        public GameplayScreen(NetworkSession networkSession)
        {
            TransitionOnTime = TimeSpan.FromSeconds(1.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);

            _pauseAction = new InputAction(
                new Buttons[] { Buttons.Start, Buttons.Back },
                new Keys[] { Keys.Escape },
                true);

            _propertiesAction = new InputAction(
                new Buttons[] { Buttons.Y },
                new Keys[] { Keys.F1 },
                true);

            _gameManager = null;
            _networkSession = networkSession;

            _isPropertiesWindow = false;
        }
Esempio n. 12
0
        public PropertiesMenuScreen(GameManager gameManager)
            : base("Properties")
        {
            _blurType = new MenuEntry("Normal Blur");
            _blur = new MenuEntry("Blur");
            _iceTransparency = new MenuEntry("Ice Transparecy");
            MenuEntry exit = new MenuEntry("Exit");

            _blurType.Selected += BlurTypeSelected;
            _blur.Selected += BlurSelected;
            _iceTransparency.Selected += TransparacySelected;
            exit.Selected += OnCancel;

            MenuEntries.Add(_blurType);
            MenuEntries.Add(_blur);
            MenuEntries.Add(_iceTransparency);
            MenuEntries.Add(exit);

            _menuSelected = (int)MenuSelected.NONE;
            _gameManager = gameManager;

            _upAction = new InputAction(
                new Buttons[] { Buttons.DPadUp },
                new Keys[] { Keys.Right },
                true);
            _downAction = new InputAction(
                new Buttons[] { Buttons.DPadDown },
                new Keys[] { Keys.Left },
                true);

            _deselectAction = new InputAction(
                new Buttons[] { Buttons.A },
                new Keys[] { Keys.Enter },
                true);

            _ice = (Ice)_gameManager.getGameEntity("ice");
        }
Esempio n. 13
0
 public void addGameManager()
 {
     _gameManager = new GameManager(ScreenManager.Game, _networkSession);
     _gameManager.startGame();
 }