
TGamePan component for Borland DELPHI, Version 1.05
--------------------------------------------------

 Alexander Gogava, 1999-2001

 Email:   alex@argosoft.com
 Home:   http://www.argosoft.com/games/ 

-----------------------------------------------------

	TGamePan (Game Panel) is a descendant from TPanel. It can be use in all programs instead of standard TPanel.  Except this it has property State, changing which panel possible to transform in the game - Arcanoid, Figures, Scramble(Puzzle) or Tetris. Default State:=stPanel (Standard Panel). If State:=Arcanoid, panel transforms in game Arcanoid.  If State:=Scramble - panel transforms in Scramble.
	TGamePan has ensemble public and published properties and events,  which enable to do varied variants of games.  I think that main destination of component - its use in different programs instead of TPanel that user could sometimes enjoy.
	These component have been released to public domain, and may not be resold, without permission from the author.  The author will not except any liability for bodily or mental harm that may have been taken in the use of these component.
	These component may be redistributed freely, as long as they are provided in their initial form.

	To begin play,  if State<>stPanel, set property Start:=True.  Use Numeric Keypad to play Arcanoid and Tetris, use Mouse to play Figures, use mouse or NumPad to play Scramble game.

	Rules of Arcanoid, Scramble and Tetris you know. Figures is original puzzle game:

    Build up SQUARE using ALL 5 color "Figures".
    Drag and Drop "Figure" using left mouse button;
    RightClick "Figure" to rotate it right;
    Press  "Ctrl" and RightClick 'Figure' to rotate it left;

	List of Types, Public and Published properties of TGamePan happens to below.
	Run Demo1 program and see its source code, there demonstrated all main properties and events of the TGamePan.
	Demo2 is game, created using TGamePan.

Types:
------

 TState=(stPanel, Arcamoid, Figures, Scramble, Tetris); - State of component;
 TTSAKey=(Lft, Rgh, Drp, Rtt, Down, Up, Stp);
 TFSquare = (Big, Small); - Variant of "Figures" game;
 TColorTAFShapes = (colorFixed, colorFixed2, colorOne, colorRandom); - Combinatios of colors;

Public Properties:
-----------------

 Pause: Boolean;  If  True, game stops, if False, game lasts;
 GKey:  TTSAKey;
	 Lft - move Arcanoid Trolley left, Tetris's shape left, Scramble's button left;
	 Rgh -  move Arcanoid Trolley right, Tetris's shape right, Scramble's button right;
	 Drp - Drop down Tetris's Shape;
	 Rtt - Rotate Tetris's shape;
	 Down - move down Scramble's button;
	 Up - move up Scramble's button, move up Arcanoid's ball;
	 Stp - Stop Arcanoid's trolley;

 ABLLS:      Integer; (Read only) How many balls has Arcanoid player;
 ALevel:     Integer; (Read only) Arcanoid's current  level;
 AShapes:    Integer; (Read only) Deleted Arcanoid's Shapes;
 AScores:    Integer; (Read only) How many scores has Arcanoid player;
 FMoves:     Integer; (Read only) Number of moves in Figures game;
 NextTShape: Word; This characteristic gives possible to know, what shape (figure) will be the following. By changing its value is posible to set next shape (From 1 to 7);
 SMoves:     Integer; (Read only) Number of moves in Scramble game;
 Time:       Real;    (Read only) Time after beginning of play (Seconds);
 TLines:     Integer;    (Read only) Tetriss deleted lines;
 TScores:    Integer; (Read only) Amount of scores, which has player in Tetris. 

