예제 #1
0
        public static void SetupMods(Level level)
        {
            ResetMods();
            foreach (var pair in level.Map.Properties)
            {
                string key = pair.Key;
                string property = pair.Value;

                switch (key)
                {
                    case "GameMode":
                        ParseGameMode(property);
                        break;
                    case "DoubleJump":
                        DoubleJump = ParseInt(property) ?? DoubleJumpDefault;
                        break;
                    case "Gravity":
                        Gravity = ParseInt(property) ?? GravityDefault;
                        break;
                    case "JumpMania":
                        JumpMania = ParseBool(property) ?? JumpManiaDefault;
                        break;
                    case "CantStop":
                        CantStop = ParseBool(property) ?? CantStopDefault;
                        break;
                    case "MirrorMan":
                        MirrorMan = ParseBool(property) ?? MirrorManDefault;
                        break;
                }
            }
        }
예제 #2
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            _spriteBatch = new SpriteBatch(_graphics.GraphicsDevice);
            Content.RootDirectory = "Content";
            Input.Init();
            ResourceManager.Initialize(Content, _graphics.GraphicsDevice);
            ParticleSystem.Init();
            ParticleSystem.AddEmitter("blood", new CircleEmitter());
            log = new JapeLogMono(this);
            Log.Init(log);
            PauseTexture = new Texture2D(GraphicsDevice, 1, 1);
            PauseTexture.SetData(new Color[] { Color.White });
            EntityManager.Init(GraphicsDevice);
            level = new Level(Content);
            //this.Components.Add(keyboardManager);
            NetManager.Init(false);

            gameplayNetComponent = new ClientGameplayNetComponent();

            gameplayNetComponent.ChangeLevelEvent += gameplayNetComponent_ChangeLevelEvent;
            //gameplayNetComponent.ChangeLevelPrepEvent += gameplayNetComponent_ChangeLevelPrepEvent;

            NetManager.AddComponent(gameplayNetComponent);
            NetManager.AddComponent(chatNetComponent = new ChatNetComponent());
        }