Okay, although this hasn't actually progressed since ages ago, here it is so far.
sync on
sync rate 30
hide mouse
`set up lights and stuff
set ambient light 5
`set game stats
linesight=500
StatSight=100
`set character stats
PlrHealth=100
Plr2Health=100
`player
make object cube 1,5
color object 1,RGB(0,0,225)
position object 1,0,5,0
remstart
`player2
make object cube 2,5
color object 2,RGB(0,0,150)
position object 2,0,5,0
remend
`player fog
for a = 0 to 2
make object sphere 20+a,10*a-200
color object 20+a,RGB(200,200,200)
`set object 20+a,1,1,1,0,1,1,1
ghost object on 20+a
next a
`World
`Land
make object plain 100,1000,1000
xrotate object 100,270
`Water
make object plain 101,2000,2000
xrotate object 101,270
position object 101,0,-100,0
`Texture ground
for x=1 to 32
for y=1 to 32
dot x, y, rgb(0,100+rnd(155),0)
next y
next x
get image 1,1,1,32,32
texture object 100,1
SCALE OBJECT TEXTURE 100, 20, 20
`Texture water
for x=1 to 32
for y=1 to 32
dot x, y, rgb(0,0,100+rnd(155))
next y
next x
get image 2,1,1,32,32
texture object 101,2
SCALE OBJECT TEXTURE 101, 10, 10
`world objects
`Trees
for a = 200 to 300
make object cone a,20
position object a,-500+rnd(1000),11,-500+rnd(1000)
color object a,RGB(0,200,0)
next a
`Texture trees
for x=1 to 10
for y=1 to 10
dot x, y, rgb(0,200+rnd(55),0)
next y
next x
get image 3,1,1,10,10
for a = 200 to 300
texture object a,3
SCALE OBJECT TEXTURE a, 2, 2
next a
`Enemy
for a = 500 to 599
make object cube a,5
color object a,RGB(0,150,100)
position object a,-500+rnd(1000),5,-500+rnd(1000)
yrotate object a, rnd(360)
next a
`set enemy stats
dim MonsterHealth(100)
for a = 1 to 100
MonsterHealth(a)=20
next a
`Buildings
MakeDoor(301,20,0,20)
`BEGIN LOOP********************************************************************************
do
set cursor 10,10
print screen fps()
`Switch mapmode
if shiftkey()=1
mapmode=1
else
mapmode=0
endif
if mapmode=1
if upkey()=1
yrotate object 1,curveangle(360,object angle y(1),10)
move object 1,1
endif
if downkey()=1
yrotate object 1,curveangle(180,object angle y(1),10)
move object 1,1
endif
if leftkey()=1
yrotate object 1,curveangle(270,object angle y(1),10)
move object 1,1
endif
if rightkey()=1
yrotate object 1,curveangle(90,object angle y(1),10)
move object 1,1
endif
else
if upkey()=1
move object 1,1
endif
if downkey()=1
move object 1,-1
endif
if leftkey()=1
move object left 1,1
endif
if rightkey()=1
move object right 1,1
endif
endif
if mapmode=0
`Position the camera
oldcAY# = cAY#
cAY# = WrapValue(cAY#+MousemoveX()*0.2)
Rem Rotate camera with mouse movement
YRotate camera CurveAngle(cAY#,oldcAY#,24)
YRotate object 1,CurveAngle(cAY#,oldcAY#,24)
rem position camera at the position of the players sliding sphere
set camera to follow object position x(1),object position y(1),object position z(1),object angle y(1),60,30,10,1
point camera object position x(1),object position y(1),object position z(1)
else
`Position the camera
set camera to follow object position x(1),object position y(1),object position z(1),0,60,1000,100,1
point camera object position x(1),object position y(1),object position z(1)
endif
`Gosubs
gosub WaterMovement
gosub FogMovement
gosub LineOfSight
gosub DisplayStats
gosub MoveBadies
sync
loop
`END OF LOOP******************************************************************************
LineOfSight:
for a = 200 to 300
if object exist(a)
if Object position x(1)=<Object position x(a)+linesight
if Object position x(1)=>Object position x(a)-linesight
if Object position y(1)=<Object position y(a)+linesight
if Object position y(1)=>Object position y(a)-linesight
if Object position z(1)=<Object position z(a)+linesight
if Object position z(1)=>Object position z(a)-linesight
show object a
endif
endif
endif
endif
endif
endif
if Object position x(1)=>Object position x(a)+linesight
hide object a
endif
if Object position x(1)=<Object position x(a)-linesight
hide object a
endif
if Object position y(1)=>Object position y(a)+linesight
hide object a
endif
if Object position y(1)=<Object position y(a)-linesight
hide object a
endif
if Object position z(1)=>Object position z(a)+linesight
hide object a
endif
if Object position z(1)=<Object position z(a)-linesight
hide object a
endif
endif
next a
Return
WaterMovement:
position object 101,object position x(1),object position y(1)-100,object position z(1)
scroll object texture 101,0.001,0.001
Return
FogMovement:
for a = 20 to 22
position object a,object position x(1),object position y(1),object position z(1)
next a
Return
DisplayStats:
if controlkey()=1
if object in screen(1)
set cursor OBJECT SCREEN X(1)-30,OBJECT SCREEN Y(1)
Print "HP: ",PlrHealth
endif
remstart
if object in screen(2) and OBJECT SCREEN X(2)=>30 and OBJECT SCREEN X(2)=<610 and OBJECT SCREEN Y(2)=>30 and OBJECT SCREEN Y(2)=<450
set cursor OBJECT SCREEN X(2)-15,OBJECT SCREEN Y(2)
Print "HP: ",Plr2Health
endif
remend
for a = 500 to 600
if object exist(a)
if Object position x(1)=<Object position x(a)+StatSight
if Object position x(1)=>Object position x(a)-StatSight
if Object position y(1)=<Object position y(a)+StatSight
if Object position y(1)=>Object position y(a)-StatSight
if Object position z(1)=<Object position z(a)+StatSight
if Object position z(1)=>Object position z(a)-StatSight
if object in screen(a) and OBJECT SCREEN X(a)=>30 and OBJECT SCREEN X(a)=<610 and OBJECT SCREEN Y(a)=>30 and OBJECT SCREEN Y(a)=<450
set cursor OBJECT SCREEN X(a)-15,OBJECT SCREEN Y(a)
Print "HP: ",MonsterHealth(a-499)
endif
endif
endif
endif
endif
endif
endif
endif
next a
endif
Return
MoveBadies:
for a = 500 to 600
if object exist(a)
if Object position x(a)=<500
if Object position x(a)=>-500
if Object position z(a)=<500
if Object position z(a)=>-500
move object a,0.5
endif
endif
endif
endif
if Object position x(a)=>500
if object angle y(a)=>90 or object angle y(a)=<270
yrotate object a, object angle y(a)+wrapvalue(90)
move object a,1
else
yrotate object a, object angle y(a)+wrapvalue(-90)
move object a,1
endif
endif
if Object position x(a)=<-500
if object angle y(a)=<180
yrotate object a, object angle y(a)+wrapvalue(90)
move object a,1
else
yrotate object a, object angle y(a)+wrapvalue(-90)
move object a,1
endif
endif
if Object position z(a)=>500
if object angle y(a)=<180
yrotate object a, object angle y(a)+wrapvalue(90)
move object a,1
else
yrotate object a, object angle y(a)+wrapvalue(-90)
move object a,1
endif
endif
if Object position z(a)=<-500
if object angle y(a)=>90 or object angle y(a)=<270
yrotate object a, object angle y(a)+wrapvalue(90)
move object a,1
else
yrotate object a, object angle y(a)+wrapvalue(-90)
move object a,1
endif
endif
endif
next a
Return
function MakeDoor(objsnum,x,y,z)
make object cube objsnum, 10
make object cube objsnum+1, 10
make object cube objsnum+2, 10
make object cube objsnum+3, 10
color object objsnum,RGB(120,100,50)
color object objsnum+1,RGB(120,100,50)
color object objsnum+2,RGB(120,100,50)
color object objsnum+3,RGB(120,100,50)
scale object objsnum,10,100,100
scale object objsnum+1,10,100,100
scale object objsnum+2,100,100,10
scale object objsnum+3,100,100,10
position object objsnum,x+5,y+5,z
position object objsnum+1,x-5,y+5,z
position object objsnum+2,x,y+5,z+5
xrotate object objsnum+3,270
position object objsnum+3,x,y+10,z
endfunction
Infra-Dark
Bring the 20 liners back!
#coding, like coding, but with a #