| |
Gangsta ProductsPong BETA
The AI's consists of a DLL with three exported
methods. All methods should be declared as C/C++
methods (in Delphi, cdecl).
The 0,0 coordinates are located at the lower
left corner of the playable area.
This method should be called initAI and it's used to initialize the AI. The method should return 1 if ok,
or 0 if any errors occured.
| name |
| initAI |
 |
| parameters |
| piSide (integer) |
Which side the AI is. 0=left, 1=right. |
| piScreenWidth (integer) |
The width of the playable area (in pixels). |
| piScreenHeight (integer) |
The height of the playable area (in pixels). |
| piBallSize (integer) |
The size of the ball (radius). |
| piPaddleWidth (integer) |
The width of the paddle (half). |
| piPaddleHeight (integer) |
The height of the paddle (half). |
| piPaddlePosX (integer) |
The position in pixels from the sides to the center of the paddle. |
 |
| returns |
| integer |
This method should be called setName and it's used to get the name of the AI.
The method should return the name.
| name |
| setName |
 |
| parameters |
| piNameType (integer) |
Type of name. 0=short name (alias), 1=full name. |
 |
| returns |
| PChar |
This method is called everytime the ball has moved. The method should return 1 if you want your paddle to
move up, -1 if you want it to move down and 0 if you don't want to move.
| name |
| updateAI |
 |
| parameters |
| piBallPosX (integer) |
The X coordinate of the ball (center). |
| piBallPosY (integer) |
The Y coordinate of the ball (center). |
| piPaddlePosY (integer) |
The Y coordinate of your paddle (center). |
| piOpponentPosY (integer) |
The Y coordinate of your opponents paddle (center). |
| piScore (integer) |
If anybody scored. 0=noone scored, 1=you scored, -1=your opponent scored. |
 |
| returns |
| integer |
|
|
 |
|
Pong 0.8
Version history
Instructions
For developers
Pong 0.8
Now you can write your own AI for Gangsta Software Pong. (020110)
Projekt Pong
The idea with the Pong project is to create a good Pong AI, and then let two different AI's play against each other. (010720)
|
|
 |
|
|
|