Here's my full code, don't insult it... It's just a bit of the Monster Hunt at the moment and I'm planning to build to much more...
`Load images
Load image "C:stuffmyprojGTTXmonsterwarscrosshair.bmp",2
Load image "C:stuffmyprojGTTXmonsterwarsHud.bmp",3
Load image "C:Program FilesDark Basic SoftwareDarkMATTERModels3DSSkyBoxessky11sky11_f.BMP",5
Load image "C:Program FilesDark Basic SoftwareDarkMATTERModels3DSPeopleAlien Mutantalien2.bmp",6
Load image "C:stuffmyprojGTTXBulletTEXTURE.bmp",7
Load image "C:stuffmyprojGTTXMP5hud.bmp",8
Load image "C:stuffmyprojGTTXColthud.bmp",11
Load image "C:stuffmyprojGTTXfistshud.bmp",12
Load image "C:Program FilesDark Basic SoftwareDarkMATTERModels3DSWeaponscoltcolt.bmp",10
`Variables and stuff
rem hide both guns - when a=3 both guns hidden (see a=3 below) and enter melee fists
a=3
`Load music
Load music "C:stuffHOTS2.mid",1
`PLay music
Play music 1
Loop music 1
`Set Up Game Statistics
Sync On
Sync Rate 120
Backdrop On
Fog on
Fog Color RGB(29,145,211)
Fog distance 2000
Color Backdrop RGB(29,150,205)
Autocam off
hide mouse
Make light 1
Set light range 1,200
Set ambient light 12
`---------
`Make HUD 1
Make object plain 200,1.9,1
Position object 200,-1.9,1.7,4
Lock object on 200
Texture object 200,3
`Make HUD2
Make object plain 201,1,.5
Position object 201,2.65,2,4
Lock object on 201
Texture object 201,8
`Make HUD3
Make object plain 202,1,.5
Position object 202,2.65,1.5,4
Lock object on 202
Texture object 202,11
`Make HUD4
Make object plain 203,1,.5
Position object 203,2.65,1,4
Lock object on 203
Texture object 203,12
`Make and texture matrix
Make matrix 1,5000,5000,20,20
Load image "C:Program FilesDark Basic SoftwareDarkMATTERTexturesBMPNaturalgrass2.BMP",1
Prepare matrix texture 1,1,1,1
Randomize matrix 1,250
Fill matrix 1,0,1
Position matrix 1,500,700,700
`--------------------
`CROSSHAIR
make object plain 99,2,2
texture object 99,2
Ghost object on 99
set object 99,1,0,1 :`set the object transparency. If this doesn't work will, use the "ghost on" command.
position object 99,0,0,25
fix object pivot 99
lock object on 99
`Create Character
`Create MP5
Load object "C:Program FilesDark Basic SoftwareDarkMATTERModels3DSWeaponsmp5H-MP5-Static.3DS",1
XRotate Object 1,0
Fix object pivot 1
Scale object 1,3000,3000,3000
position object 1,0,-7,10
Lock object on 1
Load image "C:Program FilesDark Basic SoftwareDarkMATTERModels3DSWeaponsmp5mp5.BMP",4
Texture object 1,4
`Create Colt 47
Load object "C:Program FilesDark Basic SoftwareDarkMATTERModels3DSWeaponscoltH-Colt-Static.3DS",10
Texture object 10,10
XRotate Object 10,0
Fix object pivot 10
Scale object 10,3000,3000,3000
position object 10,0,-7,10
Lock object on 10
`Create bullet
Load object "bullet.3DS",5
Texture object 5,7
Hide object 5
Scale object 5,90,90,90
Xrotate object 5,90
Fix object pivot 5
`Position Camera
Position Camera 550,700,500
`CHARACTER MOVEMENT AND MOUSE LOOK
Do
`POsitioning the camera
OldCamAngleY# = CameraAngleY#
OldCamAngleX# = CameraAngleX#
CameraAngleY# = WrapValue(CameraAngleY#+MousemoveX()*0.2)
CameraAngleX# = WrapValue(CameraAngleX#+MousemoveY()*0.2)
Position Camera 550,700,500
`Input control of Camera
If upkey()=1
XTest# = Newxvalue(X#,CamerAngleY#,10)
ZTest# = Newzvalue(Z#,CamerAngleY#,10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Downkey()=1
XTest# = Newxvalue(X#,Wrapvalue(CamerAngleY#-180),10)
ZTest# = Newzvalue(Z#,Wrapvalue(CamerAngleY#-180),10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
`strafing
If Leftkey()=1
XTest# = Newxvalue(X#,Wrapvalue(CameraAngleY#-90),10)
ZTest# = Newzvalue(Z#,Wrapvalue(CameraAngleY#-90),10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Rightkey()=1
XTest# = Newxvalue(X#,Wrapvalue(CameraAngleY#+90),10)
ZTest# = Newzvalue(Z#,Wrapvalue(CameraAngleY#+90),10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
cTestX#=WrapValue(cameraAngleX#-180)
if cTestX# > 225 then cameraAngleX#=45
if cTestX# < 135 then cameraAngleX#=315
Yrotate camera CurveAngle(CameraAngleY#,OldCameraAngleY#,24)
Xrotate camera CurveAngle(CameraAngleX#,OldCameraAngleX#,24)
Y# = get ground height(1,X#,Z#)
Position Camera X#,Y#+50,Z#
` Rotate camera
if CameraAngleX#>270
if CameraAngleX#-270 > 90 then CameraAngleX#=270
else
if CameraAngleX# > 90 and CameraAngleX#-270<270 then CameraAngleX#=90
endif
YRotate camera CurveAngle(CameraAngleY#,oldCameraAngleY#,24)
XRotate camera CurveAngle(CameraAngleX#,oldCameraAngleX#,24)
`Changing guns
rem a=3 - hide both guns
if a=3
hide object 1
hide object 10
ghost object on 201
ghost object on 202
Ghost object off 203
endif
rem a=1 - show gun 1
if a=1
show object 1
hide object 10
ghost object off 201
ghost object on 202
ghost object on 203
gosub shootingbullets
endif
rem a=2 - show gun 2
if a=2
show object 10
hide object 1
ghost object on 201
Ghost object off 202
ghost object on 203
gosub shootingbullets
endif
if keystate(2)=1
a=1
endif
if keystate(3)=1
a=2
endif
if keystate(4)=1
a=3
endif
Sync
Loop
Shootingbullets:
`Shooting Bullets
if Mouseclick()=1 and BulletLife=0
Position object 5,X#,Y#+47,Z#
Set object to camera orientation 5
BulletLife =25
show object 5
Endif
If BulletLife > 0
Dec BulletLife
Move object 5,20
if BulletLife = 0 then Hide object 5
Endif
REturn
HandtoHandMELEE:
`The code will be here when it's ready
Return
P.S
Replace the media with your own or something, cuz I'm not giving it out yet...
EDIT: This is an altered cod in which the matrix is no longer positioned at 0,0,0...
Got anime?
I do.