예제 #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="graphicsDevice">GraphicsDevice instance</param>
 /// <param name="gameModel">Game model instance</param>
 public Camera(GraphicsDevice graphicsDevice, Model.GameModel gameModel)
 {
     this._viewPort   = graphicsDevice.Viewport;
     this._mapView    = graphicsDevice.Viewport.Bounds;
     this._currentMap = gameModel.CurrentMap;
     this._player     = gameModel.PlayerSystem.Player;
 }
 //Constructor
 public UnitView(Model.GameModel m_gameModel, Camera a_camera, SmokeSystem m_smokeSystem, AnimationSystem a_animationSystem, GraphicsDevice a_graphicsDevice)
 {
     this.m_gameModel       = m_gameModel;
     this.m_smokeSystem     = m_smokeSystem;
     this.m_animationSystem = a_animationSystem;
     this.m_camera          = a_camera;
 }
 //Constructor
 public Camera(GraphicsDevice a_graphicsDevice, Model.GameModel a_gameModel)
 {
     this.m_viewPort   = a_graphicsDevice.Viewport;
     this.m_mapView    = a_graphicsDevice.Viewport.Bounds;
     this.m_currentMap = a_gameModel.CurrentMap;
     this.m_player     = a_gameModel.Player;
 }
예제 #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="spriteBatch">SpriteBatch instance</param>
 /// <param name="gameModel">Game model instance</param>
 /// <param name="camera">Camera instance</param>
 /// <param name="inputHandler">InputHandler instance</param>
 public Dialog(SpriteBatch spriteBatch, Model.GameModel gameModel, Camera camera, View.InputHandler inputHandler)
 {
     this._spriteBatch  = spriteBatch;
     this._dialogueList = new List <Dialogue>();
     this._questSystem  = gameModel.QuestSystem;
     this._camera       = camera;
     this._inputHandler = inputHandler;
 }
예제 #5
0
 public Conversation(SpriteBatch a_spriteBatch, Model.GameModel a_gameModel, Camera a_camera, View.InputHandler a_inputHandler)
 {
     this.m_spriteBatch  = a_spriteBatch;
     this.m_dialogueList = new List <Dialogue>();
     this.m_questSystem  = a_gameModel.m_questSystem;
     this.m_camera       = a_camera;
     this.m_inputHandler = a_inputHandler;
 }
 //Constructor
 public ItemView(Model.GameModel a_gameModel, Camera a_camera, AnimationSystem a_animationSystem)
 {
     this.m_player          = a_gameModel.Player;
     this.m_level           = a_gameModel.TMXLevel;
     this.m_camera          = a_camera;
     this.m_animationSystem = a_animationSystem;
     this.m_trampolineWatch = new Stopwatch();
 }
예제 #7
0
 public GameView(GraphicsDevice a_graphicsDevice, SpriteBatch a_spriteBatch, Model.GameModel a_gameModel, View.AnimationSystem a_animationSystem, View.InputHandler a_inputHandler, View.SoundHandler a_soundHandler)
 {
     this.m_gameModel       = a_gameModel;
     this.m_camera          = new Camera(a_graphicsDevice, a_gameModel);
     this.m_spriteBatch     = a_spriteBatch;
     this.m_soundHandler    = a_soundHandler;
     this.m_inputHandler    = a_inputHandler;                                                                                        //Hantering av samtliga anv-inputs
     this.m_animationSystem = a_animationSystem;                                                                                     //System för sprite-animationer
     this.m_conversation    = new Conversation(m_spriteBatch, m_gameModel, m_camera, m_inputHandler);                                //Behandlar/ritar dialogtexter
     this.m_UIView          = new UIView(m_spriteBatch, m_camera, m_inputHandler, a_gameModel, m_conversation);                      //Utritning av user-interface
     this.m_unitView        = new UnitView(m_gameModel, m_spriteBatch, m_camera, m_inputHandler, m_animationSystem, m_conversation); //Utritning av samtliga units
 }
