Im working on my first game, doing good so far, trying to add Collision detection though. when i compile and run, it brings up the screen, but stays black. never loads the level. I've read TDK's tutorial, which is what im going with for now, but cannot figure out why it wont load. This is the code i have thus far
sync on : Sync rate 60
rem make player a box
make object box 1,4,3,5
position object 1, 250,4,250
rem Set light variables
make light 1
Set Shadow Light 1,1000,1000,-500,3000
Position light 1,1000,1000,-500
Set Light Range 1,3000
rem terrain code
load object "medialevel 1terrainlevel 1.x",2
position object 2, 0,0,0
rem tree code
load object "medialevel 1propslevel 1_PR.x",3
position object 3, 0,0,0
set object transparency 3,6
set alpha mapping on 3,99
Set Shadow Shading On 3,-1,200,1
rem sky code
sky_obj = 4
load object "medialevel 1skyboxsky06.x",sky_obj : position object sky_obj,-1000,0,-1000
position object 4, 100,3,100
set object texture sky_obj,2,0
scale object sky_obj,70000,70000,70000
set object fog sky_obj,0
set object light sky_obj,0
set object ambient sky_obj,0
Set Camera Range 1, 1700000
rem timed movement speeds and controls via arrow keys
movespeed = 75
turnspeed = 87.5
time=timer()
speed#=0
do
gameTime=timer()-time
MSframe#=gameTime*(movespeed/1000.0)
TSframe#=gameTime*(turnspeed/1000.0)
if Upkey()=1
Move Object 1,MSframe#
endif
If Downkey()=1
Move Object 1,-MSframe#
endif
If Leftkey()=1
Dec a#,TSframe#
endif
if Rightkey()=1
Inc a#,TSframe#
endif
yrotate object 1,a#
posx#=cos(270-a#) * 30 + object position x(1)
posz#=sin(270-a#) * 30 + object position z(1)
Position camera posx#,object position y(1)+6,posz#
Point Camera object position x(1),object position y(1)+6,object position z(1)
time=Timer()
rem collision detection
If OBJECT COLLISION(1,2)>0:
Repeat
Move Object 1,0-Speed#
Until OBJECT COLLISION(1,2)=0
Endif
sync
loop
end
Any help would be appreciated..
i forgot to mention, that when taking the collision detection code out, it loads fine.
NeverMind. went to a different tutorial about sparky's collision DLL. works perfect.
The darkest minds, are often the brightest.