I have no clue?? every time i try to add collisions to this game it doesnt work no mader how many tries!!
<code>
Graphics3D 640,480,16,3
SetBuffer=BackBuffer()
Global campivot=CreateCube() ; create pivot for camera
Global camera=CreateCamera() ; create camera (!!!)
; ---------------------- THIS IS ALL JUST TO POPULATE THE WORLD WITH SOME RUBBISH ---------------
Global light=CreateLight()
Global player=CreateCube() ; create simple player
Global plane=CreatePlane() ; create simple floor
PositionEntity player,0,0,-10
MoveEntity player,0,1,0
; Create texture of size 256x256
tex=CreateTexture(256,256)
; Set buffer - texture buffer
SetBuffer TextureBuffer(tex)
; Clear texture buffer with background white color
For i=1 To 10
Color Rnd(0,255),Rnd(0,255),Rnd(0,255)
Rect Rnd(0,256),Rnd(0,256),Rnd(0,256),Rnd(0,256)
Next
; Texture cube with texture
EntityTexture plane,tex
EntityTexture player,tex
; Set buffer - backbuffer
SetBuffer BackBuffer()
While Not KeyHit(1)
If KeyDown(200) Then
MoveEntity player,0,0,.2
End If
If KeyDown(203) TurnEntity player,0,1,0
If KeyDown(205) TurnEntity player,0,-1,0
If KeyDown(208) MoveEntity player,0,0,-.1
chasecam(camera,player,.02,8,3,0,0)
RenderWorld
Flip
Wend
End
Function chasecam(cam,ent,cspeed#,dist#,hite#,xrot#,tilt#)
TFormPoint 0,hite#,-dist#,ent,0
cx#=(TFormedX()-EntityX(cam))*cspeed#
cy#=(TFormedY()-EntityY(cam))*cspeed#
cz#=(TFormedZ()-EntityZ(cam))*cspeed#
TranslateEntity cam,cx,cy,cz
PointEntity cam,ent
RotateEntity cam,xrot#,EntityYaw(cam),tilt#
End Function
</code>
thats a no media crapy version of my game!!i'm giving credit to maker! and i also need a gravity
stupid code script thing!
I want the player to collide with campivot
<code>
Graphics3D 640,480,16,3
SetBuffer=BackBuffer()
Global campivot=CreateCube() ; create pivot for camera
Global camera=CreateCamera() ; create camera (!!!)
; ---------------------- THIS IS ALL JUST TO POPULATE THE WORLD WITH SOME RUBBISH ---------------
Global light=CreateLight()
Global player=CreateCube() ; create simple player
Global plane=CreatePlane() ; create simple floor
PositionEntity player,0,0,-10
MoveEntity player,0,1,0
; Create texture of size 256x256
tex=CreateTexture(256,256)
; Set buffer - texture buffer
SetBuffer TextureBuffer(tex)
; Clear texture buffer with background white color
For i=1 To 10
Color Rnd(0,255),Rnd(0,255),Rnd(0,255)
Rect Rnd(0,256),Rnd(0,256),Rnd(0,256),Rnd(0,256)
Next
; Texture cube with texture
EntityTexture plane,tex
EntityTexture player,tex
; Set buffer - backbuffer
SetBuffer BackBuffer()
While Not KeyHit(1)
If KeyDown(200) Then
MoveEntity player,0,0,.2
End If
If KeyDown(203) TurnEntity player,0,1,0
If KeyDown(205) TurnEntity player,0,-1,0
If KeyDown(208) MoveEntity player,0,0,-.1
chasecam(camera,player,.02,8,3,0,0)
RenderWorld
Flip
Wend
End
Function chasecam(cam,ent,cspeed#,dist#,hite#,xrot#,tilt#)
TFormPoint 0,hite#,-dist#,ent,0
cx#=(TFormedX()-EntityX(cam))*cspeed#
cy#=(TFormedY()-EntityY(cam))*cspeed#
cz#=(TFormedZ()-EntityZ(cam))*cspeed#
TranslateEntity cam,cx,cy,cz
PointEntity cam,ent
RotateEntity cam,xrot#,EntityYaw(cam),tilt#
End Function
</code>
thats a no media crapy version of my game!!i'm giving credit to maker! and i also need a gravity
stupid code script thing!
I want the player to collide with campivot