NAME

Games::3D::World - contains all things in the game world

SYNOPSIS

	use Games::3D::World;

	# construct world from templates file and level file
	my $level = Games::3D::World->new( $templates, $file);

	# load the same level again
	$level->reload();

	# create a new world from sratch:
	my $world = Games::3D::World->new();
	$world->load_templates( $templates_file );

	# add some thing directly
        $world->create ( $thing_class );

	# create another one
	my $thing = Games::3D::Thingy->new( ... );
	$thing->visible(1);
	$thing->think_time(100);
	# and make our world contain it
	$world->register($thing);
	
	# save the world
	$world->save_to_file();

	# foreach frame to render:
	while ($not_quit)
	  {
	  # other code like user input handling here
	  ...
	  # update the world with the current frame time:
	  $world->update( $now );
	  ...
	  # then let world call $callback for each visible object
	  $world->render( $now, $callback );
	  # other drawing code here
	  ...
	  }

EXPORTS

Exports nothing on default.

DESCRIPTION

METHODS

new()
my $world = Games::3D::World->new( templates => $file );

Creates a new game world/level and reads in the templates from $file.

load_from_file()
$world->load_from_file( $file );

Load the game world/level from a file, replacing all existing data.

load_from_file()
$world->load_templates( $templates_file );

Loads the templates from a file.

save_to_file()
my $rc = $world->save_to_file( $file );

Save game world/level to a file, returns undef for success, otherwise ref to error message.

save_templates()
my $rc = $world->save_templates( $file );

Save game world/level to a file, returns undef for success, otherwise ref to error message.

AUTHORS

(c) 2004 Tels <http://bloodgate.com/>

SEE ALSO

Games::3D::Thingy, Games::3D::Link, Games::Irrlicht.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 261:

You forgot a '=back' before '=head1'