Why isnt my SDL surface showing?
Everything is running fine except the gun is not showing. Please tell me where i screwed up.
in Player.cpp
1 2 3 4 5 6 7
|
pistol[0] = graphics->LoadImage( "Media/Player_Pistol_Right" );
pistol[1] = graphics->LoadImage( "Media/Player_Pistol_Left" );
...
handgun.xPos = xPos + 12;
handgun.yPos = yPos + 37;
| |
in Game.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
void Player::HandleEvents()
{
...
player->handgun.xPos = player->xPos + 12;
player->handgun.yPos = player->yPos + 37;
}
void Player::Render()
{
if( player->direction == RIGHT )
{
graphics->ApplySurface( player->handgun.xPos, player->handgun.yPos, player->pistol[0], graphics->screen );
}
else if( player->direction == LEFT )
{
graphics->ApplySurface( player->handgun.xPos, player->handgun.yPos, player->pistol[1], graphics->screen );
}
graphics->UpdateScreen();
}
| |
graphics->LoadImage( "Media/Player_Pistol_Right" ); |
Not Player_Pistol_Right
.png?
Last edited on
Yeah lol thanks again disch!
Topic archived. No new replies allowed.