예제 #8
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="graphicsDevice">GraphicsDevice instance</param>
 /// <param name="spriteBatch">SpriteBatch instance</param>
 /// <param name="gameModel">GameModel instance</param>
 /// <param name="animationSystem">AnimationSystem instance</param>
 /// <param name="inputHandler">InputHandler instance</param>
 /// <param name="soundHandler">SoundHandler instance</param>
 public GameView(GraphicsDevice graphicsDevice, SpriteBatch spriteBatch, Model.GameModel gameModel, View.AnimationSystem animationSystem, View.InputHandler inputHandler, View.SoundHandler soundHandler)
 {
     this._gameModel       = gameModel;
     this._camera          = new Camera(graphicsDevice, gameModel);
     this._spriteBatch     = spriteBatch;
     this._soundHandler    = soundHandler;
     this._inputHandler    = inputHandler;
     this._animationSystem = animationSystem;
     this._conversation    = new Dialog(spriteBatch, _gameModel, _camera, _inputHandler);
     this._UIView          = new UIView(spriteBatch, _camera, _inputHandler, gameModel, _conversation);
     this._unitView        = new UnitView(_gameModel, spriteBatch, _camera, _inputHandler, _animationSystem, _conversation);
 }
예제 #9
0
 public UnitView(Model.GameModel a_gameModel, SpriteBatch a_spriteBatch, Camera a_camera, InputHandler a_inputHandler, AnimationSystem a_animationSystem, View.Conversation a_conversation)
 {
     this.m_player          = a_gameModel.m_playerSystem.m_player;
     this.m_enemies         = a_gameModel.m_enemySystem.m_enemies;
     this.m_deadEnemies     = a_gameModel.m_enemySystem.m_spawnList;
     this.m_friends         = a_gameModel.m_friendSystem.m_friends;
     this.m_questSystem     = a_gameModel.m_questSystem;
     this.m_camera          = a_camera;
     this.m_spriteBatch     = a_spriteBatch;
     this.m_inputHandler    = a_inputHandler;
     this.m_animationSystem = a_animationSystem;
     this.m_conversation    = a_conversation;
 }
예제 #10
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="gameModel">GameModel instance</param>
 /// <param name="spriteBatch">SpriteBatch instance</param>
 /// <param name="camera">Camera instance</param>
 /// <param name="inputHandler">InputHandler instance</param>
 /// <param name="animationSystem">AnimationSystem instance</param>
 /// <param name="dialog">Dialog instance</param>
 public UnitView(Model.GameModel gameModel, SpriteBatch spriteBatch, Camera camera, InputHandler inputHandler, AnimationSystem animationSystem, View.Dialog dialog)
 {
     this._player              = gameModel.PlayerSystem.Player;
     this._enemies             = gameModel.EnemySystem.Enemies;
     this._deadEnemies         = gameModel.EnemySystem.SpawnList;
     this._nonPlayerCharacters = gameModel.NpcSystem.NonPlayerCharacters;
     this._questSystem         = gameModel.QuestSystem;
     this._camera              = camera;
     this._spriteBatch         = spriteBatch;
     this._inputHandler        = inputHandler;
     this._animationSystem     = animationSystem;
     this._conversation        = dialog;
 }
예제 #11
0
 //Constructor
 public GameView(Model.GameModel a_gameModel, InputHandler a_inputHandler, SpriteBatch a_spriteBatch, GraphicsDevice a_graphicsDevice)
 {
     this.m_smokeSystem     = new SmokeSystem();
     this.m_animationSystem = new AnimationSystem(a_spriteBatch);
     this.m_gameModel       = a_gameModel;
     this.m_spriteBatch     = a_spriteBatch;
     this.m_graphicsDevice  = a_graphicsDevice;
     this.m_inputHandler    = a_inputHandler;
     this.m_camera          = new Camera(a_graphicsDevice, a_gameModel);
     this.m_graphicView     = new GraphicView(a_graphicsDevice, m_camera);
     this.m_unitView        = new UnitView(m_gameModel, m_camera, m_smokeSystem, m_animationSystem, a_graphicsDevice);
     this.m_uIView          = new UIView(m_gameModel, m_camera, m_animationSystem);
     this.m_itemView        = new ItemView(m_gameModel, m_camera, m_animationSystem);
 }
