Gangsta Software AB


0708-41 15 84


info@gangsta.se

     Home | Gangsta Consulting | Gangsta Products | Gangsta Network  
  Gangsta Products | Pong BETA | For developers (English)

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.


initAI

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



setName

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



updateAI

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


    Download

Pong 0.8


Info

Version history
Instructions
For developers


News

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)


   
Language
    
 
     Home | Gangsta Consulting | Gangsta Products | Gangsta Network