Published Properties:
--------------------

 AOverPicture:     String;   Path to the picture's file (.bmp or .wmf), which  seen after over of game. Default ''; 
 BStPicture:       String;   Path to the picture's file (.bmp or .wmf), which  seen before beginning of play. Default '';
 DefKeys:          Boolean;  If true, You do not need define keys using GKey property: Default keys are NumPad keys: Arcanoid: 4 - move trolley left; 6 - move trolley right; 2 - stop trolley; 8 - ball up; Scramble: 4 - Left; 8 - Up; 6 - Right; 2 - Down; Tetris: 4 - Left; 5 - Rotate; 6 - Right; 2 - Drop Down.   If False, user can not use default keys of NumPad to play. If You want - set defKeys False and use property GKeys to define events.  Default True;  
 ShowAllDlgs:      Boolean;  If True, shows all dialogs, if False, only "mtError". Default True;
 ShowScoresTime:   Boolean;  Show game's scores and time. If True, caption of GamePan shows an amount of scores and  time past after beginning of play. Default True;
 PicStretch:       Boolean;  Picture (BStPicture) is Stretched or Tile. Default True;
 State:            TState;   State of GamePan. stPanel - standard panel; Arcanoid - game Arcanoid; Tetris - game Tetris; Scramble - game Scramble; Figures - game Figures; default stPanel;
 Start:            Boolean;  if True, and State<>stPanel, game starts. Default False; 
 TimerFocus:       Boolean;  If True, GamePan automatically receives focus each 0.1 sec. Default False; 
 WithCaption:      Boolean;  If True, and GamePans state<>stPanel, GamePan has caption, to drag and drop it, and show scores or time, if ShowTScores or ShowSTime is True. Default True;

 Arcanoid:
 - - - - -
 ColorAB:          TColor;         Color of Arcanoid's background. Default clBtnFace;
 ColorABl:         TColor;         Color of Arcanoid's ball. Default clLime;
 ColorAShapes:     TColorTAFShapes;Color of Arcanoid's shapes. Default colorFixed2;
 ColorAShapesPen:  TColor;         Color of Arcanoid's shapes pen. Default clWhite;
 WidthAShapesPen:  Integer;        Width of Tetriss shapes pen. Default 1;
 ACreSquShape:     Integer;        How many shapes must be deleted to create square shape. Default 2;
 ADelay:           Integer;        Delay time of Arcanoids step. Default  40 (0.04 sec);
 AStrongShapes:    Boolean;        If true, Arcanoid's black, gray, silver shapes need 13,2,1 hits. Default True;
 AEndStop:         Boolean;        If True, Arcanoid's Trolley stops at the end of it's track, if False - reflects. Default False; 
 AIMMDelShapes:    Boolean;        Arcanoid immediately deletes shapes (no "visual effects"). Default False;
 OneColorAShapes:  Tcolor;         Color of all Arcanoid shapes, if ColorAShapes is ColorOne. Default clBlack;
 ABSpeed:          Integer;        Arcanoid's ball's speed (Per cent of Trolley's speed). Default  150;
 ASSpeed:          Integer;        Arcanoid's square shape's speed (Per cent of Trolley's speed). Default 75;
 ShapesAShape:     TShapeType;     Shapes of Arcanoid type. Default stRoundRect;
 ShapesABrushStyle:TBrushStyle;    Shapes of Arcanoid brush style. Default bsSolid;
 ACoeff:           Integer;        Arcanoids coefficient, to multiply deleted shapes number. Default 1;
 ATN:              Integer;        Arcanoid Trolley's normal width (per cent of shape's width). Default 100;
 ATL:              Integer;        Arcanoid Trolley's large width (per cent of shape's width). Default 150;
 ATS:              Integer;        Arcanoid Trolley's small width (per cent of shape's width). Default 75;
 ABHW:             Integer;        Arcanoid ball's diameter (width-height) - per cent of shape's height. Default 75;
 ALevels:          Integer;        Number of Arcanoid's levels. Default 10;
 ABalls:           Integer;        Starting number of Arcanoid's balls. Default 3;
 ASteps:           Integer;        Number of Arcanoid trolley's steps from left to right end of track. Default 100;
 AFriction:        Word;           Coefficient of friction of ball on trolley (Per cent of 1). Default 25;
 ARows:            Word;           Number of Arcanoids matrix rows. default 20;
 AColumns:         Word;           Number of Arcanoids matrixs columns. default 10;

 Figures:
 - - - -
 ColorFB: TColor; Color of Figures's background. Default clBlack;
 ColorFShapes: TColorTAFShapes; Color of Figure's Shapes. Default colorFixed2;
 FSquare: TFSquare; Variant of game. Default "Big";
 FWidthHeight: Word; Maximal width and height of biggest figures, in per cents of minimal from width and height of GamePan. Default 65;

 Scramble:
 - - - - -
 ColorSB:          TColor;         Color of Scramble's background. Default clBtnFace;
 SRowsColumns:     TSRowsColumns;  Number of Scrambles matrixs rows and columns. Default 4;

 Tetris:
 - - - -
 ColorTB:          TColor;         Color of Tetris's background. Default clBtnFace;
 ColorTF:          TColor;         Color of Tetris's footer. Default clBlack;
 ColorTShapes:     TColorTAFShapes;Color of Tetris's shapes. Default colorFixed;
 ColorTShapesPen:  TColor;         Color of Tetris's shapes pen. Default clWhite;
 TDelay:           Integer;        Delay time of Tetriss step. Default  200 (0.2 sec);
 NextSColorT:      Boolan;         Next Shapes color of Tetris. If True, and if ColorTShapes is ColorFixed or ColorFixed2, Tetriss BackGrownds color is same as next shapes color. Default False;
 OneColorTShapes:  Tcolor;         Color of all Tetris shapes, if ColorTShapes is ColorOne. Default clBlack;
 ShapesTShape:     TShapeType;     Shapes of Tetris type. Default stRoundRect;
 ShapesTBrushStyle:TBrushStyle;    Shapes of Tetris brush style. Default bsSolid;
 ShowScoresTime:   Boolean;        Show scores and/or time. If True, caption of TGamePan shows an amount of taking scores. Default True;
 TCoeff:           Integer;        Tetriss coefficient, to multiply deleted lines number. default 1;
 TRows:            Word;           Number of Tetriss matrix rows. default 20;
 TColumns:         Word;           Number of Tetriss matrixs columns. default 10;
 WidthTShapesPen:  Integer;        Width of Tetriss shapes pen. default 1;

