I'm making a version of 3D tic-tac-toe and I want to be able to select where to place the next move useing the left mouse click.
I already have the easy things done, 3d array to keep track of which player owns what spots and a 3d array of cubes also. I also have it so when you right click and move the mouse the camera will rotate around the cube of cubes.
Any help on how I can finish this or make it any easier will be much appreciated.
Graphics3D 800,600,0,2
SetBuffer = BackBuffer()
Dim spot(2,2,2)
Dim player(2,2,2)
pivot = CreatePivot()
camera = CreateCamera()
light = CreateLight()
PositionEntity camera,0,0,-10
Xtex = LoadTexture("X.bmp")
Otex = LoadTexture("O.bmp")
Blank = LoadTexture("Blank.bmp")
For x = 0 To 2
For y = 0 To 2
For z = 0 To 2
spot(x,y,z) = CreateCube(pivot)
PositionEntity spot(x,y,z), x*2-2, y*2-2, z*2-2
EntityTexture spot(x,y,z), Blank
player(x,y,z) = 0
Next
Next
Next
While (Not KeyDown(1))
Cls
If MouseDown(2)
rx = MouseX() / 2
ry = MouseY() / 2
EndIf
RotateEntity pivot,rx,ry,0
RenderWorld
Flip
Wend
End
I already have the easy things done, 3d array to keep track of which player owns what spots and a 3d array of cubes also. I also have it so when you right click and move the mouse the camera will rotate around the cube of cubes.
Any help on how I can finish this or make it any easier will be much appreciated.
Graphics3D 800,600,0,2
SetBuffer = BackBuffer()
Dim spot(2,2,2)
Dim player(2,2,2)
pivot = CreatePivot()
camera = CreateCamera()
light = CreateLight()
PositionEntity camera,0,0,-10
Xtex = LoadTexture("X.bmp")
Otex = LoadTexture("O.bmp")
Blank = LoadTexture("Blank.bmp")
For x = 0 To 2
For y = 0 To 2
For z = 0 To 2
spot(x,y,z) = CreateCube(pivot)
PositionEntity spot(x,y,z), x*2-2, y*2-2, z*2-2
EntityTexture spot(x,y,z), Blank
player(x,y,z) = 0
Next
Next
Next
While (Not KeyDown(1))
Cls
If MouseDown(2)
rx = MouseX() / 2
ry = MouseY() / 2
EndIf
RotateEntity pivot,rx,ry,0
RenderWorld
Flip
Wend
End