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);*/ } }
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(); } }
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; }
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; }
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(); } }
public InputHandler(PokeEngine engine) { prevState = Keyboard.GetState(); }