While reading the documentation I have noticed that DarkGDK contains inbuilt object collision.
I attempted using it for gravity:
if (dbObjectCollision(Object 1, Object 2) == false)
{
dbMoveObjectDown(Object 2, 6.0f);
}
But this isn't very good because there is a big gap between the objects.
P.S. I can't figure out the Sparky's collision.
I have attempted animating object while moving only. Here's my code:
if (dbUpKey() == 1){
dbMoveObject(3, -3.0f);
dbLoopObject (3,235,258);
dbSetObjectSpeed (3, 40);
}
if (dbDownKey() == 1){
dbMoveObject(3, 3.0f);
dbLoopObject (3,235,258);
dbSetObjectSpeed (3, 40);
}
if (dbLeftKey() == 1){
dbYRotateObject(3, dbObjectAngleY(3) - 3.0f);
}
if (dbRightKey() == 1){
dbYRotateObject(3, dbObjectAngleY(3) + 3.0f);
}
Unfortunattely after I have finished pressing the buttons the animation still continues.
I have implemented Third Person View in 2 different ways but I want camera to follow behind the character, but the first way the camera is
parallel not always behind. Second way camera is free and it isn't consistant also it sometimes goes behind the walls thus I am not able to see the character.
Here's the code for the first way:
dbXRotateCamera ( 33.0f );
dbYRotateCamera ( dbObjectAngleY(3) - 180.0f );
dbZRotateCamera ( dbObjectAngleZ(3) );
dbPositionCamera ( (dbObjectPositionX(3)), (dbObjectPositionY(3)+ 100), (dbObjectPositionZ(3)+ 75));
Second way is dbSetCameraToFolow way.
I'll be gratefull If anyone helps me out with any of these issues.
XD