Example #1
0
        public SingleplayerGameScene(Game game) : base(game)
        {
            this.Camera.SetBounds(Vector2.Zero, (GameConfig.WorldSize - WindowSettings.RenderArea.Size + WindowSettings.RenderArea.Location).ToVector2());
            this.background = new Background(Assets.Get <Texture2D>(GameConfig.Folders.Particles, "circle"), new Rectangle(Point.Zero, GameConfig.WorldSize));

            this.signalManager = new SignalManager();
            this.intentManager = new IntentManager();
            this.inputManager  = new InputManager(this.intentManager);
            this.scene         = new GUIScene();

            List <Texture2D> list = new List <Texture2D>
            {
                Assets.Get <Texture2D>(GameConfig.Folders.Particles, "circle")
            };

            this.particleEngine = new ParticleEngine(list, Vector2.Zero, 0, 50, false);

            this.scoreboardUI = new Scoreboard(GameConfig.Fonts.Medium, false);
            this.scoreboardUI.Hide();
            this.scene.AddChild(scoreboardUI);

            this.spaceShipSpawnPosition = GameConfig.PlayArea.Center.ToVector2();
            this.entityWorld            = new EntityWorld();
            this.entityFactory          = new ClientEntityFactory(this.entityWorld);

            this.entityWorld.SystemManager.AddSystem(new MotionControlSystem(this.entityWorld));
            this.entityWorld.SystemManager.AddSystem(new LifetimeSystem(this.entityWorld, this.signalManager));
            this.entityWorld.SystemManager.AddSystem(new ShootSystem(this.entityWorld, this.entityFactory));
            this.entityWorld.SystemManager.AddSystem(new MotionSystem(this.entityWorld));
            this.entityWorld.SystemManager.AddSystem(new CollisionDetectionSystem(this.entityWorld));
            this.entityWorld.SystemManager.AddSystem(new CollisionResponseSystem(this.entityWorld, this.entityFactory, this.signalManager));
            this.entityWorld.SystemManager.AddSystem(new RespawnTimeoutSystem(this.entityWorld));
            this.entityWorld.SystemManager.AddSystem(new TargetingSystem(this.entityWorld));
            this.entityWorld.SystemManager.AddSystem(new TextureRenderSystem(this.entityWorld));
            //this.entityWorld.SystemManager.AddSystem(new ParticleSystem(this.entityWorld, this.particleEngine));
            this.entityWorld.SystemManager.AddSystem(new ScoreboardSystem(this.entityWorld, scoreboardUI));
            this.entityWorld.SystemManager.AddSystem(new SpriteAnimationRenderSystem(this.entityWorld));
            this.tagCountSystem = (TagCountSystem)this.entityWorld.SystemManager.AddSystem(new TagCountSystem(this.entityWorld));

            this.CreateScene();

            this.CreatePauseMenu();
        }
Example #2
0
 public ScoreboardSystem(EntityWorld entityWorld, Scoreboard scoreboard) : base(entityWorld,
                                                                                entityWorld.ComponentManager.GetComponentId <ScoreComponent>() |
                                                                                entityWorld.ComponentManager.GetComponentId <LifeComponent>())
 {
     this.scoreboard = scoreboard;
 }