Oh xD, forgot the code. Here it is:
Camera.cpp
#include "DarkGDK.h"
void CreateCamera ( void )
{
dbPositionCamera ( 0, 0, -10 );
}
void MoveCamera ( void )
{
dbSetCameraToFollow(dbObjectPositionX(1), dbObjectPositionY(1), dbObjectPositionZ(1), dbObjectAngleY(1), 20, 5, 1, 0);
dbYRotateCamera(dbObjectAngleY(1));
}
Player.cpp
#include "DarkGDK.h"
//Creates the Player
void CreatePlayer ( void )
{
dbLoadObject ("Assets\\RedPlayer.x", 1);
}
void MovePlayer ( void )
{
if (dbKeyState (17) == 1) // W
{
dbMoveObject ( 1, 1 );
}
if (dbKeyState (30) == 1) // A
{
dbTurnObjectLeft ( 1, 1 );
}
if (dbKeyState (31) == 1) // S
{
dbMoveObject ( 1, -1 );
}
if (dbKeyState (32) == 1) // D
{
dbTurnObjectRight ( 1, 1 );
}
}
Right now the camera should just follow the player, later i will try to make a independent camera movement system.