Heres a little test of me playing around with a quicke 3d shooter, I want to work on the server code for something like this, and not much more complicated to start. Well take a look if ya like, here ya go: 3dRocks, 2d is for kids!
Graphics3D 400,300,16,1 ;change to 1 for faster
SetBuffer BackBuffer()
;Set Collision Types as Constants
Const Type_player=1
Const Type_wall=2
light=CreateLight()
RotateEntity light,90,0,0
;Create Base Bullet and resize
bullx=CreateSphere()
ScaleEntity bullx,.5,.5,.5
HideEntity bullx
;create player fighter
model=CreateCube()
EntityType model,1
EntityRadius model,1.25
PositionEntity model,40,1,5
cam=CreateCamera()
PositionEntity cam,40,3,1
;attach the camera pivot
pivot=CreatePivot()
EntityParent pivot,model
EntityParent cam,model
;create a generic checkboard texture used on walls and floor both=need some color
tex=CreateTexture( 256,256 )
;set the texturebuffer to draw on such texture
SetBuffer TextureBuffer( tex )
Color 255,0,0
For x=0 To 256 Step 32
For y=0 To 256 Step 32
Rect x,y,16,16
Next
Next
;reset buffer
SetBuffer BackBuffer()
Cls
;create the floor
Arena=CreateMesh()
Afloor=CreateSurface(Arena)
v1=AddVertex (afloor,0,0,100,0,1)
v2=AddVertex (afloor,100,0,100,1,1)
v3=AddVertex (afloor,100,0,0,1,0)
v4=AddVertex (afloor,0,0,0,0,0)
tri=AddTriangle(afloor,v1,v2,v3)
tri2=AddTriangle(afloor,v1,v3,v4)
EntityTexture arena,tex
EntityRadius arena,1
EntityType arena,Type_floor
;and the four sequential walls
nwall=CreateMesh()
nFloor=CreateSurface(nwall)
v1=AddVertex (nFloor,0,10,0,0,1)
v2=AddVertex (nFloor,0,10,100,1,1)
v3=AddVertex (nFloor,0,0,100,1,0)
v4=AddVertex (nFloor,0,0,0,0,0)
tri=AddTriangle(nFloor,v1,v2,v3)
tri2=AddTriangle(nFloor,v1,v3,v4)
afloor=LoadTexture("c:\blitz\checker2.bmp")
EntityTexture nwall,tex
EntityRadius nwall,1
EntityType nwall,2
UpdateNormals(nwall)
swall=CreateMesh()
sFloor=CreateSurface(swall)
v1=AddVertex (sfloor,100,10,100,0,1)
v2=AddVertex (sfloor,100,10,0,1,1)
v3=AddVertex (sfloor,100,0,0,1,0)
v4=AddVertex (sfloor,100,0,100,0,0)
tri=AddTriangle(sfloor,v1,v2,v3)
tri2=AddTriangle(sfloor,v1,v3,v4)
EntityTexture swall,tex
EntityRadius swall,1
EntityType swall,2
UpdateNormals(swall)
wwall=CreateMesh()
wfloor=CreateSurface(wwall)
v1=AddVertex (wfloor,0,10,100,0,1)
v2=AddVertex (wfloor,100,10,100,1,1)
v3=AddVertex (wfloor,100,0,100,1,0)
v4=AddVertex (wfloor,0,0,100,0,0)
tri=AddTriangle(wfloor,v1,v2,v3)
tri2=AddTriangle(wfloor,v1,v3,v4)
EntityTexture wwall,tex
EntityRadius wwall,1
EntityType wwall,2
UpdateNormals(wwall)
ewall=CreateMesh()
efloor=CreateSurface(ewall)
v1=AddVertex (efloor,100,10,0,0,1)
v2=AddVertex (efloor,0,10,0,1,1)
v3=AddVertex (efloor,0,0,0,1,0)
v4=AddVertex (efloor,100,0,0,0,0)
tri=AddTriangle(efloor,v1,v2,v3)
tri2=AddTriangle(efloor,v1,v3,v4)
EntityTexture ewall,tex
EntityRadius ewall,1
EntityType ewall,2
;update the rest of the normals for light,etc
UpdateNormals(ewall)
UpdateNormals(arena)
UpdateNormals(model)
;enable collisions between player and wall
;note since the player model is moving, if you did collisions 2,1,2,2 it wouldn't work
Collisions 1,2,2,2
While Not KeyHit(1)
;Check NewFire
If KeyDown(57)=True Then ;change If keydown(57) to If keyhit(57) for noncontinous firing
;if fired Create a new bullet and position it at players location
b.bullet=New bullet
b\model=CopyEntity(bullx)
ax#=EntityX(model)
ay#=EntityY(model)
az#=EntityZ(model)
PositionEntity b\model,ax#,ay#,az#
TurnEntity b\model,0,rot#,0
MoveEntity b\model,0,0,3
b\dur=50
;after dur is over, bullet disappears
EndIf
;Read KeyCommands
If KeyDown( 205 )=True Then
rot#=rot#-5
TurnEntity model,0,-5,0 ;next line stores rotation of player model
If rot#<0 Then rot#=Rot#+360
EndIf
If KeyDown( 203 )=True Then
rot#=rot#+5
TurnEntity model,0,5,0
If rot#>360 Then rot#=rot#-360
EndIf
If KeyDown( 208 )=True Then MoveEntity model,0,0,-1
If KeyDown( 200 )=True Then MoveEntity model,0,0,1
;Update Each Bullet
For b.bullet=Each bullet
MoveEntity b\model,0,0,3
b\dur=b\dur-1
If b\dur<0 Then
FreeEntity b\model
Delete b
EndIf
Next
;check collisions
UpdateWorld
RenderWorld
;I never Did Add life!
Text 10,10,"Life: "+life
Flip
Wend
ClearWorld()
End
Type bullet
Field model
Field dur
End Type