1) How come my animations won't load, I've been trying to fix them for 2 days, I've posted numerous threads, and I've tried many different solutions but none have worked. ??
2) How would I be able to set PLAYER to PLAYER_IDLE when no other keys are pressed?
Heres my code:
#include "DarkGDK.h"
#include "SC_Collision.h"
#include "g_def.h"
int PLAYER = 1;
enum IDImportant{
SKYBOX=2,
PLAYER_IDLE,
PLAYER_AIM,
PLAYER_MOVE
};
enum IDMisc{
PLANE=5
};
void DarkGDK()
{
dbSyncOn ();
dbSyncRate (0);
SC_Start();
dbLoadObject ("media/skyboxes/sky05/sky05.x", SKYBOX);
dbScaleObject (SKYBOX, 30000, 30000, 30000);
dbMakeObjectPlane(PLANE, 150, 2);
dbPositionObject(PLANE, 19, 0, 19);
SC_SetupObject(PLANE, 1, 1);
dbLoadObject ("media/models/playermodel/H-GI-Static.x", PLAYER);
dbAppendObject ("media/models/playermodel/H-GI-Idle.x", PLAYER_IDLE, 1);
dbAppendObject ("media/models/playermodel/H-GI-Attack.x", PLAYER_AIM, dbTotalObjectFrames(PLAYER_IDLE));
dbAppendObject ("media/models/playermodel/H-GI-Static.x", PLAYER_MOVE, dbTotalObjectFrames(PLAYER_MOVE));
dbRotateObject (PLAYER, 0, 180, dbCameraAngleZ());
dbPositionObject (PLAYER, dbCameraPositionX()-1.0f,
dbCameraPositionY()-2.0f,
dbCameraPositionZ()+4.5f);
dbLockObjectOn(PLAYER);
float fCameraAngleX = 0.0f;
float fCameraAngleY = 0.0f;
while(LoopGDK())
{
dbPositionObject(SKYBOX,
dbObjectPositionX(PLAYER),
dbObjectPositionY(PLAYER),
dbObjectPositionZ(PLAYER));
if(dbKeyState(KEY_W))
{
PLAYER = PLAYER_MOVE;
dbMoveCamera(1);
}
if(dbKeyState(KEY_A))
{
PLAYER = PLAYER_MOVE;
dbMoveCameraLeft(0, 1);
}
if(dbKeyState(KEY_S))
{
PLAYER = PLAYER_MOVE;
dbMoveCamera(-1);
}
if(dbKeyState(KEY_D))
{
PLAYER = PLAYER_MOVE;
dbMoveCameraRight(0, 1);
}
if(dbMouseClick()==2)
{
PLAYER = PLAYER_AIM;
}
fCameraAngleX = dbWrapValue(dbCameraAngleX() + dbMouseMoveY() * 0.9f);
fCameraAngleY = dbWrapValue(dbCameraAngleY() + dbMouseMoveX() * 0.9f);
dbXRotateCamera(fCameraAngleX);
dbYRotateCamera(fCameraAngleY);
dbPrint((float)PLAYER);
dbLoopObject(PLAYER);
dbSync();
}
return;
}
#ifdef _in_programming_heaven_
MakeAnAwesomeGame(lots of badies, lots of guns, lots of stuff to do, BIG level)
#endif