Events:
-------

 OnArcanoidEndLevel: TNotifyEvent; Occurs when Arcanoid games's level is end;
 OnArcnoidTime:      TNotifyEvent; Occurs every 0.1 sec, if State:=Arcanoid and Start:=True;
 OnArcanoidDelete:   TNotifyEvent; Occurs when Arcanoid's shape is deleting;
 OnArcanoidContact:  TNotifyEvent; Occurs when Arcanoid's ball contacts with the footer;
 OnArcanoidOver:     TNotifyEvent; Occurs when the Arcanoid game is over;
 OnFiguresMove:      TNotifyEvent; Occurs when Figure moves or rotates;	
 OnFiguresTime:      TNotifyEvent; Occurs every 0.1 sec, if State:=Figures and Start:=True;
 OnFiguresOver:      TNotifyEvent; Occurs when Figures game is over;
 OnScrambleMove:     TNotifyEvent; Occurs when Scramble button moves;	
 OnScrambleTime:     TNotifyEvent; Occurs every 0.1 sec, if State:=Scramble and Start:=True;
 OnScrambleOver:     TNotifyEvent; Occurs when the Scramble game is over;
 OnTetrisDeleteLine: TNotifyEvent; Occurs when in Tetris line of shapes is deleting;
 OnTetrisContact:    TNotifyEvent; Occurs when Tetriss shape contacts with the unmoveable shape or the footer;
 OnTetrisSet:        TNotifyEvent; Occurs when Tetris gererates the NextTShape or user sets it;   
 OnTetrisTime:       TNotifyEvent; Occurs every 0.1 sec, if State:=Tetris and Start:=True;
 OnTetrisOver:       TNotifyEvent; Occurs when the Tetris game is over;

_______________________________________________________________


All questions, comments and criticisms are welcome. 

Regards

Alex Gogava

E-Mail     alex@argosoft.com

http://www.argosoft.com/games/  

_______________________________________________________________