Hi,
I´m a beginner in B3D.
Hir is the Code (I can not so good English I come from Germany)
Graphics3D 640,480
SetBuffer BackBuffer()
Dim Ball(100,4)
SB = LoadSprite("S.bmp"):HideEntity SB
SpriteViewMode SB,4
HandleSprite SB,0,0
EntityAutoFade SB,100,1000
ScaleSprite SB,20,30
cam = CreateCamera()
MoveEntity cam,0,10,-20
EntityType cam,1
CameraClsColor cam,0,128,255
;Plane
Plane = CreatePlane()
Tex1 = LoadTexture("Tex1.bmp")
ScaleTexture Tex1,40,40
EntityType Plane,2
EntityTexture Plane,Tex1
While Not KeyHit(1)
Collisions 1,2,2,2
XM# = MouseXSpeed()
YM# = MouseYSpeed()
TurnEntity cam,0,-(XM#/3),0,True
TurnEntity cam,(YM#/3),0,0
MoveMouse GraphicsWidth()/2,GraphicsWidth()/2
If KeyDown(200) Then MoveEntity cam, 0,0,0.5
If KeyDown(208) Then MoveEntity cam, 0,0,-0.5
If MouseHit(1) Then
Schuss = Schuss + 1
If Schuss = 101 Then Schuss = 1
Ball(Schuss,0) = 1
Ball(Schuss,1) = EntityX(cam)-10
Ball(Schuss,2) = EntityY(cam)
Ball(Schuss,3) = EntityZ(cam)+10
Ball(Schuss,4) = CopyEntity(SB)
EndIf
For I=0 To 100
If Ball(I,0) = 1 Then
MoveEntity Ball(I,4),Ball(I,1),Ball(I,2),Ball(I,3)
Ball(I,3) = Ball(I,3) + 1
EndIf
Next
UpdateWorld
RenderWorld
Flip
Wend
End
Whwn I shoot then shot appears somewhere else. Waht have I made wrong? Thank you for the answers
I´m a beginner in B3D.
Hir is the Code (I can not so good English I come from Germany)
Graphics3D 640,480
SetBuffer BackBuffer()
Dim Ball(100,4)
SB = LoadSprite("S.bmp"):HideEntity SB
SpriteViewMode SB,4
HandleSprite SB,0,0
EntityAutoFade SB,100,1000
ScaleSprite SB,20,30
cam = CreateCamera()
MoveEntity cam,0,10,-20
EntityType cam,1
CameraClsColor cam,0,128,255
;Plane
Plane = CreatePlane()
Tex1 = LoadTexture("Tex1.bmp")
ScaleTexture Tex1,40,40
EntityType Plane,2
EntityTexture Plane,Tex1
While Not KeyHit(1)
Collisions 1,2,2,2
XM# = MouseXSpeed()
YM# = MouseYSpeed()
TurnEntity cam,0,-(XM#/3),0,True
TurnEntity cam,(YM#/3),0,0
MoveMouse GraphicsWidth()/2,GraphicsWidth()/2
If KeyDown(200) Then MoveEntity cam, 0,0,0.5
If KeyDown(208) Then MoveEntity cam, 0,0,-0.5
If MouseHit(1) Then
Schuss = Schuss + 1
If Schuss = 101 Then Schuss = 1
Ball(Schuss,0) = 1
Ball(Schuss,1) = EntityX(cam)-10
Ball(Schuss,2) = EntityY(cam)
Ball(Schuss,3) = EntityZ(cam)+10
Ball(Schuss,4) = CopyEntity(SB)
EndIf
For I=0 To 100
If Ball(I,0) = 1 Then
MoveEntity Ball(I,4),Ball(I,1),Ball(I,2),Ball(I,3)
Ball(I,3) = Ball(I,3) + 1
EndIf
Next
UpdateWorld
RenderWorld
Flip
Wend
End
Whwn I shoot then shot appears somewhere else. Waht have I made wrong? Thank you for the answers