i've made a simple online game where 2 spheres move around. Before you ask the camera and smooth matrix commands aren't mine. What im asking is for someone to test it for me, since i only have one computer. I wont be online but i will leave the exe running in a game called pie. I'm working on a chat program but i cant get it to work, but i'm still finding alot of errors so any suggestions would b good
PERFORM CHECKLIST FOR NET CONNECTIONS
for x=1 to checklist quantity()
if checklist string$(x)="Internet TCP/IP Connection For DirectPlay" then a=x
next x
ip$="24.92.123.105"
set net connection a,ip$
perform checklist for net sessions
for asdf=1 to checklist quantity()
print asdf,checklist string$(asdf)
wait 100
next asdf
input "join game (1), Create game (2)", gam
if gam=2
input "gamename: ", gam$
input "player: ",pla$
input "number of players: ",players
input "flag: ",flag
create net game gam$,pla$,players,flag
gosub makeworld
endif
if gam=1
input "which game (use the number): ",game
input "Playername: ",player$
join net game game,player$
endif
cls
sync on
sync rate 100
perform checklist for net players
plyer=checklist quantity()+1
make object sphere plyer,50
do
gosub camera_stuff
sync
loop
function smooth_matrix(number as integer, xsegs as integer, zsegs as integer, iter as integer)
dim heights#(xsegs, zsegs)
for t = 1 to iter
rem store original heights
for z = 0 to zsegs
for x = 0 to xsegs
heights#(x,z) = get matrix height(number, x, z)
next x
next z
for z = 0 to zsegs
for x = 0 to xsegs
count = 0
h1# = 0
h2# = 0
h3# = 0
h4# = 0
h5# = 0
h6# = 0
h7# = 0
h8# = 0
if z < zsegs
if x > 0 then h1# = heights#(x-1,z+1) : inc count
h2# = heights#(x,z+1) : inc count
if x < xsegs then h3# = heights#(x+1,z+1) : inc count
endif
if x > 0 then h4# = heights#(x-1,z) : inc count
if x < xsegs then h5# = heights#(x+1,z) : inc count
if z > 0
if x > 0 then h6# = heights#(x-1,z-1) : inc count
h7# = heights#(x,z-1) : inc count
if x < xsegs then h8# = heights#(x+1,z-1) : inc count
endif
avg# = (h1#+h2#+h3#+h4#+h5#+h6#+h7#+h8#) / count
set matrix height 1, x, z, avg#
next x
next z
next t
undim heights#()
endfunction
makeworld:
make matrix 1, 2000,2000,60,60
randomize matrix 1,200
smooth_matrix(1,60,60,3)
update matrix 1
return
camera_stuff:
oldcx#=cx#
oldcz#=cz#
speed# = 5
position object plyer,camera position x(0),camera position y(0),camera position z(0)
if shiftkey() then speed# = 10
if upkey()=1
cx#=newxvalue(cx#,a#,speed#)
cz#=newzvalue(cz#,a#,speed#)
endif
if downkey()=1
cx#=newxvalue(cx#,a#,-speed#)
cz#=newzvalue(cz#,a#,-speed#)
endif
if leftkey()=1
cx#=newxvalue(cx#,wrapvalue(a#-90.0),speed#)
cz#=newzvalue(cz#,wrapvalue(a#-90.0),speed#)
endif
if rightkey()=1
cx#=newxvalue(cx#,wrapvalue(a#+90.0),speed#)
cz#=newzvalue(cz#,wrapvalue(a#+90.0),speed#)
endif
`if shiftkey() then inc cy#, 2
`if controlkey() then dec cy#, 2
a#=wrapvalue(a#+(mousemovex()/3.0))
cxa#=cxa#+(mousemovey()/3.0)
if cxa#<-90.0 then cxa#=-90.0
if cxa#>90.0 then cxa#=90.0
cy# = get ground height(1,cx#,cz#)
position camera cx#,cy#+50,cz#
rotate camera wrapvalue(cxa#),a#,0
RETURN
parrot