REM Project: testsavebigdbo
REM Created: 15.07.2012 23:08:46
REM
REM ***** Main Source File *****
REM
backdrop on
color backdrop 0
cls 0 : ink rgb(255,255,255),0 : circle 16,16,14
scorchimage=1 : get image scorchimage,0,0,32,32
tfile$="universe.dbo"
make object cube 1000,5
hide object 1000
if file exist(tfile$)=1
dividetexturesize=0 : load static objects tfile$,dividetexturesize : omax=1
rem delete file tfile$
else
collision=2 : Arbitraryvalue=0 : shadow=1 : portal=1 : o=1
load object "testmap\ramp.x",o: position object o,100,-200,100
make static object o,collision,Arbitraryvalue,shadow,portal : inc o
load object "testmap\ramp.x",o: position object o,100,-300,100
make static object o,collision,Arbitraryvalue,shadow,portal : inc o
rem for er=12 to 33 : delete static object er : next er
build static portals : delete light map lights : add static objects to light map pool
rem make object cube o,100 : position object o,600,75,400 : add object to light map pool o
rem make mesh from object 3,o : add limb o,1,3 : offset limb o,1,0,0,-125
rem add limb to light map pool o,1 : inc o
texturesize=16 : texturequality=1 : lightmapsavepath$="lightmaps"
if path exist(lightmapsavepath$)=0 then make directory lightmapsavepath$
create light maps texturesize,texturequality,lightmapsavepath$
if file exist(tfile$)=1 then delete file tfile$
save static objects tfile$ : omax=o
for i=1 to omax-1 : delete object i : next i
endif
set global shadows on : set global shadow shades 1 : set global shadow color 0,0,0,64
set shadow light 1,300,500,700,2000 : set shadow position -1,300,500,700
position camera 55,1000,55 : point camera 500,50,500
position object 1000,55,1000,55
set point light 0,500,300,500 : set ambient light 20
set normalization on : sync on : sync rate 60
while mouseclick()=0
if inkey$()="-" then set static portals on
if inkey$()="=" then set static portals off
if inkey$()="[" then set static objects wireframe on
if inkey$()="]" then set static objects wireframe off
rem Input source
tkeystate30=0 : tkeystate32=0 : tkeystate17=0 : tkeystate31=0
if Keystate(17) then tkeystate17=1
if Keystate(31) then tkeystate31=1
if Keystate(30) then tkeystate30=1
if Keystate(32) then tkeystate32=1
cammovex#=Mousemovex()
cammovey#=Mousemovey()
rem Camera old information
cox#=Camera Position X()
coy#=Camera Position Y()
coz#=Camera Position Z()
rem Control camera movement
movement=0 : speed#=3.0
x#=Camera Angle X() : z#=Camera Angle Z() : sy#=Camera Angle Y() : y#=sy#
if tkeystate30=1 then dec y#,90 : movement=1
if tkeystate32=1 then inc y#,90 : movement=1
Rotate Camera 0, y#, 0
if tkeystate17=1 or tkeystate30=1 or tkeystate32=1 then move object 1000,speed# : movement=1
if tkeystate31=1 then MOVE OBJECT 1000,speed#*-1.0 : movement=1
Rotate Camera x#, sy#, z#
rem Camera new information
cmx#=object Position X(1000)
cmy#=object Position Y(1000)-grav#
cmz#=object Position Z(1000)
rem Overall ellipse collision for camera
if Static Volume(cox#, coy#-20, coz#, cmx#, cmy#-20, cmz#, 1.0)=1
materialtype=Get Static Collision Value()
cmy#=coy#+Get Static Collision Y()
grav#=0.5
else
inc grav#,0.5
endif
if Static Volume(cox#-5, coy#, coz#, cmx#-5, cmy#, cmz#, 1.0)=1
materialtype=Get Static Collision Value()
cmx#=cox#+Get Static Collision X()
endif
if Static Volume(cox#, coy#, coz#-5, cmx#, cmy#, cmz#-5, 1.0)=1
materialtype=Get Static Collision Value()
cmz#=coz#+Get Static Collision Z()
endif
rem Stop falling forever
if cmy#<-200.0 then cmy#=-200
rem Update camera position
` Set Point Light 0, cmx#, cmy#, cmz#
Position Camera cmx#, cmy#, cmz#
position object 1000,cmx#,cmy#,cmz#
rem Control camera view
camangx#=Camera Angle X()+cammovey#/1.5
camangy#=Camera Angle Y()+cammovex#/1.5
if wrapvalue(camangx#)>85 and wrapvalue(camangx#)<180 then camangx#=85.0
if wrapvalue(camangx#)>180 and wrapvalue(camangx#)<275 then camangx#=275.0
Rotate Camera camangx#,camangy#,Camera Angle Z()
rotate object 1000,camangx#,camangY#,camera angle z()
rem Update
Sync
endwhile
set global shadows off : delete static objects
end
Collisions don't work too
Update:
I understand everything, but I want to work with universal.dbo.
Since there is a function of determining the type of object, time.
secondly maps of these blocks is processed quickly.
in the third. I was going to make the generator of the landscape of the blocks for creating games of various genres. So I need to solve this puzzle.
translated translator yandex or google