Hi All
I am tring a code snippet for Sparky dill. when I run the code I do get my level of my world just for a moment then it goes to a blue screen. Here is the code I have. Thanks in advance.
Rem Project: Collision Code
Rem Created: Thursday, December 17, 2009
Rem ***** Main Source File *****
` This code was downloaded from The Game Creators
` It is reproduced here with full permission
` http://www.thegamecreators.com
rem turn auto cam off
AUTOCAM OFF
rem make the player object
make object sphere 2,5
Sc_setupobject 2,0,2
rem setup your world
load object "media\My3D_World.dbo",1
Sc_setupcomplexobject 1,1,2
do
rem collision for the person
oldx# = object position x(2)
oldy# = object position y(2)
oldz# = object position z(2)
rem move the player
if keystate(17)=1 then move object 2,3
if keystate(31)=1 then move object 2,-3
if keystate(30)=1 then move object left 2,3
if keystate(32)=1 then move object right 2,3
rem if player isn't pressing a key apply simple gravity
if keystate(17)=0 then position object 2, object position x(2),object position y(2)-0.4, object position z(2)
if keystate(31)=0 then position object 2, object position x(2),object position y(2)-0.4, object position z(2)
if keystate(30)=0 then position object 2, object position x(2),object position y(2)-0.4, object position z(2)
if keystate(32)=0 then position object 2, object position x(2),object position y(2)-0.4, object position z(2)
x# = object position x(2)
y# = object position y(2)
z# = object position z(2)
collide = sc_SphereSlideGroup(1,oldx#,oldy#,oldz#,x#,y#,z#,100,0)
if collide>0
x# = sc_getCollisionSlideX()
y# = sc_getCollisionSlideY()
z# = sc_getCollisionSlideZ()
position object 2,x#,y#,z#
endif
rem position the camera
position camera object position x(2),object position y(2),object position z(2)
rem camera control/player movement
rotate camera camera angle x(0)+(mousemovey()/2.0),camera angle y(0)+(mousemovex()/2.0),0
cx#=camera angle x(0) : cy#=camera angle y(0)
if wrapvalue(camera angle x(0))>40 and wrapvalue(camera angle x(0))<180 then xrotate camera 0,40
if wrapvalue(camera angle x(0))>180 and wrapvalue(camera angle x(0))<280 then xrotate camera 0,280
loop
Eggs and Ham Breakfast
The Chicken was involved the Pig was Committed