Im currently debugging code for a game I'm writting and there is several errors I can't understand.
I would post this is the game programming forum, but the errors seems to be centered around actually C++ coding errors so I thought here might be better.
The first piece of code I'm getting errors with is:
Code:
// Change the speed of the saucer in response to arrow key presses
if (GetAsyncKeyState(VK_LEFT) < 0)
g_pCraftSprite->SetVelocity_x(--g_pCraftSprite->GetVelocity_x());
else if (GetAsyncKeyState(VK_RIGHT) < 0)
g_pCraftSprite->SetVelocity_x(++g_pCraftSprite->GetVelocity_x());
if (GetAsyncKeyState(VK_UP) < 0)
g_pCraftSprite->SetVelocity_y(--g_pCraftSprite->GetVelocity_y());
else if (GetAsyncKeyState(VK_DOWN) < 0)
g_pCraftSprite->SetVelocity_y(++g_pCraftSprite->GetVelocity_y());
I get the following errors for all 4 key states:
"spaceevade.cpp": E2096 Illegal structure operation in function HandleKeys() at line 274
Any help understanding this error would be appreciated.
My second error is in the code:
Code:
//Increase Velocity of asteriods
for(i=0; i<9; i++)
{
g_pAsteriodSprite[i]->SetVelocity((g_pAsteriodSprite[i]->GetVelocity_x() + (g_iLevel*2)),
(g_pAsteriodSprite[i]->GetVelocity_x() + (g_iLevel*2)));
}
I get the following error:
"spaceevade.cpp": E2094 'operator+' not implemented in type 'tagPOINT' for arguments of type 'int' in function EndLevel() at line 362
Again I don't understand this problem.
I've only posted the parts of the code with problems to save space, but if the rest is needed I can easily post this.
Thanks in advance for any help.