예제 #1
0
파일: Game1.cs 프로젝트: Daminvar/Euphor
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            var dialog = new System.Windows.Forms.OpenFileDialog();

            dialog.Filter = "Map file|*.js";

            var result = dialog.ShowDialog();

            if (result != System.Windows.Forms.DialogResult.OK)
            {
                Environment.Exit(0);
            }

            map = new Map(this);
            map.setMapFolder(dialog.FileName.Replace(dialog.SafeFileName, ""));
            map.LoadMap(dialog.SafeFileName);

            //shows the windows.forms layout design
            new Layout(map).Show();

            //allows the mouse to show over the game
            this.IsMouseVisible = true;
            base.Initialize();
        }
예제 #2
0
파일: Layout.cs 프로젝트: Daminvar/Euphor
        public Layout(Map map)
        {
            this.map = map;

            InitializeComponent();
        }
예제 #3
0
파일: NPE.cs 프로젝트: Daminvar/Euphor
 public void DrawForOverworld(SpriteBatch spriteBatch, Map map, int x, int y)
 {
     if (texture != null)
         spriteBatch.Draw(texture,
             new Vector2(x + xPos * map.TileSize, y + yPos * map.TileSize), Color.White);
 }
예제 #4
0
 /// <summary>
 /// Constructor to set the current map
 /// </summary>
 /// <param name="map">map object to set to current map</param>
 public FlagControl(Map map)
 {
     this.map = map;
     InitializeComponent();
 }