예제 #12
0
        protected override void LoadContent()
        {
            LoadTMXMaps(Content);//Loading all the TMX maps
            m_spriteBatch = new SpriteBatch(GraphicsDevice);

            //Debugging tools, showing FPS and other relevant information. Press X while debugging to enable
            #region PerformanceTool
            //m_performanceTool = new PerformanceUtility.PerformanceUtility(m_graphics, this);
            //m_performanceTool.LoadContent(Content, m_spriteBatch);
            #endregion

            //Initializing the games main MVC classes
            m_gameModel      = new Model.GameModel(m_TMXMaps);
            m_inputHandler   = new View.InputHandler();
            m_gameView       = new View.GameView(m_gameModel, m_inputHandler, m_spriteBatch, GraphicsDevice);
            m_gameController = new GameController(m_gameModel, m_gameView);

            m_gameView.LoadContent(Content);
        }
예제 #13
0
        protected override void LoadContent()
        {
            m_spriteBatch = new SpriteBatch(GraphicsDevice);
            m_gameModel   = new Model.GameModel(Content);

            //Klasser som medskickas till samtliga controller-klasser
            m_inputHandler    = new View.InputHandler();
            m_animationSystem = new View.AnimationSystem(m_spriteBatch);
            m_soundHandler    = new View.SoundHandler(m_inputHandler);
            m_soundHandler.LoadContent(Content);

            //Controllers
            m_screenController = new ScreenController(m_gameModel, m_spriteBatch, m_animationSystem, m_inputHandler, m_soundHandler);
            m_gameController   = new GameController(GraphicsDevice, m_spriteBatch, m_gameModel, m_animationSystem, m_inputHandler, m_soundHandler);

            m_gameController.LoadContent(Content);
            m_screenController.LoadScreenContent(Content);

            //Initsierar renderingsobjekt för TMX filer(map-filer)
            Map.InitObjectDrawing(GraphicsDevice);
        }
        /// <summary>
        /// Loading game engine, controller and view.
        /// Loading all needed class instances.
        /// </summary>
        protected override void LoadContent()
        {
            _spriteBatch     = new SpriteBatch(GraphicsDevice);
            _performanceTool = new PerformanceUtility.PerformanceUtility(_graphics, this);
            _performanceTool.LoadContent(Content, _spriteBatch);
            _gameModel = new Model.GameModel(Content);

            //Classes needed for all controller classes (GameController and ScreenController)
            _inputHandler    = new View.InputHandler();
            _animationSystem = new View.AnimationSystem(_spriteBatch);
            _soundHandler    = new View.SoundHandler(_inputHandler);
            _soundHandler.LoadContent(Content);

            //Controllers
            _screenController = new ScreenController(_gameModel, _spriteBatch, _animationSystem, _inputHandler, _soundHandler);
            _gameController   = new GameController(GraphicsDevice, _spriteBatch, _gameModel, _animationSystem, _inputHandler, _soundHandler);

            _gameController.LoadContent(Content);
            _screenController.LoadScreenContent(Content);

            //Initializing renderingobject for TMX files (map-files).
            Map.InitObjectDrawing(GraphicsDevice);
        }
 //Constructor
 public UIView(Model.GameModel m_gameModel, Camera m_camera, AnimationSystem a_animationSystem)
 {
     this.m_gameModel       = m_gameModel;
     this.m_camera          = m_camera;
     this.m_animationSystem = a_animationSystem;
 }
        public UIView(SpriteBatch a_spriteBatch, Camera a_camera, InputHandler a_inputHandler, Model.GameModel a_gameModel, Conversation a_conversation)
        {
            this.m_spriteBatch  = a_spriteBatch;
            this.m_keyPositions = new Vector2[7];
            this.m_camera       = a_camera;

            this.m_inputHandler = a_inputHandler;
            this.m_activeSpells = a_gameModel.m_playerSystem.m_spellSystem.ActiveSpells;
            this.m_player       = a_gameModel.m_playerSystem.m_player;
            this.m_questSystem  = a_gameModel.m_questSystem;
            this.m_worldItems   = a_gameModel.m_itemSystem.m_items;
            this.m_currentMap   = a_gameModel.m_level.CurrentMap();

            this.m_rightClickWatch = new Stopwatch();
            this.m_conversation    = a_conversation;
        }
