Example #1
0
        public SGame(Game game)
            : base(game)
        {
            SwapMe = false;
            gameStateManager = new GameStateManager(Game.Content, true);
            movementManager = new MovementManager();

            gameStateManager.setMovementManager(movementManager);

            OnPauseEvent += gameStateManager.OnPause;
            OnResumeEvent += gameStateManager.OnResume;
        }
Example #2
0
        public MapEditor()
        {
            InitializeComponent();

            //Find config file
            IniFile.SetConfigurationPath( @".\MapEditor.ini");

            //Load the editor options
            editorOptions = new EditorOptions();

            //Load the entity creator
            creator = new EntityCreator(objectTree.Nodes);

            //Create a new xna window to render into
            xna = new XnaForms(pnlOutput.Handle, pnlOutput.Width, pnlOutput.Height);
            xna.Content.RootDirectory = @"Content";

            camera = new Camera();

            spriteBatch = new SpriteBatch(xna.GraphicsDevice);

            //Adjust the current size
            previousSize = Size;

            levelBuilder = new LevelBuilder();
            ScreenHeight = 800;

            gameStateManager = new GameStateManager(xna.Content, false);
            movementManager = new MovementManager();
            gameStateManager.setMovementManager(movementManager);

            selectedItems = new List<WorldObject>();

            closeHandeler += GetMapProperties;

            //Mouse handeling initializing
            mousePosition = Vector2.Zero;
            prevMousePosition = Vector2.Zero;
            mouseButtonDown = MouseButtons.None;

            Level level = new Level();

            gameStateManager.Level = level;

            LoadTextures();

            RenderFrame();
        }