| 1 |
# from https://raw.githubusercontent.com/ring-lang/ring/master/applications/tictactoe3d/tictactoe3d.ring |
| 2 |
|
| 3 |
/* |
| 4 |
** |
| 5 |
** Game : TicTacToe 3D |
| 6 |
** Date : 2017/08/30 |
| 7 |
** Author : Mahmoud Fayed <[email protected]> |
| 8 |
** |
| 9 |
** Note : The CheckWinner() function is |
| 10 |
** written by Abdulrahman Mahmoud |
| 11 |
** See ring/applications/tictactoe |
| 12 |
** |
| 13 |
*/ |
| 14 |
|
| 15 |
# Load Libraries |
| 16 |
load "gamelib.ring" # RingAllegro Library |
| 17 |
load "opengl21lib.ring" # RingOpenGL Library |
| 18 |
|
| 19 |
#============================================================== |
| 20 |
# To Support macOS |
| 21 |
al_run_main() |
| 22 |
func al_game_start # Called by al_run_main() |
| 23 |
main() # Now we call our main function |
| 24 |
#============================================================== |
| 25 |
|
| 26 |
func main |
| 27 |
new TicTacToe3D { |
| 28 |
start() |
| 29 |
} |
| 30 |
|
| 31 |
class TicTacToe3D from GameLogic |
| 32 |
|
| 33 |
FPS = 120 |
| 34 |
TITLE = "TicTacToe 3D" |
| 35 |
ICON = "image/o.png" |
| 36 |
|
| 37 |
oBackground = new GameBackground |
| 38 |
oGameSound = new GameSound |
| 39 |
oGameCube = new GameCube |
| 40 |
oGameOver = new GameOver |
| 41 |
oGameInterface = new GameInterface |
| 42 |
|
| 43 |
func loadresources |
| 44 |
oGameOver.loadresources() |
| 45 |
oGameSound.loadresources() |
| 46 |
oBackGround.loadresources() |
| 47 |
oGameCube.loadresources() |
| 48 |
|
| 49 |
func destroyResources |
| 50 |
oGameOver.destroyResources() |
| 51 |
oGameSound.destroyResources() |
| 52 |
oBackGround.destroyResources() |
| 53 |
oGameCube.destroyResources() |
| 54 |
|
| 55 |
func drawScene |
| 56 |
oBackground.update() |
| 57 |
oGameInterface.update(self) |
| 58 |
|
| 59 |
func MouseClickEvent |
| 60 |
oGameInterface.MouseClickEvent(self) |