public Game1() { graphics = new GraphicsDeviceManager ( this ); inputs = new InputManager ( this ); events = new EventManager ( this ); world = new World ( this ); world.makeTileSetFromString ( "grass:g ground:G stone:S sizex:15 sizey:11", "ggggggggggggggg", "gGGGSGSGGGgGGGg", "gGGSSGSSGGgGSGg", "gGSSSGSSSGgGGGg", "gSSSSGSSSSggggg", "gGGGGGGGGGggggg", "gSSSSGSSSSggggg", "gGSSSGSSSGgGGGg", "gGGSSGSSGGgGSGg", "gGGGSGSGGGgGGGg", "ggggggggggggggg"); Content.RootDirectory = "Content"; }
public void exit( EventManager.ActionInfo nullAct ) { Exit (); }
public void toogleFreezeWoorld( EventManager.ActionInfo act ) { if ( pause ) { ReinitKeys (); pause = false; } else { DeinitKeys (); pause = true; } }
public void windHero( EventManager.ActionInfo actInfo ) { if ( 0 <= actInfo[ "x" ] && actInfo[ "x" ] < tiles.sizeX && 0 <= actInfo[ "y" ] && actInfo[ "y" ] < tiles.sizeY ) { hero.moveToTile ( tiles[ actInfo[ "x" ], actInfo[ "y" ] ] ); } else { throw new Exception ( "World.windHero(...): Error event processing!" ); } }
public void moveHero( EventManager.ActionInfo actInfo ) { if ( actInfo[ "down" ] != 0 ) { if ( hero.heroTile.y < tiles.sizeY - 1 ) { if ( tiles[ hero.heroTile.x, hero.heroTile.y + 1 ].isPathable () ) { hero.moveToTile ( tiles[ hero.heroTile.x, hero.heroTile.y + 1 ] ); } } } else if ( actInfo[ "up" ] != 0 ) { if ( hero.heroTile.y > 0 ) { if ( tiles[ hero.heroTile.x, hero.heroTile.y - 1 ].isPathable () ) { hero.moveToTile ( tiles[ hero.heroTile.x, hero.heroTile.y - 1 ] ); } } } else if ( actInfo[ "left" ] != 0 ) { if ( hero.heroTile.x > 0 ) { if ( tiles[ hero.heroTile.x - 1, hero.heroTile.y ].isPathable () ) { hero.moveToTile ( tiles[ hero.heroTile.x - 1, hero.heroTile.y ] ); } } } else if ( actInfo[ "right" ] != 0 ) { if ( hero.heroTile.x < tiles.sizeX - 1 ) { if ( tiles[ hero.heroTile.x + 1, hero.heroTile.y ].isPathable () ) { hero.moveToTile ( tiles[ hero.heroTile.x + 1, hero.heroTile.y ] ); } } } }