Esempio n. 1
0
		public Map(PokeEngine engine, int id) {
			this.engine = engine;
			this.mapid = id;
			entities = new List<Entity>();
			initialize(id);

			if (!(this is MapConnection)) {
				if (MapProvider.getInstance().getConnections(id) != null) {
					foreach (ConnectionInfo info in MapProvider.getInstance().getConnections(id)) {
						if (info.dir == ConnectionDirection.LEFT) {
							connectionLeft = info.createConnectionFromInfo(this);
						} else if (info.dir == ConnectionDirection.UP) {
							connectionUp = info.createConnectionFromInfo(this);
						} else if (info.dir == ConnectionDirection.RIGHT) {
							connectionRight = info.createConnectionFromInfo(this);
						} else if (info.dir == ConnectionDirection.DOWN) {
							connectionDown = info.createConnectionFromInfo(this);
						}
					}
				}

				/*connectionLeft = new MapConnection(engine, this, ConnectionDirection.LEFT, 2, 0);
				connectionUp = new MapConnection(engine, this, ConnectionDirection.UP, 2, 0);
				connectionRight = new MapConnection(engine, this, ConnectionDirection.RIGHT, 2, 1);
				connectionDown = new MapConnection(engine, this, ConnectionDirection.DOWN, 2, 0);*/
			}
		}
Esempio n. 2
0
 public static void Main(String[] args)
 {
     /*using (Form1 form = new Form1()) {
      *      form.Show();
      *      using (PokeEngine game = new PokeEngine(form.getDrawSurface())) {
      *              game.Run();
      *      }
      * }*/
     using (PokeEngine engine = new PokeEngine((IntPtr)0)) {
         engine.Run();
     }
 }
Esempio n. 3
0
		public PokeEngine(IntPtr drawSurface) {
			graphics = new GraphicsDeviceManager(this);
			graphics.PreferredBackBufferHeight = PokeEngine.HEIGHT * PokeEngine.SCALE;
			graphics.PreferredBackBufferWidth = PokeEngine.WIDTH * PokeEngine.SCALE;
			Content.RootDirectory = "Content";
			IsMouseVisible = true;
			IsFixedTimeStep = false;
			if ((int)drawSurface != 0) {
				this.drawSurface = drawSurface;
				graphics.PreparingDeviceSettings +=
				new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);
				System.Windows.Forms.Control.FromHandle((this.Window.Handle)).VisibleChanged +=
				new EventHandler(Game1_VisibleChanged);
			}
			instance = this;
		}
Esempio n. 4
0
 public PokeEngine(IntPtr drawSurface)
 {
     graphics = new GraphicsDeviceManager(this);
     graphics.PreferredBackBufferHeight = PokeEngine.HEIGHT * PokeEngine.SCALE;
     graphics.PreferredBackBufferWidth  = PokeEngine.WIDTH * PokeEngine.SCALE;
     Content.RootDirectory = "Content";
     IsMouseVisible        = true;
     IsFixedTimeStep       = false;
     if ((int)drawSurface != 0)
     {
         this.drawSurface = drawSurface;
         graphics.PreparingDeviceSettings +=
             new EventHandler <PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);
         System.Windows.Forms.Control.FromHandle((this.Window.Handle)).VisibleChanged +=
             new EventHandler(Game1_VisibleChanged);
     }
     instance = this;
 }
Esempio n. 5
0
		public static void Main(String[] args) {
			/*using (Form1 form = new Form1()) {
				form.Show();
				using (PokeEngine game = new PokeEngine(form.getDrawSurface())) {
					game.Run();
				}
			}*/
			using (PokeEngine engine = new PokeEngine((IntPtr)0)) {
				engine.Run();
			}
		}
Esempio n. 6
0
 public InputHandler(PokeEngine engine)
 {
     prevState = Keyboard.GetState();
 }
Esempio n. 7
0
		public InputHandler(PokeEngine engine) {
			prevState = Keyboard.GetState();
		}