Beispiel #1
0
        public LevelScreen(LoderGame game, SystemManager systemManager, EntityManager entityManager)
            : base(game.screenSystem, ScreenType.Level)
        {
            _game = game;
            _systemManager = systemManager;
            _entityManager = entityManager;
            _levelSystem = (LevelSystem)_systemManager.getSystem(SystemType.Level);
            _content = new ContentManager(_game.Services);
            _content.RootDirectory = "Content";
            _equipmentSystem = (EquipmentSystem)_systemManager.getSystem(SystemType.Equipment);
            _playerId = PlayerSystem.PLAYER_ID;
            _pixel = new Texture2D(_game.GraphicsDevice, 1, 1);
            _pixel.SetData<Color>(new[] { Color.White });
            _arial = _content.Load<SpriteFont>("arial");
            _dialogePanes = new List<InteractiveDialoguePane>();
            _dialogueFont = _content.Load<SpriteFont>("shared_ui/dialogue_font");
            _dialogueOptionFont = _content.Load<SpriteFont>("shared_ui/dialogue_option_font");

            ToolbarComponent toolbarComponent = (ToolbarComponent)_entityManager.getComponent(LevelSystem.currentLevelUid, _playerId, ComponentType.Toolbar);

            _toolbarDisplay = new ToolbarDisplay(_game.spriteBatch, _equipmentSystem, toolbarComponent);
            _inventoryDisplay = new InventoryDisplay(_game.spriteBatch, _equipmentSystem, (InventoryComponent)_entityManager.getComponent(LevelSystem.currentLevelUid, _playerId, ComponentType.Inventory), toolbarComponent);
            _inventoryDisplay.inFocus = false;
            _toolbarDisplay.inFocus = true;

            _healthBar = new LargeHealthBar(_game.spriteBatch);
        }
Beispiel #2
0
 public EventSystem(SystemManager systemManager, EntityManager entityManager)
 {
     _systemManager = systemManager;
     _entityManager = entityManager;
     _levelSystem = (LevelSystem)_systemManager.getSystem(SystemType.Level);
     _handlers = new Dictionary<GameEventType,Dictionary<int,List<IEventHandler>>>();
 }
 public AIBehaviorSystem(SystemManager systemManager, EntityManager entityManager)
 {
     _systemManager = systemManager;
     _entityManager = entityManager;
     _levelSystem = _systemManager.getSystem(SystemType.Level) as LevelSystem;
     _random = new Random();
 }
Beispiel #4
0
        public WorldMapScreen(LoderGame game, SystemManager systemManager)
            : base(game.screenSystem, ScreenType.WorldMap)
        {
            _game = game;
            _systemManager = systemManager;
            _scale = 1f;

            _content = new ContentManager(game.Services);
            _content.RootDirectory = "Content";
            _fogEffect = _content.Load<Effect>("fog_effect");
            _pathTexture = _content.Load<Texture2D>("world_map/path");
            _pathTextureOrigin = new Vector2(_pathTexture.Width, _pathTexture.Height) / 2f;
            _antiFogBrush = _content.Load<Texture2D>("world_map/anti_fog_brush");
            _antiFogBrushOrigin = new Vector2(_antiFogBrush.Width, _antiFogBrush.Height) / 2f;
            _levelSelectIcon = _content.Load<Texture2D>("world_map/level_select_icon");
            _levelSelectIconHalfSize = new Vector2(_levelSelectIcon.Width, _levelSelectIcon.Height) / 2f;
            _levelSelectIconSelectedColor = Color.Yellow;
            _levelSelectIconDeselectedColor = Color.White * 0.8f;
            _levelSelectIconColor = _levelSelectIconDeselectedColor;
            _levelSelectTitleFont = _content.Load<SpriteFont>("world_map/level_select_title");
            _levelSelectDescriptionFont = _content.Load<SpriteFont>("world_map/level_select_description");
            _halfScreenSize = new Vector2(_spriteBatch.GraphicsDevice.Viewport.Width, _spriteBatch.GraphicsDevice.Viewport.Height) / 2f;
            _fogRT = new RenderTarget2D(_spriteBatch.GraphicsDevice, _spriteBatch.GraphicsDevice.Viewport.Width, _spriteBatch.GraphicsDevice.Viewport.Height);
            _antiFogRT = new RenderTarget2D(_spriteBatch.GraphicsDevice, _spriteBatch.GraphicsDevice.Viewport.Width, _spriteBatch.GraphicsDevice.Viewport.Height);
        }
Beispiel #5
0
 public EquipmentSystem(SystemManager systemManager, EntityManager entityManager)
 {
     _systemManager = systemManager;
     _entityManager = entityManager;
     _defaultRopeMaterial = new RopeMaterial(ResourceManager.getResource("default_rope_material"));
     _rng = new Random();
 }
