home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
3D Game Programming for Teens (2nd Edition)
/
3DGPFT2E.iso
/
Source
/
Chapter13
/
demo13-07.bb
< prev
next >
Wrap
Text File
|
2009-01-20
|
1KB
|
56 lines
;demo13-07.bb - Out of Order Traffic Light
;_______________________
Graphics3D 640,480
SetBuffer BackBuffer()
; Create camera
camera=CreateCamera()
;Create light
light=CreateLight()
;Create a cube
cube=CreateCube()
ScaleEntity cube, 0.7,1.7,1
PositionEntity cube, 0,0,5
EntityColor cube, 234,234,23
;Create red light
red=CreateSphere()
PositionEntity red, 0,1.2,4.9
ScaleEntity red, 0.5,0.5,0.5
EntityOrder red,-1
;Create yellow light
yellow=CreateSphere()
PositionEntity yellow, 0,0,4.9
ScaleEntity yellow, 0.5,0.5,0.5
EntityOrder yellow,-1
;Create green light
green=CreateSphere()
PositionEntity green, 0,-1.2,4.9
ScaleEntity green, 0.5,0.5,0.5
EntityOrder green,-1
;The following code makes our program run
While Not KeyDown( 1 )
EntityColor red, Rand(177,255),Rand(0,110),Rand(0,87)
EntityColor yellow, Rand(236,255),Rand(193,255),Rand(0,85)
EntityColor green, Rand(0,113),Rand(193,255),Rand(0,120)
RenderWorld
Flip
Wend
End