Hello I have great difficulty to make function my program !
here, my object passes has through the cubes ,Why??
it would be possible to have a simple example Juste with 2 or 3 object because to translate a whole complex code remains very complicated
Rem Project: ELECTRO 3D
Rem Created: 04/03/2004 20:36:00
Rem ***** Main Source File *****
set display mode 1024,768,32:sync on:sync rate 80:color backdrop RGB(0,0,0)
hide mouse
StartCollisionPRO(0,0,0)
startcollisiondebugpro()
rem ------------------------------------------------------------------------------------------------------------------------
rem PARAMETRAGE
rem ------------------------------------------------------------------------------------------------------------------------
global
angleperso=0:tourneperso=0:avance#=0
#constant perso = 100
#constant cube1 = 10
#constant cube2 = 110
rem SOME globals to make (SetCollisions) and ray-cast
rem statements easier to read
#Constant TYPE_NGC_ELLIP=1
#Constant TYPE_NGC_MESH=2
#Constant ELLIP_2_ELLIP=1
#Constant ELLIP_2_POLY=2
#Constant RESP_STICK=1
#Constant RESP_SLIDE=2
#Constant RESP_SLIDE_NO_SLOPES=3
#Constant RESP_SLIDE_NO_GRAV=4
#Constant RESP_NONE=5
#Constant DYN_NO_RESP=1
#Constant DYN_RESP=2
#Constant DYN_RESP_LOCK=3
#Constant DYN_RESP_LOCK_NOTURN=4
rem End globals
load object "x\electro.x",100:rem scale object 100,1000,1000,1000
setcollisionspro(perso,cube1,ellip_2_ellip,resp_stick,dyn_resp)
collisiontypepro(perso,cube1)
autocam off
position camera 0,0,2,-18
play object 100,20,20
make object cube 10,5:position object 10,-15,2,0
make object cube 110,5:position object 110,15,2,0
color object 10,RGB(255,0,0):color object 110,RGB(0,0,255)
do
set cursor 0,0:print screen fps()
print "Position X ",object position x(100)," Y ",object position y(100)," Z ",object position z(100)
print "angle X ",object angle x(100)," Y ",object angle y(100)," Z ",object angle z(100)
print "angleperso :" ,angleperso
print "tourneperso :" ,tourneperso
control()
mouvement()
runcollisionpro()
sync
loop
function control
if leftkey()
if wrapvalue(object angle y(perso))=angleperso then avance#=-0.5
if wrapvalue(object angle y(perso))=270 or wrapvalue(object angle y(perso))=0
angleperso=90:tourneperso=1:avance#=0
endif
endif
if rightkey()
if wrapvalue(object angle y(perso))=angleperso then avance#=-0.5
if wrapvalue(object angle y(perso))=90 or wrapvalue(object angle y(perso))=0
angleperso=270:tourneperso=2:avance#=0
endif
endif
endfunction
function mouvement
if wrapvalue(object angle y(perso))<>angleperso
if tourneperso=2
yrotate object perso,wrapvalue(object angle y(perso)-5)
endif
if tourneperso=1
yrotate object perso,wrapvalue(object angle y(perso)+5)
endif
endif
if wrapvalue(object angle y(perso))=angleperso then tourneperso=0
move object perso,avance#:avance#=0
endfunction
Thank you to help me
@++
Captain-Ouais !
I am against the fact that one is not for,sometimes it is the opposite (Google translation ) :p
Atari 2600 mega-overcloked (quake 3 FPS : 80)