it's very simple brother all you have to do is to setup the player's collision like so
sc_setupobject objectnumber,groupnumber,collisiontype
1.the object number is the number of the object you want to setup
2.the groupnumber is the group you want the include the object in, if set to 0 then the object is not in any group.
3.collisiontype is the type of collision you want to make, 0 for polygon collision that checks all the polygons in the object, 1 for box collision that makes a box around the object, 2 for sphere collision that makes a sphere around the object.
allright now we have to save the oldposition of the object and the newone
do it in your main loop
Do
`Here is the old position of the player
oldx#=object position x(1)
oldy#=object position y(1)
oldz#=object position z(1)
if rightkey()=1 then yrotate object 1,wrapvalue(object angle y(1)+4)
if leftkey()=1 then yrotate object 1,wrapvalue(object angle y(1)-4)
if upkey()=1 then move object 1,4
if downkey()=1 then move object 1,-4
`Here is the new position of the player
x#=object position x(1)
y#=object position y(1)
z#=object position z(1)
sync
loop
allright now we saved the posiion of the player, nw we have to check for collision.
we use this command in the main loop
sc_sphereslidegroup(groupnumber,oldx,oldy,oldz,x,y,z,radius,exclude object)
groupnumber is the group that we want to check collision for, oldx, oldy, oldz, x, y and z is the variables that we declared above and radius is the size of the player /2, so if the player's size is 40 then the radius will be 20
exclude object will exclude an object from the collision checking if set to 1, else it must be set to 0
so here is an example showing how to use this command, use it in the mnain loop
c = sphereslidegroup(1,oldx#,oldy#,oldz#,x#,y#,z#,20,0)
if c>0
x#=sc_getcollisionslidex()
y#=sc_getcolliionslidey()
z#=sc_getcollisionslidez()
endif
position object 1,x#,y#,z#
and if you don't undertand something then just email me at mahmoud_kossir@hotmail.com