sorry.. that isnt it either...
What I'm trying to do is make it to where the player can shoot the bullet in either the up down left or right directions using a basic flag system (fire_angle) there are four diferent flags for the four diferent directions... I have changed the code up a bit sinse last night.. I'll post the entire code so everyone can see what I'm going for...
Global fire_angle=1
Type coin
Field entity
End Type
Type rchip
Field entity
End Type
Type gchip
Field entity
End Type
Type bchip
Field entity
End Type
Type rdoor
Field entity
End Type
Type gdoor
Field entity
End Type
Type bdoor
Field entity
End Type
Type breaker
End Type
Type bullet
Field entity
Field direct
End Type
Type enemy
End Type
Graphics3D 800,600,16,1
Global r_chip=CreateImage(16,16,2)
Global g_chip=CreateImage(16,16,2)
Global b_chip=CreateImage(16,16,2)
SetBuffer ImageBuffer(r_chip,0)
Color 50,0,0
Rect 0,0,16,16,2
Color 255,255,255
Rect 0,0,16,16,0
SetBuffer ImageBuffer(r_chip,1)
Color 100,0,0
Rect 0,0,16,16,2
Color 255,255,255
Rect 0,0,16,16,0
SetBuffer ImageBuffer(g_chip,0)
Color 0,50,0
Rect 0,0,16,16,2
Color 255,255,255
Rect 0,0,16,16,0
SetBuffer ImageBuffer(g_chip,1)
Color 0,100,0
Rect 0,0,16,16,2
Color 255,255,255
Rect 0,0,16,16,0
SetBuffer ImageBuffer(b_chip,0)
Color 0,0,50
Rect 0,0,16,16,2
Color 255,255,255
Rect 0,0,16,16,0
SetBuffer ImageBuffer(b_chip,1)
Color 0,0,100
Rect 0,0,16,16,2
Color 255,255,255
Rect 0,0,16,16,0
Const type_bob=1
Const type_coin=2
Const type_rchip=3
Const type_gchip=4
Const type_bchip=5
Const type_rdoor=6
Const type_gdoor=7
Const type_bdoor=8
Const type_breaker=9
Const type_enemy=10
Const type_bullet=11
Const type_wall=12
tfloor=CreateTexture(64,64)
bobtex=CreateTexture(64,64)
SetBuffer TextureBuffer(bobtex)
For x=0 To 63
For y=0 To 63
Color Rnd(0,100),Rnd(0,100),0
Plot x,y
Next
Next
SetBuffer TextureBuffer(tfloor)
For x=0 To 31
For y=0 To 31
Color Rnd(0,100),0,0
Plot x,y
Color 200,200,200
Rect 0,0,32,32,0
Next
Next
For x=32 To 63
For y=0 To 31
Color 0,0,Rnd(0,100)
Plot x,y
Color 200,200,200
Rect 32,0,32,32,0
Next
Next
For x=32 To 63
For y=32 To 63
Color Rnd(0,100),0,0
Plot x,y
Color 200,200,200
Rect 32,32,32,32,0
Next
Next
For x=0 To 31
For y=32 To 63
Color 0,0,Rnd(0,100)
Plot x,y
Color 200,200,200
Rect 0,32,32,32,0
Next
Next
SetBuffer BackBuffer()
Viewport 10,10,780,480
Global bob=CreateSphere()
Global coin=CreateSphere()
Global redchip=CreateCube()
Global bluechip=CreateCube()
Global greenchip=CreateCube()
Global reddoor=CreateCube()
Global greendoor=CreateCube()
Global bluedoor=CreateCube()
Global wall=CreateCube()
Global breakwall=CreateCube()
Global bullet=CreateSphere()
Global enemy=CreateCone()
EntityType bob,type_bob
EntityType coin,type_coin
EntityType redchip,type_rchip
EntityType greenchip,type_gchip
EntityType bluechip,type_bchip
EntityType reddoor,type_rdoor
EntityType greendoor,type_gdoor
EntityType bluedoor,type_bdoor
EntityType wall,type_wall
EntityType breakwall,type_breaker
EntityType bullet,type_bullet
EntityType enemy,type_enemy
Collisions type_bob,type_coin,2,1
Collisions type_bob,type_rchip,2,1
Collisions type_bob,type_gchip,2,1
Collisions type_bob,type_bchip,2,1
Collisions type_bob,type_rdoor,2,1
Collisions type_bob,type_gdoor,2,1
Collisions type_bob,type_bdoor,2,1
EntityTexture bob,bobtex
EntityColor coin,200,200,0
EntityColor redchip,100,0,0
EntityColor bluechip,0,0,100
EntityColor greenchip,0,100,0
EntityColor reddoor,100,0,0
EntityColor greendoor,0,100,0
EntityColor bluedoor,0,0,100
EntityColor wall,100,100,50
EntityColor breakwall,100,100,0
EntityColor bullet,200,0,0
EntityColor enemy,100,50,50
ScaleEntity bob,.9,.9,.9
ScaleEntity enemy,.9,.9,.9
ScaleEntity coin,.1,.5,.5
ScaleEntity redchip,.1,.5,.5
ScaleEntity greenchip,.1,.5,.5
ScaleEntity bluechip,.1,.5,.5
ScaleEntity bullet,.5,.5,.5
EntityShininess coin,100
EntityShininess redchip,50
EntityShininess greenchip,50
EntityShininess bluechip,50
HideEntity coin
HideEntity redchip
HideEntity greenchip
HideEntity bluechip
HideEntity reddoor
HideEntity greendoor
HideEntity bluedoor
HideEntity wall
HideEntity breakwall
HideEntity bullet
HideEntity enemy
cam=CreateCamera(bob)
light=CreateLight(2)
world=CreatePlane()
EntityTexture world,tfloor
ScaleTexture tfloor,4,4
rflect=CreateMirror()
EntityAlpha world,.80
PositionEntity cam,0,5,-10
PositionEntity light,0,5,-3
PositionEntity bob,0,1,0
LightRange light,5
AmbientLight 100,100,100
CameraClsColor cam,0,50,100
CameraFogColor cam,0,50,100
CameraFogMode cam,1
CameraFogRange cam,5,40
PointEntity cam,bob
EntityParent cam,bob
EntityParent light,bob
For x=1 To 5
rc.rchip = New rchip
rc\entity=CopyEntity(redchip)
PositionEntity rc\entity,x*2,1,0
gc.gchip = New gchip
gc\entity=CopyEntity(greenchip)
PositionEntity gc\entity,x*2,1,2
bc.bchip = New bchip
bc\entity=CopyEntity(bluechip)
PositionEntity bc\entity,x*2,1,4
Next
For x=0 To 5
For y=0 To 5
c.coin=New coin
c\entity=CopyEntity(coin)
PositionEntity c\entity,x*2+10,1,y*2+10
Next
Next
rd.rdoor=New rdoor
rd\entity=CopyEntity(reddoor)
PositionEntity rd\entity,0,1,10
gd.gdoor=New gdoor
gd\entity=CopyEntity(greendoor)
PositionEntity gd\entity,5,1,10
bd.bdoor=New bdoor
bd\entity=CopyEntity(bluedoor)
PositionEntity bd\entity,10,1,10
While Not KeyHit(1)
Flip
For c.coin=Each coin
TurnEntity c\entity,0,1,0
Next
For rc.rchip=Each rchip
TurnEntity rc\entity,1,1,1
Next
For gc.gchip=Each gchip
TurnEntity gc\entity,1,1,1
Next
For bc.bchip=Each bchip
TurnEntity bc\entity,1,1,1
Next
For colid=1 To CountCollisions(bob)
For c.coin=Each coin
If CollisionEntity(bob,colid)=c\entity Then HideEntity c\entity: coin_get=coin_get+1
next
Next
;--key chips--------------------------------------------------------------------------
For rc_colid=1 To CountCollisions(bob)
For rc.rchip=Each rchip
If rc_get<1 And CollisionEntity(bob,rc_colid)=rc\entity Then HideEntity rc\entity: rc_get=1
Next
Next
For gc_colid=1 To CountCollisions(bob)
For gc.gchip=Each gchip
If gc_get<1 And CollisionEntity(bob,gc_colid)=gc\entity Then HideEntity gc\entity: gc_get=1
Next
Next
For bc_colid=1 To CountCollisions(bob)
For bc.bchip=Each bchip
If bc_get<1 And CollisionEntity(bob,bc_colid)=bc\entity Then HideEntity bc\entity: bc_get=1
Next
Next
;--doors--------------------------------------------------------------------------
For rd_colid=1 To CountCollisions(bob)
For rd.rdoor=Each rdoor
If rc_get=1 And CollisionEntity(bob,rd_colid)=rd\entity Then HideEntity rd\entity: rc_get=0
Next
Next
For gd_colid=1 To CountCollisions(bob)
For gd.gdoor=Each gdoor
If gc_get=1 And CollisionEntity(bob,gd_colid)=gd\entity Then HideEntity gd\entity: gc_get=0
Next
Next
For bd_colid=1 To CountCollisions(bob)
For bd.bdoor=Each bdoor
If bc_get=1 And CollisionEntity(bob,bd_colid)=bd\entity Then HideEntity bd\entity: bc_get=0
Next
Next
If KeyDown(200) Then MoveEntity bob,0,0,.1: RotateMesh bob,3,0,0: fire_angle=1
If KeyDown(208) Then MoveEntity bob,0,0,-.1: RotateMesh bob,-3,0,0: fire_angle=2
If KeyDown(205) Then MoveEntity bob,.1,0,0: RotateMesh bob,0,0,-3: fire_angle=3
If KeyDown(203) Then MoveEntity bob,-.1,0,0 RotateMesh bob,0,0,3: fire_angle=4
If KeyHit(54) Then create_bullet
For b.bullet=Each bullet
If b\direct=1 Then update_bullet_up
If b\direct=2 Then update_bullet_down
If b\direct=3 Then update_bullet_left
If b\direct=4 Then update_bullet_right
Next
Viewport 0,0,800,600
Cls
Color 255,255,255
Text 716,493,"Key Chips"
DrawImage r_chip,716,515,rc_get
DrawImage g_chip,745,515,gc_get
DrawImage b_chip,776,515,bc_get
Text 10,493,"Coins: "+coin_get
Color 255,255,255
Rect 9,9,782,482
UpdateWorld
RenderWorld
Wend
End
Function create_bullet()
b.bullet=New bullet
b\entity=CopyEntity(bullet)
If fire_angle=1 Then b\direct=1
If fire_angle=2 Then b\direct=2
If fire_angle=3 Then b\direct=3
If fire_angle=4 Then b\direct=4
PositionEntity b\entity,EntityX(bob),EntityY(bob),EntityZ(bob)
End Function
Function update_bullet_up()
For b.bullet=Each bullet
MoveEntity b\entity,0,0,1
Next
End Function
Function update_bullet_down()
For b.bullet=Each bullet
MoveEntity b\entity,0,0,-1
Next
End Function
Function update_bullet_left()
For b.bullet=Each bullet
MoveEntity b\entity,1,0,0
Next
End Function
Function update_bullet_right()
For b.bullet=Each bullet
MoveEntity b\entity,-1,0,0
Next
End Function
if anybody can help me to get my four point flag system working so I can shoot right, I'd be very thankful!