Andrew Sterling Hanenkamp > Games-HotPotato-0.110020 > Games::HotPotato

Download:
Games-HotPotato-0.110020.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.110020   Source  

NAME ^

Games::HotPotato - A random length hot-potato timer with a dramatic ending

VERSION ^

version 0.110020

SYNOPSIS ^

  use Games::HotPotato;

  my $hot_potato = Games::HotPotato->new;

  $hot_potato->minimum_time({ seconds => 20 });
  $hot_potato->maximum_time({ seconds => 40 });
  $hot_potato->maximum_rush({ seconds => 15 });
  $hot_potato->minimum_rush({ seconds => 5 });

  $hot_potato->start_alert('bing.wav');
  $hot_potato->start_music('calm.wav');
  $hot_potato->start_rush_alert('dumdumdum.wav');
  $hot_potato->rush_music('urgent.wav');
  $hot_potato->final_alert('crash.wav');

  $hot_potato->run;

DESCRIPTION ^

This class holds the internals for the hot-potato game. See hot-potato.

ATTRIBUTES ^

minimum_time

This is the minimum duration for the hot potato timer. Default is 20 seconds.

maximum_time

This is the maximum duration for the hot potato timer. Defaut is 40 seconds. This must be greater than or equal to "minumum_time".

minimum_rush

This is the minimum duration for the rush time. Default is 5 seconds. This must be less than the "minimum_time".

maximum_rush

This is the maximum duration for the rush time. Default is 15 seconds. This must be greater than or equal to "minimum_rush" and must be less than the "minimum_time".

sound_theme

This is the sound theme to use. This is set to "zostay" by default.

start_alert

This is the sound to play to announce that the game has begun.

rush_alert

This is the sound to play when the rush starts.

final_alert

This is the sound to announce that the game is over.

start_music

This is the sound or music to play and repeat at the start of the game after the "start_alert" is played.

rush_music

This is the sound or music to play and repeat during the rush at the end of the game after the "rush_alert" is played.

config

This contains a hash of configuration information for the game.

The configuration is loaded from the data section of this module file and then merged with the configuration found at .hotpotato/config.ini in the user's home directory.

METHODS ^

path_from_sound_theme

Loads a configured file path from the current sound theme and returns.

locate_file

Looks for a file in the resource directories for Games::HotPotato. This includes the directory named after this module in the Perl library directory. The secondary location is the .hotpotato directory in the user's home directory.

random_time

Generate a random time.

run

Start the timer.

SEE ALSO ^

hot-potato

AUTHOR ^

Andrew Sterling Hanenkamp <hanenkamp@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2011 by Qubling Software LLC.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: