Just played with DarkBASIC
No medias required
Plugins used:
Styx
Ezrotate
Rem Project: Lunar Lander
Rem Created: Friday, May 27, 2011
Rem ***** Main Source File *****
SET DISPLAY MODE 1024,786,32
set window on
sync on : sync rate 60
//AntiAlias = GET MAXIMUM ANTIALIAS LEVEL()
//SET ANTIALIAS LEVEL 8
//Null = EXT INITIALIZED()
reload display pointer
fog on
//make object cube 3,100
$rndcolor = rnd(147)
$rndcolor_fog = rnd(7)
fog color rgb(255,255,255)
fog distance 10,2000
set ambient light 40
color ambient light rgb(205,155,255)
make light 2
color light 2,rgb(255,156,0)
position light 2,-800,0,0
SET LIGHT RANGE 2,200000
make light 3
color light 2,rgb(129,227,255)
position light 3,800,0,0
SET LIGHT RANGE 2,200000
//Load Effects
//load effect "medias/fx/verre_metal.fx",1,1
//load image "medias/images/dalle.png",1
$PosObj = rnd(1000)
$cubes = 10
$cubes2 = 200
$cubes3 = 300
$posCubeX = 0
$posCubeZ = 0
angle# = 0
make object cube 990,200
for i= 1 to 100
make object box $cubes,200,200,200
make object box $cubes2,200,200,200
make object box $cubes3,206,206,206
SET OBJECT WIREFRAME $cubes2,1
ghost object on $cubes3,4
ghost object on $cubes2,2
FADE OBJECT $cubes,90
FADE OBJECT $cubes2,90
for z=1 to 4
position object $cubes,$posCubeX,0,$posCubeZ
rotate object $cubes,0,0,$posCubeX
position object $cubes2,$posCubeX,0,$posCubeZ
rotate object $cubes2,0,0,$posCubeX
position object $cubes3,$posCubeX,0,$posCubeZ
rotate object $cubes3,0,0,$posCubeX
//EZro_ObjLY $cubes, $posCubeX
//EZro_ObjVector $cubes, $posCubeX, 60, 0, $posCubeZ
$posCubeZ = $posCubeZ + 120
z = z + 1
next z
$posCubeX = $posCubeX + 10
SET ALPHA MAPPING ON $cubes,60
//SET REFLECTION SHADING ON $cubes3
SET OBJECT SMOOTHING $cubes,70
SET OBJECT SMOOTHING $cubes2,100
SET OBJECT SMOOTHING $cubes3,100
SET OBJECT SPECULAR $cubes,rgb(rnd(255),0,255)
SET OBJECT EMISSIVE $cubes,rgb(20,50+rnd(50),100+rnd(155))
KD SetObjectAnisotropicFilteringOn $cubes
SET OBJECT SPECULAR $cubes3,rgb(rnd(255),0,0)
SET OBJECT EMISSIVE $cubes3,rgb(20,50,255)
disable object zwrite $cubes
//set object effect $cubes,1
$cubes = $cubes + 1
$cubes2 = $cubes2 + 1
$cubes3 = $cubes3 + 1
i = i + 1
next
set global shadows on
make camera 1
set camera range 1,1,150000
//color backdro////1, rgb(255,255,255)
color backdrop 1, rgb(55,55,55)
//EZro_SetupFromCamera 1
$CameraSelect = 4
global _oldTick as dword
global _newTick as dword : _newTick = hitimer()
global _delta as float
startTime# = 0
endTime# = 2
startValue = 255
endValue = 0
global a = 0
global Obj_Path = 300
randomize timer()
do
Xpos# = OBJECT POSITION X(990)
Zpos# = OBJECT POSITION Z(990)
$timer = TIMER()/1000
$rndcolor = rnd(80)
$cubes = 10
_oldTick = _newTick
_newTick = hitimer()
_delta = (_newTick-_oldTick)
spriteElasped# = spriteElasped# + (_delta*0.001)
if spriteElasped# > (endTime#)
spriteElasped# = 0.0
//endTime# = rnd(3)+0.5
endTime# = 2
// this just flips the values to fade in and out
startValue = 255-startValue
endValue = 255-endValue
endif
$FadIn = int(LinearInterpolation( spriteElasped#, startTime#, endTime#, startValue, endValue ))
SET LIGHT RANGE 2,$FadIn*100
color light 2,rgb(60,$FadIn,0)
color light 3,rgb($FadIn,60,0)
//text 10,10,"FPS "+str$(screen fps())
//text 0,64,"Time: "+str$(spriteElasped#,0)
//text 0,76,"Alpha: "+str$($FadIn)
if mouseclick()=2
hide mouse
xMouseMove# = mousemovex()
yMouseMove# = mousemovey()
inc xCameraAngle#, yMouseMove# / 5.0
inc yCameraAngle#, xMouseMove# / 5.0
if xCameraAngle# < -85.0 then xCameraAngle# = -85.0
if xCameraAngle# > 90.0 then xCameraAngle# = 90.0
rotate camera 1, xCameraAngle#, yCameraAngle#, 0.0
//position mouse screen width() / 2, screen height() / 2
endif
//position object 990,CAMERA POSITION X(1),CAMERA POSITION Y(1),CAMERA POSITION Z(1)
position camera 1,object position x(990), object position Y(990), object position z(990)
//SEZro_FindNormal
//EZro_CamPolyAlign 1, 0, NormalX#, NormalY#, NormalZ#
SET OBJECT TO CAMERA ORIENTATION 990
if inkey$()="w"
move object 990,8
endif
if inkey$()="s"
move object 990,-8
endif
sync
loop
// single point to point linear interpolation
function LinearInterpolation( time as float, startTime as float, endTime as float, fromVal as float, toVal as float )
local out as float
// check if time is outside bounds and fire out resulting values
if (time < startTime) || (time > endTime)
if (time < startTime)
exitfunction fromVal
else
exitfunction toVal
endif
else
out = (((time-startTime) * (toVal-fromVal)) / (endTime-startTime)) + fromVal
endif
endfunction out
function rotateCube(xCameraAngle#)
$cubes = 0
for i= 1 to 100
EZro_ObjGX i, xCameraAngle#
$cubes = $cubes + 1
i = i + 1
next
endfunction
function makePathCube()
if object exist(1) = 0
FOR t=1 to 10
make object cube Obj_Path,200
color object Obj_Path,rgb(255,0,0)
SET OBJECT LIGHT Obj_Path,0
//position light 3,CAMERA POSITION X(1),CAMERA POSITION Y(1),CAMERA POSITION Z(1)
position object Obj_Path,CAMERA POSITION X(1),CAMERA POSITION Y(1),CAMERA POSITION Z(1)
scale object Obj_Path,t*10,t*10,t*10
Obj_Path = Obj_Path + 1
next t
else
delete object t
endif
endfunction