Ejemplo n.º 1
0
        public World( Game game )
            : base(game)
        {
            input = new InputManager ( game );
            content = new ContentManager ( game.Services );
            content.RootDirectory = "Content";

            tiles = new TileSet ( 5, 5 );

            for ( int i = 0; i < tiles.sizeX; i++ ) {
                for ( int j = 0; j < tiles.sizeY; j++ ) {
                    tiles[ i, j ] = new Tile ( Tile.Type.grass, i, j );
                }
            }

            hero = new Hero ( tiles[ 0, 0 ], "hero" );
        }
Ejemplo n.º 2
0
        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";
        }