#!/usr/bin/perl -w

# (c) Copyright by Tels 1999-2000. All Rights Reserved.
# file to be called via "perl vtutorial.pl 6"

sub createWorld
  {
  my ($txt,$gf) = @_; # get texture mapping and gamfile as params
  print "Tutorial Section 6\n\n";

  $room = { texture => $txt->texture("wood"), 
            floortexture => $txt->texture('brick'),
            ceilingtexture => $txt->texture('rufgry'),
    };                                                     

  $mydoor = { framethick => 0.25, texture => $txt->texture('wdplank'),
              floortexture => $txt->texture('rooftile'),
              width => 4, height => 8, };                  

  $room1 = cell ( name => "Room 1", size => 16 );          
  $room2 = cell ( name => "Room 2", size => 16, 
    things => [ openDoor ( aNorth(), $mydoor ), ] );       

  $lower = cell ( name => "lower part", size => 16, div => inY(),
     cells => [ $room2 ], );                               # line 1
  addCells ($lower, 4, "4,4", "room##num##" );             # line 2 
  
  $room2->{size} = 4;                                      # line 4

  $mydoor->{inherit} = true();                             # line 5
  $room2->{noinherit} = true();                            # line 6
  $lower->{things} = [ openDoor(aWest(),$mydoor) ];        # line 7

  $world = cell ( name => "Hello World", room => $room, 
    div => inX(),                                          
    cells => [ $room1, $lower, ]);                         

  $world->{debug} = 1;
  $bunch = worldAsBunch ( 0, 0, 0, 80, 32, 16, $world );   # line 3

  return $bunch;
  }

# EOF
1;

