hi i am making my game and i got to the point of controls for the left rifht forward..blablabla
so first i made the basic left right forward backward stuf whit this code
char* szKey = dbInKey ( );
if ( strcmp ( szKey, "w" ) == 0 )
{
dbMoveCamera ( 0 , g_fSpeed );
}
if ( strcmp ( szKey, "d" ) == 0 )
{
dbYRotateCamera ( 0 , dbCameraAngleY( 0 ) + 90 );
dbMoveCamera ( 0 , g_fSpeed);
dbYRotateCamera ( 0 , dbCameraAngleY( 0 ) -90 );
}
if ( strcmp ( szKey, "s" ) == 0 )
{
dbMoveCamera ( 0 , -g_fSpeed );
}
if ( strcmp ( szKey, "a" ) == 0 )
{
dbYRotateCamera ( 0 , dbCameraAngleY( 0 ) -90 );
dbMoveCamera ( 0 , g_fSpeed );
dbYRotateCamera ( 0 , dbCameraAngleY( 0 ) +90 );
}
It worked grait....but i notice whille debugin you can go like curved(when pressing w and d or w a it goes just whats pressed the last(forward(back.)or left and right
it would be greit if somebody could teell me how to make it go curved
i tryed this code but it didnt even detect it(the picture)
if ( strcmp ( szKey, "d" )==0&&( szKey, "w" ) == 0 )
{
dbPasteImage(3, 20, 30);
dbYRotateCamera ( 0 , dbCameraAngleY( 0 ) + 45 );
dbMoveCamera ( 0 , g_fSpeed);
dbYRotateCamera ( 0 , dbCameraAngleY( 0 ) -45 );
}
i also try this
if ( strcmp ( szKey, "d" )&&( szKey, "w" ) == 0 )
{
dbPasteImage(3, 20, 30);
dbYRotateCamera ( 0 , dbCameraAngleY( 0 ) + 45 );
dbMoveCamera ( 0 , g_fSpeed);
dbYRotateCamera ( 0 , dbCameraAngleY( 0 ) -45 );
}
dosent make any difrence.
Game.Love