예제 #17
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="spriteBatch">Instance of SpriteBatch</param>
        /// <param name="camera">Instance of Camera</param>
        /// <param name="inputHandler">Instance of InputHandler</param>
        /// <param name="gameModel">Instance of GameModel</param>
        /// <param name="dialog">Instance of Dialog</param>
        public UIView(SpriteBatch spriteBatch, Camera camera, InputHandler inputHandler, Model.GameModel gameModel, Dialog dialog)
        {
            this._spriteBatch     = spriteBatch;
            this._player          = gameModel.PlayerSystem.Player;
            this._worldItems      = gameModel.ItemSystem._items;
            this._currentMap      = gameModel.Level.CurrentMap();
            this._activeSpells    = gameModel.PlayerSystem.SpellSystem.ActiveSpells;
            this._rightClickWatch = new Stopwatch();

            this._dialog       = dialog;
            this._camera       = camera;
            this._inputHandler = inputHandler;
            this._questSystem  = gameModel.QuestSystem;

            this._common    = new UI.Common(_spriteBatch);
            this._avatar    = new UI.Avatar(_spriteBatch, _player);
            this._worldMap  = new UI.WorldMap(_spriteBatch, _player, _inputHandler, _camera);
            this._actionBar = new UI.ActionBar(_spriteBatch, _activeSpells, _player, _questSystem, _camera);
        }
예제 #18
0
 //Konstruktor
 public GameController(GraphicsDevice a_graphicsDevice, SpriteBatch a_spriteBatch, Model.GameModel a_gameModel, View.AnimationSystem a_animationSystem, View.InputHandler a_inputHandler, View.SoundHandler a_soundHandler)
 {
     m_gameModel = a_gameModel;
     m_gameView  = new View.GameView(a_graphicsDevice, a_spriteBatch, m_gameModel, a_animationSystem, a_inputHandler, a_soundHandler);
 }
 //Constructor
 public GameController(Model.GameModel a_gameModel, View.GameView a_gameView)
 {
     this.m_gameModel = a_gameModel;
     this.m_gameView  = a_gameView;
     this.m_player    = a_gameModel.Player;
 }
예제 #20
0
 /// <summary>
 /// Cinstructor
 /// </summary>
 /// <param name="graphicsDevice">GraphickDevice instance</param>
 /// <param name="spriteBatch">SpriteBatch instance</param>
 /// <param name="gameModel">GameModel instance</param>
 /// <param name="animationSystem">AnimationSystem instance</param>
 /// <param name="inputHandler">InputHandler instance</param>
 /// <param name="soundHandler">SoundHandler instance</param>
 public GameController(GraphicsDevice graphicsDevice, SpriteBatch spriteBatch, Model.GameModel gameModel,
                       View.AnimationSystem animationSystem, View.InputHandler inputHandler, View.SoundHandler soundHandler)
 {
     this._gameModel = gameModel;
     this._gameView  = new View.GameView(graphicsDevice, spriteBatch, _gameModel, animationSystem, inputHandler, soundHandler);
 }
 public ScreenController(Model.GameModel a_gameModel, SpriteBatch a_spriteBatch, View.AnimationSystem a_animationSystem, View.InputHandler a_inputHandler, View.SoundHandler a_soundHandler)
 {
     this.m_gameModel   = a_gameModel;
     this.m_spriteBatch = a_spriteBatch;
     this.m_screenView  = new View.ScreenView(m_spriteBatch, a_animationSystem, a_inputHandler, a_soundHandler);
 }