Beispiel #6
0
        public RenderSystem(LoderGame game, SystemManager systemManager, EntityManager entityManager)
        {
            _game = game;
            _systemManager = systemManager;
            _entityManager = entityManager;
            _animationManager = game.animationManager;
            //_sortedRenderablePrimitives = new SortedDictionary<float, List<IRenderablePrimitive>>();
            _cameraSystem = _systemManager.getSystem(SystemType.Camera) as CameraSystem;
            _graphicsDevice = game.GraphicsDevice;
            _spriteBatch = game.spriteBatch;
            _backgroundRenderer = new BackgroundRenderer(_spriteBatch);
            _fluidRenderTarget = new RenderTarget2D(_graphicsDevice, _graphicsDevice.Viewport.Width, _graphicsDevice.Viewport.Height);
            _renderedFluid = new RenderTarget2D(_graphicsDevice, _graphicsDevice.Viewport.Width, _graphicsDevice.Viewport.Height);
            _debugFluid = new RenderTarget2D(_graphicsDevice, _graphicsDevice.Viewport.Width, _graphicsDevice.Viewport.Height);
            _postSourceUnder = new RenderTarget2D(_graphicsDevice, _graphicsDevice.Viewport.Width, _graphicsDevice.Viewport.Height);
            _postSourceOver = new RenderTarget2D(_graphicsDevice, _graphicsDevice.Viewport.Width, _graphicsDevice.Viewport.Height);

            _contentManager = new ContentManager(game.Services);
            _contentManager.RootDirectory = "Content";
            _fluidEffect = _contentManager.Load<Effect>("fluid_effect");
            _fluidParticleTexture = _contentManager.Load<Texture2D>("fluid_particle");
            _reticle = _contentManager.Load<Texture2D>("reticle");
            _materialRenderer = new MaterialRenderer(game.GraphicsDevice, _contentManager, game.spriteBatch);
            _primitivesEffect = _contentManager.Load<Effect>("effects/primitives");
            _pixel = new Texture2D(_graphicsDevice, 1, 1);
            _pixel.SetData<Color>(new [] { Color.White });
            _circle = _contentManager.Load<Texture2D>("circle");
            _tooltipFont = _contentManager.Load<SpriteFont>("shared_ui/tooltip_font");
        }
Beispiel #7
0
 public DialogueManager(SystemManager systemManager, EntityManager entityManager)
 {
     _systemManager = systemManager;
     _entityManager = entityManager;
     _dialogues = new Dictionary<string, Dialogue>();
     createDialogues();
     loadStates();
 }
Beispiel #8
0
        public FluidSystem(SystemManager systemManager, EntityManager entityManager)
        {
            _systemManager = systemManager;
            _entityManager = entityManager;

            _physicsSystem = (PhysicsSystem)_systemManager.getSystem(SystemType.Physics);
            _renderSystem = (RenderSystem)_systemManager.getSystem(SystemType.Render);
            fluidGrid = new Dictionary<int, Dictionary<int, List<int>>>();
            liquid = new Particle[MAX_PARTICLES];
            activeParticles = new int[MAX_PARTICLES];
            _simPositions = new Vector2[MAX_PARTICLES];
            _simVelocities = new Vector2[MAX_PARTICLES];
            _delta = new Vector2[MAX_PARTICLES];
            for (int i = 0; i < MAX_PARTICLES; i++)
            {
                liquid[i] = new Particle(this, i, LIQUID_ORIGIN);
            }
        }
Beispiel #9
0
        public PhysicsSystem(SystemManager systemManager, EntityManager entityManager)
        {
            _systemManager = systemManager;
            _entityManager = entityManager;
            _bodiesToRemove = new List<Body>();
            _playerSystem = (PlayerSystem)systemManager.getSystem(SystemType.Player);
            _worlds = new Dictionary<string, World>();
            _groundBodies = new Dictionary<string, Body>();
            /*
            // Create world
            _world = new World(gravity);

            // Contact callbacks
            _world.ContactManager.BeginContact += new BeginContactDelegate(BeginContact);
            _world.ContactManager.EndContact += new EndContactDelegate(EndContact);
            _world.ContactManager.PreSolve += new PreSolveDelegate(PreSolve);
            _world.ContactManager.PostSolve += new PostSolveDelegate(PostSolve);

            // Create ground body/entity
            _groundBody = _entityManager.factory.createGroundBody(_world);*/
        }
Beispiel #10
0
 public LevelSystem(LoderGame game, SystemManager systemManager, EntityManager entityManager)
 {
     _game = game;
     _systemManager = systemManager;
     _entityManager = entityManager;
     _scriptManager = _game.scriptManager;
     //_regionGoals = new Dictionary<int, Goal>();
     //_eventGoals = new Dictionary<GameEventType, Dictionary<int, Goal>>();
     //_completedGoals = new Dictionary<int, Goal>();
     _levelBoundaries = new Dictionary<string, AABB>();
     _fallbackLevelBoundaries = new Dictionary<string, AABB>();
     _boundaryMargin = new Vector2(50f, 50f);
     _levelsData = new Dictionary<string, XElement>();
     _firstPassEntities = new Dictionary<string, List<XElement>>();
     _secondPassEntities = new Dictionary<string, List<XElement>>();
     _thirdPassEntities = new Dictionary<string, List<XElement>>();
     _numEntities = new Dictionary<string, int>();
     _numEntitiesProcessed = new Dictionary<string, int>();
     _backgrounds = new Dictionary<string, Background>();
     _finishedLoading = new Dictionary<string, bool>();
     _spawnPositions = new Dictionary<string, Vector2>();
     _loadedLevels = new List<string>();
 }
