Hi.....
I'm trying to make 5 enemies :
load_level_1()
rem make enemies
For i = 8 To 13
CreateEnemies(i)
Next i
rem ================LOOP =============================
DO
this is function create enemies:
Function CreateEnemies(nObject)
load object "media/zombie1/zomes.x",nObject
sc_setupObject nObject,1,1
loop object nObject,83,101
radio#=10
sc_drawobjectbounds nObject
PositionX# = 10 + RND(900)
Position Object nObject, PositionX#, 0,rnd(-250)
Inc TotalEnemies
EndFunction
and this is function of IA of the enemies:
Rem IA enemies
Function EnemyIA(EnemyNumber)
CamX# = Position X()
CamY# = Camera Position Y()
CamZ# = Camera Position Z()
grupooldzomx# = object position x(EnemyNumber)
grupooldzomy# = object position y(EnemyNumber)
grupooldzomz# = object position z(EnemyNumber)
Point Object EnemyNumber,camX#,camY#,camz#
Move Object EnemyNumber,0.7
grupozomx# = object position x(EnemyNumber)
grupozomy# = object position y(EnemyNumber)
grupozomz# = object position z(EnemyNumber)
grupoPared=sc_SphereSlideGroup(1,grupooldzomx#,grupooldzomy#,grupooldzomz#,grupozomx#,grupozomy#,grupozomz#,radio#,0)
if grupoPared > 0
grupozomx# = sc_getCollisionSlideX()
grupozomy# = sc_getCollisionSlidey()
grupozomz# = sc_getCollisionSlideZ()
rem re-position the player
gravedadgrupo#=0.3
else
inc gravedadgrupo#,0.3
endif
position object EnemyNumber,grupozomx#,grupozomy#,grupozomz#
sc_updateobject EnemyNumber
EndFunction
I'm using sparky collision.
I use this command to draw the "box collision"
sc_drawobjectbounds and the enemies have the box, but they don't collide with the wall
¿it's correct way to make collisions ???
PD- Sorry my bad english
Thanks
ahhhh......this is the code of level:
rem mapa para colisiones
load object "levelbank\testlevel\universe.dbo",99
load image "media\t.dds",99
texture object 99,99
SC_setupComplexObject 99 ,1,2