Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 40.261.742 Times

Games::Object 0.11

  Date Added: April 27, 2010  |  Visits: 828

Games::Object

Report Broken Link
Printer Friendly Version


Product Homepage
Download (80 downloads)



Games::Object is a Perl module to provide a base class for game objects. SYNOPSIS package MyGameObject; use Games::Object; use vars qw(@ISA); @ISA = qw(Games::Object); sub new { # Create object my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); bless $self, $class; # Add attributes $self->new_attr(-name => "hit_points", -type => int, -value => 20, -tend_to_rate => 1); $self->new_attr(-name => "strength", -type => int, -value => 12, -minimum => 3, -maximum => 18); ... return $self; } package MyObjectManager; use Games::Object::Manager; use vars qw(@ISA); @ISA = qw(Games::Object::Manager); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new( , @_); bless $self, $class; ... return $self; } my $world = new MyObjectManager; my $object = new MyGameObject; $world->add($object); ABSTRACT The purpose of this module is to allow a programmer to write a game in Perl easily by providing a basic framework in the form of a module that can be either subclassed to a module of your own or used directly as its own object class. The most important items in this framework are: Attributes You can define arbitrary attributes on objects with rules on how they may be updated, as well as set up automatic update of attributes whenever the objects process() method is invoked. For example, you could set an attribute on an object such that: It ranges from 0 to 100. Internally it tracks fractional changes to the value but accessing the attribute will always round the result to an integer. It will automatically tend towards the maximum by 1 every time process() is called on the object. A method in your subclass will be invoked automatically if the value falls to 0. This is just one example of what you can do with attributes. Flags You can define any number of arbitrarily-named flags on an object. A flag is a little like a boolean attribute, in that it can have a value of either true or false. Like attributes, flags can be created independently on different objects. No "global" flag list is imposed. Load/Save functionality Basic functionality is provided for saving data from an object to a file, and for loading data back into an object. This handles the bulk of load game / save game processing, freeing the programmer to worry about the mechanics of the game itself. The load functionality can also be used to create objects from object templates. An object template would be a save file that contains a single object. Object Managers New to version 0.10 of this module is object managers. An object manager is a Perl object that allows you to manage groups of related game objects. The object manager allows you to relate objects together (for example, you could define a relationship that allows certain objects to act as containers for other objects). In effect, the object manager acts as your world or universe. Like the game object class, the manager class can be subclassed, allowing you augment its functionality. An object manager can be loaded and saved, which in turn performs a load or save of the objects being managed by it..

Requirements: No special requirements
Platforms: Linux
Keyword: Base Class Class Game Gamesobject Isa Libraries Module New Object Object Manager Objects Perl Module Programming
Users rating: 0/10

License: Freeware Size: 84.99 KB
USER REVIEWS
More Reviews or Write Review


GAMES::OBJECT RELATED
Libraries  -  Volity::Game 0.6.5
Volity::Game is a base class for Volity game modules. SYNOPSIS See Volity::Game::TicTacToe and its source code for a simple but full-featured example. This class provides a framework for writing Volity game modules in Perl. A Volity game...
102.4 KB  
Libraries  -  Class::Cloneable 0.03
Class::Cloneable is a base class for Cloneable objects. SYNOPSIS package MyObject; our @ISA = (Class::Cloneable); # calling clone on an instance of MyObject # will give you full deep-cloning functionality This module provides a flexible...
8.19 KB  
Libraries  -  Class::StrongSingleton 0.02
Class::StrongSingleton is a stronger and more secure Singleton base class. SYNOPSIS package My::Singleton::Class; use base qw(Class::StrongSingleton); sub new { my ($class, %my_params) = @_; # create our object instance my $instance = {...
6.14 KB  
Libraries  -  DBIx::Class::FormTools 0.000004
DBIx::Class::FormTools is a utility module for building forms with multiple related DBIx::Class objects. SYNOPSIS In the examples I use 3 objects, a Film, an Actor and a Role. Role is a many to many relation between Film and Actor. package...
9.22 KB  
Libraries  -  Class::Interfaces 0.04
Class::Interfaces is a Per module for defining interface classes inline. SYNOPSIS # define some simple interfaces use Class::Interfaces ( Serializable => [ pack, unpack ], Printable => [ toString ], Iterable => [ iterator ], Iterator => [...
6.14 KB  
Libraries  -  Class::ObjectTemplate 0.7
Class::ObjectTemplate is a Perl extension for an optimized template builder base class. SYNOPSIS package Foo; use Class::ObjectTemplate; require Exporter; @ISA = qw(Class::ObjectTemplate Exporter); attributes(one, two, three); #...
6.14 KB  
Libraries  -  Games::LMSolve::Base 0.8.1
Games::LMSolve::Base is a base class for puzzle solvers. SYNOPSIS package MyPuzzle::Solver; use Games::LMSolve::Base; @ISA = qw(Games::LMSolve::Base); # Override these methods: sub input_board { ... } sub pack_state { ... } sub...
21.5 KB  
Libraries  -  Persistent::Base 0.52
Persistent::Base is an Abstract Persistent Base Class. SYNOPSIS ### we are a subclass of ... ### use Persistent::Base; @ISA = qw(Persistent::Base); ABSTRACT This is an abstract class used by the Persistent framework of classes to...
38.91 KB  
Miscellaneous  -  A class keeps a reference to it's instance 1.1
This script implements a base class, which allows derived classes to track instances in self.__instances__. It uses a WeakValueDictionary to store instance references.
 
Miscellaneous  -  Rebind class properties 1.0
Sometimes you define properties in base class and override the getter setter methods in derived classes. Then you find out the base class though has derived properties are still pointing to baseclasse's methods not the overriden ones.
 
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB