I have a problem here

Blitz3D Forums/Blitz3D Beginners Area/I have a problem here

seferey(Posted 2005) [#1]
day before yesterday i was creating a cube with an image applied to it that auto rotates something like that.

;Set 3D Mode

Graphics3D 800,600

SetBuffer BackBuffer()

;Create a camera

camera=CreateCamera()

;Create a light

light=CreateLight()

;Create a cube

cube=CreateCube()

;load texture

tex=LoadTexture("Winter.jpg")

;make a brush

brush=CreateBrush()

;Apply texture to brush

BrushTexture brush,tex

;and some shininess

BrushShininess brush,1

;paint mesh with brush

PaintMesh cube,brush

While KeyDown(1)

pitch#=0
yaw#=0
roll#=0

If KeyDown(31)=True Then pitch#=-1
If KeyDown(31)=True Then pitch#=1
If KeyDown(31)=True Then yaw#=-1
If KeyDown(31)=True Then yaw#=1
If KeyDown(31)=True Then roll#=-1
If KeyDown(31)=True Then roll#=1

;position cube

PositionEntity cube,0,0,5

;turning object

TurnEntity cube,pitch#,yaw#,roll#

RenderWorld

Flip

Wend

End

I run it that day and it worked fine no errors nothing. Then yesterday came I run it again it loads up a black screen and shuts down very fast. Why is this happening?


seferey(Posted 2005) [#2]
My B3D has been 1.90 for a while now.


markcw(Posted 2005) [#3]
try with(out) the var#, floats should be specified as
floats not integers, i think.


Floyd(Posted 2005) [#4]
The main loop starts like this:

While KeyDown(1)

which says to keep running as long as the escape key is held down.
So the program ends immediately.


seferey(Posted 2005) [#5]
For some reason when I use


While KeyDown(1)

It loads up and quit but when I change it into

While Not KeyHit(1)

It works perfectly no problem's


TartanTangerine (was Indiepath)(Posted 2005) [#6]
Thats not suprising.

While KeyDown(1)


You are telling the main loop to only run when the "Escape" key is pressed.