Main > Free Download Search >

Free games lineofsight software for linux

games lineofsight

Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 2118
Games::Lineofsight 1.0

Games::Lineofsight 1.0


Games::Lineofsight is a Perl module. more>>
Games::Lineofsight is a Perl module.

Many games (Ultima, Nethack) use two-dimensional maps that consists of the squares of the same size in a grid. Line-of-sight means that some of the squares may represent the items that block the vision of the player from seeing squares behind them. With this module you can add that behaviour to your games.

SYNOPSIS

use Games::Lineofsight qw(lineofsight);

# The map has to be a two-dimensional array. Each member (or "cell") of the array represents one
# square in the map. In this example each cell contains only one character but you can put strings
# to the cells also - practical with the graphical games.

my @map=(
[split //,"..:..::........."], # this is the map
[split //,".......:..X....:"], # . and : represents the ground
[split //,"...X.....:...:.."], # X is the barrier for the sight
[split //,".:...:....:....."],
[split //,"..X....:..X....."],
[split //,"..X..:........:."],
);

my($width)=scalar(@{@map[0]}); # the width of the map
my($height)=scalar(@map); # the height of the map
my($barrier_str)="X"; # string that represents the barrier
my($hidden_str)="*"; # string that represents a cell behind a barrier
my($man_str)="@"; # string that represents the viewer
my($man_x,$man_y)=(7,3); # view point coordinates - the player is here

# recreate the map with line-of-sight

@map=lineofsight(@map,$man_x,$man_y,$barrier_str,$hidden_str);

# draw the map

for(my $i=0;$i < $height;$i++){
for(my $j=0;$j < $width;$j++){
print $man_x == $j && $man_y == $i ? $man_str : $map[$i][$j];
}
print "n";
}
or
# The lineofsight() calls get_barriers() and analyze_map() each time its called. If the viewer
# moves around the map a lot, its much faster to read in the barriers once and call only
# analyze_map() each time before drawing it.

use Games::Lineofsight qw(get_barriers analyze_map);

# The map has to be a two-dimensional array. Each member (or "cell") of the array represents one
# square in the map. In this example each cell contains only one character but you can put strings
# to the cells also - practical with the graphical games.

my @map=(
[split //,"..:..::........."], # this is the map
[split //,".......:..X....:"], # . and : represents the ground
[split //,"...X.....:...:.."], # X is the barrier for the sight
[split //,".:...:....:....."],
[split //,"..X....:..X....."],
[split //,"..X..:........:."],
);

my($width)=scalar(@{@map[0]}); # the width of the map
my($height)=scalar(@map); # the height of the map
my($barrier_str)="X"; # string that represents the barrier
my($hidden_str)="*"; # string that represents a cell behind a barrier
my($man_str)="@"; # string that represents the viewer
my($man_x,$man_y)=(7,3); # view point coordinates - the player is here

# get_barriers() returns a hash with the information about barriers in the map. In this example we
# declare the "X"-character as a barrier. As well you can declare it to be a string in the graphical
# games; for example "barrier.jpg".

my %barrier=get_barriers($width,$height,@map,$barrier_str);

# analyze_map() returns an array containing the original map looked from the view point. The cells
# behind the barriers are replaced with given strings. The barriers should be told to the subroutine
# calling first get_barriers()-subroutine as we already did.

my @map2=analyze_map($width,$height,@map,%barrier,$man_x,$man_y,$hidden_str);

#draw the map with the lineofsight

print "nOriginal map:n";

draw($width,$height,$man_x,$man_y,@map2,$man_str);

# move the viewer two squares right

$man_x+=2;

# refresh the map

my @map2=analyze_map($width,$height,@map,%barrier,$man_x,$man_y,$hidden_str);

#draw the map again

print "nViewer has moved:n";

draw($width,$height,$man_x,$man_y,@map2,$man_str);

sub draw{
my($width,$height,$man_x,$man_y,$map,$man_str)=@_;
for(my $i=0;$i < $height;$i++){
for(my $j=0;$j < $width;$j++){
print $man_x == $j && $man_y == $i ? $man_str : $$map[$i][$j];
}
print "n";
}

}

<<less
Download (0.004MB)
Added: 2007-01-03 License: Perl Artistic License Price:
1029 downloads
Games::Irrlicht 0.04

Games::Irrlicht 0.04


Games::Irrlicht is a Perl module that use the Irrlicht 3D Engine in Perl. more>>
Games::Irrlicht is a Perl module that use the Irrlicht 3D Engine in Perl.

SYNOPSIS

package MyGame;
use strict;

use base Games::Irrlicht;

use Games::Irrlicht::Constants; get EDT_SOFTWARE etc

# override methods:

The Why

When building a game or screensaver displaying some continously running animation, a couple of basics need to be done to get a smooth animation and to care of copying with varying speeds of the system. Ideally, the animation displayed should be always the same, no matter how fast the system is.

This not only includes different systems (a PS/2 for instance would be slower than a 3 Ghz PC system), but also changes in the speed of the system over time, for instance when a background process uses some CPU time or the complexity of the scene changes.

In many old (especial DOS) games, like the famous Wing Commander series, the animation would be drawn simple as fast as the system could, meaning that if you would try to play such a game on a modern machine it we end before you had the chance to click a button, simple because it wizzes a couple 10,000 frames per second past your screen.

While it is quite simple to restrict the maximum framerate possible, care must be taken to not just "burn" surplus CPU cycles. Instead the application should free the CPU whenever possible and give other applications/thread a chance to run. This is especially important for low-priority applications like screensavers.

Games::Irrlicht makes this possible for you without you needing to worry about how this is done. It will restrict the frame rate to a possible maximum and tries to achive the average framerate as close as possible to this maximum.

Games::Irrlicht also monitors the average framerate and gives you access to this value, so that you can, for instance, adjust the scene complexity based on the current framerate. You can access the current framerate, averaged over the last second (1000 ms) by calling current_fps.

Frame-rate Independend Clock

Now that our application is drawing frames (via the method draw_frame, which you should override in a subclass), we need a method to decouple the animation speed from the framerate.
If we would simple put put an animation step every frame, we would get some sort of Death of the Fast Machine" effect ala Wing Commander. E.g. if the system manages only 10 FPS, the animation would be slower than when we do 60 FPS.

To achive this, SDL::App::FPS features a clock, which runs independed of the current frame rate (and actually, independend of the systems clock, but more on this in the next section).
You can access it via a call to current_time, and it will return the ticks e.g. the number of milliseconds elapsed since the start of the application.

To effectively decouple animation speed from FPS, get at each frame the current time, then move all objects (or animation sequences) according to their speed and display them at the location that matches the time at the start of the frame. See examples/ for an example on how to do this.

Note that it is better to draw all objects according to the time at the start of the frame, and not according to the time when you draw a particular object. Or in other words, treat the time like it is standing still when drawing a complete frame. Thus each frame becomes a snapshot in time, and you dont get nasty sideeffects like one object beeing always "behind" the others just because it gets drawn earlier.

Time Warp

Now that we have a constant animation speed independend from framerate or system speed, lets have some fun.

Since all our animation steps are coupled to the current time, we can play tricks with the current time.

The function time_warp lets you access a time warp factor. The default is 1.0, but you can set it to any value you like. If you set it, for instance to 0.5, the time will pass only half as fast as it used to be. This means instant slow motion! And when you really based all your animation on the current time, as you should, then it will really slow down your entire game to a crawl.

Likewise a time warp of 2 lets the time pass twice as fast. There are virtually no restrictions to the time warp.

For instance, a time warp greater than one lets the player pass boring moments in a game, for instance when you need to wait for certain events in a strategy game, like your factory beeing completed.

Try to press the left (fast forward), right (slow motion) and middle (normal) mousebuttons in the example application and watch the effect.

If you are very bored, press the b key and see that even negative time warps are possible...

Ramping Time Warp

Now, setting the time war to factor of N is nice, but sometimes you want to make dramatic effects, like slowly freezing the time into ultra slow motion or speeding it up again.

For this, ramp_time_warp can be used. You give it a time warp factor you want to reach, and a time (based on real time, not the warped, but you can of course change this). Over the course of the time you specified, the time warp factor will be adapted until it reaches the new value. This means it is possible to slowly speeding up or down.

You can also check whether the time warp is constant or currently ramping by using time_is_ramping. When a ramp is in effect, call ramp_time_warp without arguments to get the current parameters. See below for details.

The example application uses the ramping effect instead instant time warp.

Event handlers

This section describes events as external events that typically happen due to user intervention.
Such events are keypresses, mouse movement, mouse button presses, or just the flipping of the power switch. Of course the last event cannot be handled in a sane way by our framework.

All the events are checked and handled by Games::Irrlicht automatically. The event QUIT (which denotes that the application should shut down) is also carried out automatically. If you want to do some tidying up when this happens, override the method quit_handler.

The event checking and handling is done at the start of each frame. This means no event will happen while you draw the current frame. Well, it will happen, but the action caused by that event will delayed until the next frame starts. This simplifies the frame drawing routine tremendously, since you know that your world will be static until the next frame.

<<less
Download (0.039MB)
Added: 2006-09-30 License: Perl Artistic License Price:
1126 downloads
Games::Bingo::Bot 0.01

Games::Bingo::Bot 0.01


Games::Bingo::Bot is a simple class holding IRC related methods for bingo. more>>
Games::Bingo::Bot is a simple class holding IRC related methods for bingo.

SYNOPSIS

use Games::Bingo::Bot;

use constant ANY => 1; use constant PUBLIC => 2; use constant PRIVATE => 3;

my $gbb = Games::Bingo::Bot->new();

my $sub = $gbb->{commands}->{$msg});

my ($type, $answer) = &$sub($gbb, $nick);

This module contains all the commands supported by the Games::Bingo::Bot IRC bot (see the script in the bin directory).

The Games::Bingo::Bot class (this) and the script mentioned above is a complete IRC setup for playing Bingo, using the Games::Bingo module.

These are the bingobot commands:

help - this message

play - join a game

stats - get the current statistics of the running game

pull - pull the next number

bingo - you indicate to the bot that you have bingo

pulled - shows you what number have been pulled

show - lists the numbers on your plate

The command are described below in detail (SEE COMMANDS).

Not implemented yet (SEE TODO):

auto - enables automode (automatic number pulling)

noauto - disables automode

All commands can be sent into the channel or send as private messages to the bot. The bot can repond as both of these ways aswell. The reponses are sent as follows:

help, show and all errors are always private messages

pull and bingo are always public

play, pulled, stats, auto, noauto depends on how you query

As long as the bot is online a game is running.

<<less
Download (0.006MB)
Added: 2007-01-02 License: Perl Artistic License Price:
1032 downloads
Games Knoppix 4.0.2-03

Games Knoppix 4.0.2-03


Games Knoppix is a Knoppix based LiveCD with games. more>>
Games Knoppix is a Knoppix based LiveCD with games.
The following games are included:
- Marble Blast Gold Demo (OpenGL)
- Mutant Storm Demo (OpenGL)
- Space Tripper Demo (OpenGL)
- Think Tanks Demo (OpenGL)
- Ufo AI (XMas Special) (OpenGL)
- Asciijump
- Atanks
- Bzflag (OpenGL)
- Bzflag-Server
- Crack-Attack (OpenGL)
- Crimson
- Crossfire-Client-GTK
- Crossfire-Client-X11
- Cube
- Empire
- Enigma
- Foobillard (OpenGL)
- Freeciv-Client
- Freeciv-Client-GTK
- Freeciv-Server
- Freesci
- Gltron (OpenGL)
- Gnuchess
- Gnugo
- JumpnBump
- Kbattleship
- Kmahjongg
- Kobodeluxe
- Ksokoban
- Lbreakout2
- Lgeneral
- Nethack-Console
- Nethack-Gnome
- Nethack-Lisp
- Nethack-Qt
- Nethack-X11
- Netpanzer (OpenGL)
- Neverball (OpenGL)
- Pysol
- Scorched3d (OpenGL)
- Tower Toppler
- Battle for Wesnoth
- Battle for Wesnoth Editor
- Battle for Wesnoth Server
- Xarchon
- Xblast
- Xblast-TNT
- Xboing
- Xgalaga
- Xskat
- Xsoldier
<<less
Download (2762MB)
Added: 2005-09-14 License: GPL (GNU General Public License) Price:
857 downloads
Games::AlphaBeta::Position 0.4.6

Games::AlphaBeta::Position 0.4.6


Games::AlphaBeta::Position is a base Position class for use with Games::AlphaBeta. more>>
Games::AlphaBeta::Position is a base Position class for use with Games::AlphaBeta.

SYNOPSIS

package My::GamePos;
use base qw(Games::AlphaBeta::Position);

sub apply { ... }
sub endpos { ... } # optional
sub evaluate { ... }
sub findmoves { ... }

package main;
my $pos = My::GamePos->new;
my $game = Games::AlphaBeta->new($pos);

Games::AlphaBeta::Position is a base class for position-classes that can be used with Games::AlphaBeta. It inherits most of its methods from Games::Sequential::Position; make sure you read its documentation.

This class is provided for convenience. You dont need this class in order to use Games::AlphaBeta. It is, however, also possible to make use of this class on its own.

<<less
Download (0.012MB)
Added: 2007-01-03 License: Perl Artistic License Price:
1026 downloads
Harem Games Slot Machine 3.13

Harem Games Slot Machine 3.13


Harem Games Slot Machine es un juego gratis de la popular tragaperras de casino donde juegas contra guapas modelos. El objetivo del juego Slot Machine... more>> <<less
Download (525KB)
Added: 2009-04-06 License: Freeware Price: Free
206 downloads
Games::Roshambo 1.01

Games::Roshambo 1.01


Games::Roshambo is a brilliant module which manages a game of Rock/Paper/Scissors, aka Roshambo more>>

Games:Roshambo 1.01 is a brilliant module which manages a game of Rock/Paper/Scissors, aka Roshambo

Major Features:

  1. You can specify an optional hashref containing configuration items.
  2. Valid configuration items are: numthrows
  3. The number of separate valid throws for a game, for example, in Rock, Paper, Scissors, there are 3 throws, while in a spirited game of RPS-101, there are 101 valid throws. If not specified, this defaults to 3.
  4. sortable
  5. OPTIONAL: Behold the madness of Chris Prather. Passing a TRUE value to new for this item will cause the judge method to return values of -1 if Player 1 wins, 0 for a tie and 1 for Player 2, instead of the 0, 1 and 2 it does normally.
  6. The entirely dubious benefit of this is that the function can be used in conjunction with sort. It's his fault. He asked for it. Any questions as to the relative usefulness of this should be directed at him. The management disavows all knowledge.
  7. This method will judge a game of RPS, returning a 1 for Player 1 winning, a 2 for Player 2, and a 0 for a tie.
  8. It takes up to two arguments, indicating the throws for Player 1 and Player 2, as text representations.
  9. If one or both arguments are omitted, the method will internally call $self->gen_throw to randomly generate one.
  10. getaction
  11. When called with two throws, this will return the text of the action for this combination. For example, if called as $rps-getaction("rock", "paper")> the returned value will be "covers".
  12. This module contains actions for three throw (Rock, Paper, Scissors) and 101 throw games, in any other number of throws, this method will return undef.

Requirements: Perl

<<less
Added: 2009-05-14 License: Perl Artistic License Price: FREE
1 downloads
Games::Dice 0.02

Games::Dice 0.02


Games::Dice is a Perl module that can be used to simulate dice rolls. more>>
Games::Dice is a Perl module that can be used to simulate dice rolls.

SYNOPSIS

use Games::Dice roll;
$strength = roll 3d6+1;

use Games::Dice roll_array;
@rolls = roll_array 4d8;

Games::Dice simulates die rolls. It uses a function-oriented (not object-oriented) interface. No functions are exported by default. At present, there are two functions which are exportable: roll and roll_array. The latter is used internally by roll, but can also be exported by itself.

The number and type of dice to roll is given in a style which should be familiar to players of popular role-playing games: adb[+-*/b]c. a is optional and defaults to 1; it gives the number of dice to roll. b indicates the number of sides to each die; the most common, cube-shaped die is thus a d6. % can be used instead of 100 for b; hence, rolling 2d% and 2d100 is equivalent. roll simulates a rolls of b-sided dice and adds together the results.

The optional end, consisting of one of +-*/b and a number c, can modify the sum of the individual dice. +-*/ are similar in that they take the sum of the rolls and add or subtract c, or multiply or divide the sum by c. (x can also be used instead of *.) Hence, 1d6+2 gives a number in the range 3..8, and 2d4*10 gives a number in the range 20..80. (Using / truncates the result to an int after dividing.) Using b in this slot is a little different: its short for "best" and indicates "roll a number of dice, but add together only the best few". For example, 5d6b3 rolls five six- sided dice and adds together the three best rolls. This is sometimes used, for example, in roll-playing to give higher averages.

Generally, roll probably provides the nicer interface, since it does the adding up itself. However, in some situations one may wish to process the individual rolls (for example, I am told that in the game Feng Shui, the number of dice to be rolled cannot be determined in advance but depends on whether any 6s were rolled); in such a case, one can use roll_array to return an array of values, which can then be examined or processed in an application-dependent manner.

This having been said, comments and additions (especially if accompanied by code!) to Games::Dice are welcome. So, using the above example, if anyone wishes to contribute a function along the lines of roll_feng_shui to become part of Games::Dice (or to support any other style of die rolling), you can contribute it to the authors address, listed below.

<<less
Download (0.004MB)
Added: 2007-07-25 License: Perl Artistic License Price:
821 downloads
Crate Game Engine Milestone 4.1

Crate Game Engine Milestone 4.1


The Crate Game Engine is a game engine that is designed to make creating games trivial. more>>
Crate Game Engine is a game engine that is designed to make the process of creating games trivial.
The rendering engine and scripting engine are removed from the game engine to make the specialization of games as easy as possible.
An XML game loader will be implemented to make creating games require no recompiling.
Extremely easy to use game engine with modular Scripting and Rendering engines.
Milestones:
Milestone 1: Basic framework compilable (completed Oct 9, 2005)
Milestone 2: C++ proof of concept demo using framework & text based RenderingEngine
Milestone 3: XML based game loader with Milestone 2 game ported to it
Milestone 4: Scripting support with Milestone 3 game ported to it
Milestone 5: 2D Rendering Engine with Milestone 4 game ported to it
Enhancements:
- This release includes minor API and documentation updates, as well as a logging system.
<<less
Download (0.20MB)
Added: 2005-12-09 License: LGPL (GNU Lesser General Public License) Price:
805 downloads
Games::Bingo::Card 0.13

Games::Bingo::Card 0.13


Games::Bingo::Card is a helper class for Games::Bingo. more>>
Games::Bingo::Card is a helper class for Games::Bingo.

SYNOPSIS

use Games::Bingo::Card;

my $b = Games::Bingo-E new(90);
my $card = Games::Bingo::Card-E new($b);

my $bingo = Games::Bingo-E new(90);
$card-E validate($bingo);

use Games::Bingo::Print::Card;

my $p = Games::Bingo::Print::Card-E new();
$p-E populate();

The Games::Bingo::Card class suits the simple purpose of being able to generate bingo cards and validating whether they are valid in during a game where a player indicate victory.

It is also used by Games::Bingo::Print to hold the generated bingo cards before they are printed.

<<less
Download (0.020MB)
Added: 2007-01-04 License: Perl Artistic License Price:
1024 downloads
Games::Sequential::Position 0.4.6

Games::Sequential::Position 0.4.6


Games::Sequential::Position is a base Position class for use with Games::Sequential. more>>
Games::Sequential::Position is a base Position class for use with Games::Sequential.

SYNOPSIS

package My::GamePos;
use base Games::Sequential::Position;

sub init { ... } # setup initial state
sub apply { ... }

package main;
my $pos = My::GamePos->new;
my $game = Games::Sequential->new($pos);

Games::Sequential::Position is a base class for position-classes that can be used with Games::Sequential. This class is provided for convenience; you dont need this class to use Games::Sequential. It is also possible to use this class on its own.

<<less
Download (0.012MB)
Added: 2007-01-03 License: Perl Artistic License Price:
1025 downloads
Games::Euchre 1.02

Games::Euchre 1.02


Games::Euchre is an Euchre card game for humans and computers. more>>
Games::Euchre is an Euchre card game for humans and computers.

SYNOPSIS

Simply run my game wrapper:

% euchre.pl

or write your own:

use Games::Euchre;
use Games::Euchre::AI::Simple;
use Games::Euchre::AI::Human;

my $game = Games::Euchre->new();
foreach my $i (1..3) {
$game->setAI($i, Games::Euchre::AI::Simple->new());
}
$game->setAI(4, Games::Euchre::AI::Human->new());
$game->playGame();
my @scores = sort {$b $a} $game->getScores();
print("The winner is " . $game->getWinner()->getName() . " with a score of " .
"$scores[0] to $scores[1]n");

This software implements the card game of Euchre. The game is played with four players composing two teams. Any of the four players can be human or computer players, but more than one human is not well supported yet.

The Games::Euchre::AI module implements a simple framework for adding new classes of human interfaces or computer opponents. I recomment that AI writers use Games::Euchre::AI::Simple (a REALLY dumb computer opponent) as starting point.
Aside from the ::AI class and its descendents, this package also implements the following classes: Games::Euchre::Team, Games::Euchre::Player and Games::Euchre::Trick.

<<less
Download (0.021MB)
Added: 2007-01-03 License: GPL (GNU General Public License) Price:
1034 downloads
Games::Object 0.11

Games::Object 0.11


Games::Object is a Perl module to provide a base class for game objects. more>>
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.

<<less
Download (0.083MB)
Added: 2006-09-30 License: Perl Artistic License Price:
1119 downloads
Games::Othello 0.01

Games::Othello 0.01


Games::Othello is a Perl extension for modelling a game of Othello. more>>
Games::Othello is a Perl extension for modelling a game of Othello.

SYNOPSIS

use Games::Othello;

my $game = Games::Othello->new();

while( !game->over ) {
printf "It is presently %ss move",
($game->whos_move eq b) ? black, white;
my @possible_moves = values $game->possible_moves();

if ( ! @possible_moves ) {
print "You have no moves available, you must pass.
$game->pass_to_opponent;
} else {
foreach ( my $move ) @possible_moves ) {
printf
"You will take %d of your opponents chips if you place your chip on %d,%d",
scalar @{ $move->{chips} }, $move->{x}, $move->{y};
}
my ($locx, $locy) = get_move();
my $flipped = $game->place_chip( $locx, $locy );
}

my $layout = $game->chip_layout();
foreach my $row ( @$layout ) {
foreach my $pos ( @$row ) {
printf %3s,
($pos eq b) ? B # Black occupied square.
: ($pos eq w) ? W # White occupied square.
: # Un-occupied square.
}
print "nn";
}
}
my ($black_score, $white_score) = $game->score;

<<less
Download (0.005MB)
Added: 2006-12-28 License: Perl Artistic License Price:
1041 downloads
Games::Console 0.04

Games::Console 0.04


Games::Console Perl module provide a 2D quake style in-game console. more>>
Games::Console Perl module provide a 2D quake style in-game console.

SYNOPSIS

use Games::Console;

my $console = Games::Console->new(
font => $font_object,
background_color => [ 1,1,0],
background_alpha => 0.4,
text_color => [ 1,1,1 ],
text_alpha => 1,
speed => 50, # in percent per second
height => 50, # fully opened, in percent of screen
width => 100, # fully opened, in percent of screen
backbuffer_size => 100, # keep so many messages
prompt => >,
cursor => _,
);

$console->screen_width($width);
$console->screen_height($height);
$console->toggle($current_time);
$console->message(Hello there!);
$console->input(a);

This package provides you with a quake-style console for your games. The console gathers messages and lets you scroll trough them. It also can display a command line.

This package is just a base class setting up everything, but doesnt actually render anything.

See Games::Console::SDL and Games::Console::OpenGL for subclasses that implement the actual rendering to the screen via SDL and OpenGL, respectively.

<<less
Download (0.021MB)
Added: 2007-07-25 License: Perl Artistic License Price:
822 downloads
Secleted [ 0 ] software to compare
  • Page: 1 of 5
  • 1
  • 2
  • 3
  • 4
  • 5