hi guys my first post here, basically im making a point and click game with SDL, and what i want the code to is, when i click on an image(barrel) the image will be replaced by another image(broken barrel) and also a key would appear.
if(barrelNormal.drawMe==true){
SDL_BlitSurface(barrelNormal.img1,NULL,screen,&barrelNormal.location);
}
else if(currentEvent.type == SDL_MOUSEBUTTONDOWN){ if(currentEvent.button.button == SDL_BUTTON_LEFT){
int mousex = currentEvent.motion.x;
int mousey = currentEvent.motion.y;
sorry, there are no problems, its just the image doesnt go away, it just blits the other two images when the button is clicked and once let go they go awa.
I'm just a newbie as well, but it looks to me like not all of your block statements are properly enclosed. Notice how, using the code formatting feature and indents, you only have one closing bracket starting after your if-else statement. If I were the compiler, I'd be confused.