I am new to DBPro and have searched this forum for an answer already, and it only came up with one, which was to "Browse somebody elses entire FPS game for the code"...
Now this game's code was erm.... Big, to say the least, aswell as confusing for somebody who has only just started learning the ropes...
However, I did have a little look, but my head was just all over the place as I scanned through HUD code, HEALTH code, GUN loading code, LEVEL loading code etc etc... So I decided I would just post my current code here, and see if you guys could help me out...
Thanks
Rem Initialise
sync on : autocam off : hide mouse
Rem Variables
message$ = "Tom's mint game!!!"
Rem Create matrix
Load image "grass1.jpg",1
make matrix 1,10000,10000,200,200
randomize matrix 1, 40
prepare matrix texture 1,1,1,1
Rem Load weapon
load object "mp5.x",2
load image "mp5.dds",2
texture object 2,2
lock object on 2
position object 2,30,-40,60
scale object 2,20000,20000,20000
Rem position camera
position camera 50,get ground height(1, camera position x(),camera position y())+50,50
Rem Main loop
Do
Rem Camera variables
cx# = camera angle x()
cy# = camera angle y()
cz# = camera angle z()
cpx# = camera position x()
cpy# = camera position y()
cpz# = camera position z()
Rem initialise camera
position camera cpx#,get ground height(1,cpx#,cpy#)+50,cpz#
Rem Draw cross-hair and text
text screen width()/2-(text width(message$)/2),screen height()/2-100,message$
ink rgb(255,255,255),0
line screen width()/2-6, screen height()/2, screen width()/2+7 , screen height()/2
line screen width()/2, screen height()/2-6, screen width()/2, screen height()/2+7
ink 0,0
circle screen width()/2,screen height()/2,3
circle screen width()/2,screen height()/2,1
ink rgb(255,255,255),0
Rem Arrow key camera movement
if upkey()=1 then move camera 2
if downkey()=1 then move camera -2
if leftkey()=1
yrotate camera cy#+90
move camera -2
yrotate camera cy#-90
endif
if rightkey()=1
yrotate camera cy#+90
move camera 2
yrotate camera cy#-90
endif
Rem Camera mouse look
cx# = wrapvalue(cx# + mousemovey())
cy# = wrapvalue(cy# + mousemovex())
rotate camera cx#,cy#,cz#
Rem Fire gun if mouse is clicked
if mouseclick()=1 then text 100,100,"BANG! _Placeholder for main code_"
Rem Output to screen
sync
loop