sure man , glad there is a new member in our forum.
lets see what youve done , and hopefully i will be able to help you with the Code.
edit: sorry but i do not have DarkAi.
can you explain what is the problem?
what happens when you press the fire button?
on the other hand i did find something that was a bit hard for me to understand.
void PlayerKeyboardCheck ( void )
{
if ( CheckRight() )
{
iPlayerX += iPlayerSpeed;
//if ( iPlayerX < 0 )
// iPlayerX = 0;
iPlayerDirection = RIGHT;
dbRotateObject (1,90,90,0);
dbCenterText ( 100, 100,"Right Key Pressed" );
}
if ( CheckLeft() )
{
iPlayerX -= iPlayerSpeed;
//if ( iPlayerX < 0 )
// iPlayerX = 0;
iPlayerDirection = LEFT;
dbRotateObject (1,90,270,0);
dbCenterText ( 100, 100,"Left Key Pressed" );
}
if ( CheckUp() )
{
iPlayerZ += iPlayerSpeed;
//if ( iPlayerX < 0 )
// iPlayerX = 0;
iPlayerDirection = UP;
dbRotateObject (1,90,0,0);
dbCenterText ( 100, 100,"Up Key Pressed" );
}
if ( CheckDown() )
{
iPlayerZ -= iPlayerSpeed;
//if ( iPlayerX < 0 )
// iPlayerX = 0;
iPlayerDirection = DOWN;
dbRotateObject (1,90,180,0);
dbCenterText ( 100, 100,"Down Key Pressed" );
}
if ( CheckUp () && CheckRight() )
{
dbRotateObject (1,90,45,0);
}
if ( CheckUp () && CheckLeft() )
{
dbRotateObject (1,90,315,0);
}
if ( CheckDown () && CheckRight() )
{
dbRotateObject (1,90,135,0);
}
if ( CheckDown () && CheckLeft() )
{
dbRotateObject (1,90,225,0);
}
dbPositionObject ( 1, iPlayerX, iPlayerY, iPlayerZ );
}
here is my problem with it :
you have
dbPositionObject ( 1, iPlayerX, iPlayerY, iPlayerZ );
at the end of the function , why not including a dbYRotateObject(iPlayerYangle) aswell..
it will make your project much more cleaner , you dont need to put it inside every key check:
at the start just declare int iPlayerYangle, then change only this and in the end only one dbYRotateObject , you have done it with dbPositionObject thats why it was a bit weird.
another problem that does bug me , is that you always put dbRotateObject(player,90,direction,0);
why always use that 90?
since you are using sparky collision and i for personal use know that this salution may not work with it.
dbXRotateObject(player,90);
dbFixObjecrPivot(player);
this will save it so you wont have to rotate it on the X axis everytime.
remmber , thats a rule and its the most important one in Media or Game programming , always try to keep the fps high, now this is a small for say project but when you come to a big one and this type of coding found that may defenetly decrease your fps.
about Sparky's collision ObjectPivot problem ,
you can create a mesh from the player object fix its pivot and return it to an object it worked for me.
the code is:
dbLoadObject(id,file);
dbXRotateObject(id,90); // will rotate it only on the X axis
dbSize // if needed..
dbFixObjectPivot(id); // will keep it with the size and Rotation
dbMakeMeshFromObject(id,id); // making the mesh with the new size and rotation angle
dbDeleteObject(id); // deleting the old object
dbMakeObject(id,id,TextureId); // rebuilding the fixed object on the same id as before plus you should texture it unless you want it all white
dbDeleteMesh(id);// deleting the temp mesh
// youre done
//Sparkycollision setup come here
for now , since i cant compile and i do not want to change the code and actually follow your steps, i do now own DarkAi therefor cannot run it and see what happens with the bullets and im pretty damn tired.
explain what is the problem and i will try my best.