Beispiel #11
0
        // Initialize
        public static void initialize(LoderGame game, SystemManager systemManager, EntityManager entityManager)
        {
            _game          = game;
            _systemManager = systemManager;
            _entityManager = entityManager;

            if (!Directory.Exists(_rootDirectory))
            {
                Directory.CreateDirectory(_rootDirectory);
            }
            if (!Directory.Exists(_settingsDirectory))
            {
                Directory.CreateDirectory(_settingsDirectory);
            }
            if (!Directory.Exists(_playersDirectory))
            {
                Directory.CreateDirectory(_playersDirectory);
            }

            _customFlags   = new Dictionary <string, bool>();
            _customValues  = new Dictionary <string, int>();
            _customStrings = new Dictionary <string, string>();
        }
Beispiel #12
0
 public ScriptManager(SystemManager systemManager, EntityManager entityManager)
 {
     _systemManager = systemManager;
     _entityManager = entityManager;
     _scripts = new Dictionary<string, ScriptBase>();
 }
 public CharacterMovementSystem(SystemManager systemManager, EntityManager entityManager)
 {
     _systemManager = systemManager;
     _entityManager = entityManager;
     _ropeSystem = _systemManager.getSystem(SystemType.Rope) as RopeSystem;
 }
Beispiel #14
0
 public ScriptManager(SystemManager systemManager, EntityManager entityManager)
 {
     _systemManager = systemManager;
     _entityManager = entityManager;
     _scripts       = new Dictionary <string, ScriptBase>();
 }
 public HomeVillageScript(SystemManager systemManager, EntityManager entityManager)
     : base(systemManager, entityManager)
 {
 }
Beispiel #16
0
        protected override void Initialize()
        {
            Logger.log("LoderGame.Initialize method started.");

            _systemManager = new SystemManager();
            _entityManager = new EntityManager(_systemManager);
            _scriptManager = new ScriptManager(_systemManager, _entityManager);
            _animationManager = new AnimationManager(this);

            base.Initialize();

            _screenSystem = new ScreenSystem(_systemManager, _spriteBatch);
            _systemManager.add(_screenSystem, -1);
            _loadingScreen = new LoadingScreen(this);

            DataManager.initialize(this, _systemManager, _entityManager);
            DataManager.loadGameSettings();
            applyDisplaySettings();

            Logger.log("LoderGame.Initialize method finished.");
        }
Beispiel #17
0
 public PlayerSystem(SystemManager systemManager, EntityManager entityManager)
 {
     _systemManager = systemManager;
     _entityManager = entityManager;
 }
Beispiel #18
0
 public CameraSystem(SystemManager systemManager, EntityManager entityManager)
 {
     _systemManager = systemManager;
     _entityManager = entityManager;
 }
Beispiel #19
0
        // Initialize
        public static void initialize(LoderGame game, SystemManager systemManager, EntityManager entityManager)
        {
            _game = game;
            _systemManager = systemManager;
            _entityManager = entityManager;

            if (!Directory.Exists(_rootDirectory))
                Directory.CreateDirectory(_rootDirectory);
            if (!Directory.Exists(_settingsDirectory))
                Directory.CreateDirectory(_settingsDirectory);
            if (!Directory.Exists(_playersDirectory))
                Directory.CreateDirectory(_playersDirectory);

            _customFlags = new Dictionary<string, bool>();
            _customValues = new Dictionary<string, int>();
            _customStrings = new Dictionary<string, string>();
        }
Beispiel #20
0
 public AnimationSystem(SystemManager systemManager, EntityManager entityManager, AnimationManager animationManager)
 {
     _systemManager = systemManager;
     _entityManager = entityManager;
     _animationManager = animationManager;
 }
Beispiel #21
0
 public ExplosionSystem(SystemManager systemManager, EntityManager entityManager)
 {
     _systemManager = systemManager;
     _entityManager = entityManager;
     _debrisToCreate = new List<DebrisProperties>();
 }
Beispiel #22
0
 public ScriptBase(SystemManager systemManager, EntityManager entityManager)
 {
     _systemManager = systemManager;
     _entityManager = entityManager;
 }
Beispiel #23
0
 public InputSystem(SystemManager systemManager, EntityManager entityManager)
 {
     _systemManager = systemManager;
     _entityManager = entityManager;
 }