Update TicTacToe 3D - TicTacToe3DGameInterface  Class.
@@ -31,6 +31,7 @@ class TicTacToe3D from TicTacToe3DGameLogic
oGameSound = new GameSound
oGameCube = new GameCube
oGameOver = new GameOver
+ oGameInterface = new TicTacToe3DGameInterface
func loadresources
oGameOver.loadresources()
@@ -46,24 +47,16 @@ class TicTacToe3D from TicTacToe3DGameLogic
func drawScene
oBackground.update()
- prepare()
- cubes()
+ oGameInterface.update(self)
+ func MouseClickEvent
+ oGameInterface.MouseClickEvent(self)
- func Cubes
- oGameCube {
- aGameMap = this.aGameMap
- cube( 5 , -3 , -5 , aGameMap[1][1] )
- cube( 0 , -3 , -5 , aGameMap[1][2] )
- cube( -5 , -3 , -5 , aGameMap[1][3] )
- cube( 5 , 1 , -5 , aGameMap[2][1] )
- cube( 0 , 1 , -5 , aGameMap[2][2] )
- cube( -5 , 1 , -5 , aGameMap[2][3] )
- cube( 5 , 5 , -5 , aGameMap[3][1] )
- cube( 0 , 5 , -5 , aGameMap[3][2] )
- cube( -5 , 5 , -5 , aGameMap[3][3] )
- rotate()
- }
+class TicTacToe3DGameInterface
+
+ func Update oGame
+ prepare()
+ cubes(oGame)
func Prepare
w = 1024 h = 768
@@ -83,7 +76,23 @@ class TicTacToe3D from TicTacToe3DGameLogic
glDepthFunc(GL_LEQUAL)
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)
- func MouseClickEvent
+ func Cubes oGame
+ oGame.oGameCube {
+ aGameMap = oGame.aGameMap
+ cube( 5 , -3 , -5 , aGameMap[1][1] )
+ cube( 0 , -3 , -5 , aGameMap[1][2] )
+ cube( -5 , -3 , -5 , aGameMap[1][3] )
+ cube( 5 , 1 , -5 , aGameMap[2][1] )
+ cube( 0 , 1 , -5 , aGameMap[2][2] )
+ cube( -5 , 1 , -5 , aGameMap[2][3] )
+ cube( 5 , 5 , -5 , aGameMap[3][1] )
+ cube( 0 , 5 , -5 , aGameMap[3][2] )
+ cube( -5 , 5 , -5 , aGameMap[3][3] )
+ rotate()
+ }
+
+ func MouseClickEvent oGame
+ oGame {
aBtn = Point2Button(Mouse_X,Mouse_Y)
nRow = aBtn[1]
nCol = aBtn[2]
@@ -98,6 +107,7 @@ class TicTacToe3D from TicTacToe3DGameLogic
CheckGameOver()
ok
ok
+ }
Class TicTacToe3DGameLogic from GraphicsAppBase
