コード例 #1
0
ファイル: Map.cs プロジェクト: Hakua/PokeSharp
		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);*/
			}
		}
コード例 #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();
     }
 }
コード例 #3
0
ファイル: PokeEngine.cs プロジェクト: Hakua/PokeSharp
		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;
		}
コード例 #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;
 }
コード例 #5
0
ファイル: PokeEngine.cs プロジェクト: Hakua/PokeSharp
		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();
			}
		}
コード例 #6
0
 public InputHandler(PokeEngine engine)
 {
     prevState = Keyboard.GetState();
 }
コード例 #7
0
ファイル: InputHandler.cs プロジェクト: Hakua/PokeSharp
		public InputHandler(PokeEngine engine) {
			prevState = Keyboard.GetState();
		}