I'm trying to make an rpg. I'm making the gravity and collision at the moment, but whenever i try to run it, the screen goes black(but i can see the mouse) and i need to ctr + alt + del out of it.
It only happens with this program, so maybe it's the code or the media?
anybody know what's happening?
oh yeah and i'm using dbc
sync on
sync rate 40
gosub load
gosub vars
do
rem controls
if upkey()
move object 2, speed#
endif
if downkey()
move object 2, -1 * speed#
endif
if rightkey()
turn object right 2, turn#
endif
if leftkey()
turn object right 2, -1 * turn#
endif
rem player loc + angles
x# = object position x(2)
y# = object position y(2)
z# = object position z(2)
xangle# = object angle x(2)
yangle# = object angle y(2)
zangle# = object angle z(2)
gosub grav
rem camera things
position camera x#, y#, z#
set camera to object orientation 2
pitch camera down 20
move camera -20
sync
loop
grav:
y# = y# - grav#
while object collision(2, 1)
y# = y# + grav#
endwhile
position object 2, x#, y#, z#
return
vars:
speed# = 0.5
turn# = 2
grav# = 0.0
return
load:
load object "Land1.3ds", 1
make object sphere 2, 3
return
It worked before, with the gravity. When i put the collision in it started to crash.
<img src="http://img115.imageshack.us/img115/9193/screenshot5qn.jpg"> EVIL....
Untitled Space Sim: 10%