Please can anyone help me? I want to know how to let the game know what plain the mouse is pointing to. By the way I am using DarkBASIC Classic. This code might make it easier to see:
`load image commands(not used)
`load image "land.bmp",1
`load image "dessert.bmp",2
`load image "water.bmp",3
`load image "forrest.bmp",4
`hide the mouse
hide mouse
`declare object variable
b = 1
`turn sync on
sync on
`set the backdrop to black
backdrop on
color backdrop 0
`begin the loop making the x tiles of the game
for x = 0 to 9
`begin the loop making the z tiles of the game
for z = 0 to 9
`read the data
read a
`make and rotate the object
make object plain b,50,50 ; position object b,x*50,0,z*50 ; xrotate object b,90
`texture the object the specified color(not used)
color object b,rgb(a*50,a*50,a*50)
`increment the object variable
b = b + 1
next z
next x
`get the camera positioned correctly
position camera 250,100,250
turn camera right 45
pitch camera down 20
`begin the main loop
do
`make the camera variable
x# = camera position x()
z# = camera position z()
`check to see if the mouse has gone off the edge
`if so moves the camera
if mousey() = 479 then x# = x# - 1 ; z# = z# - 1
if mousey() = 0 then x# = x# + 1 ; z# = z# + 1
if mousex() = 639 then x# = x# + 1 ; z# = z# - 1
if mousex() = 0 then x# = x# - 1 ; z# = z# + 1
`reposition the camera
position camera x#,100,z#
`make the cursor
ink rgb(255,255,255),0
circle mousex(),mousey(),5
ink 0,0
dot mousex(),mousey()
`sychronize
sync
`end main loop
loop
`data used for generating the tiles(barely used)
data 3,3,3,3,4,4,4,4,4,4
data 3,1,3,3,4,4,4,4,4,4
data 3,4,3,3,4,4,4,4,4,4
data 3,4,3,3,4,4,4,4,4,4
data 3,4,3,3,3,3,3,3,3,3
data 3,4,3,3,3,3,3,3,3,3
data 3,4,3,3,1,1,1,1,1,1
data 3,4,3,3,1,2,2,2,2,2
data 3,1,3,3,1,2,2,2,2,2
data 3,3,3,3,1,2,2,2,2,2
"Computers in the future may weigh no more then
1.5 tons.
- Popular Mechanics, 1949