Problem with lesson 8
Problem with lesson 8
Hi! I was following through the tutorial just fine, but when I got to the end where the face was collecting all the poo the game over screen would pop up when i collected the poo at the bottom and sometimes the entire screen would just go black.. Please help?!
- Attachments
-
- Solution File.rar
- (38.2 KiB) Downloaded 168 times
- zentojamorn
- Posts: 10
- Joined: May 22nd, 2012, 4:22 am
Re: Problem with lesson 8
In this part of your program
Your problem is you messed up brackets.
PS.Sorry for poor english.
From your nested if-else,your program will gameover in case of poo3IsEaten only.if( !( poo1IsEaten && poo2IsEaten && poo3IsEaten) )
{
if( !poo1IsEaten )
{
if( faceX + 20 > poo1X &&
faceX < poo1X + 24 &&
faceY + 20 > poo1Y &&
faceY < poo1Y + 24 )
{
poo1IsEaten = true;
}
DrawPoo( poo1X, poo1Y );
}
if( !poo2IsEaten )
{
if( faceX + 20 > poo2X &&
faceX < poo2X + 24 &&
faceY + 20 > poo2Y &&
faceY < poo2Y + 24 )
{
poo2IsEaten = true;
}
DrawPoo( poo2X, poo2Y );
}
if( !poo3IsEaten )
{
if( faceX + 20 > poo3X &&
faceX < poo3X + 24 &&
faceY + 20 > poo3Y &&
faceY < poo3Y + 24 )
{
poo3IsEaten = true;
}
DrawPoo( poo3X, poo3Y );
}
else
{
DrawGameOver( 375, 275 );
}
DrawFace( faceX, faceY );
}
Your problem is you messed up brackets.
PS.Sorry for poor english.
Sorry for my poor english..
Re: Problem with lesson 8
You should study, and learn to use "for" statement and arrays for poos. There is no need to write all that separately for each poo.
Or maybe this comes after tutorial 8...
Or maybe this comes after tutorial 8...
ʕ •ᴥ•ʔ
- zentojamorn
- Posts: 10
- Joined: May 22nd, 2012, 4:22 am
Re: Problem with lesson 8
I didn't watch the whole tutorial in programming pooEater game but I recognize that "for" statement and arrays for poos comes after tutorial 8.
Sorry for my poor english..
Re: Problem with lesson 8
Yeah arrays come later.
Thanks for answering this guys question Zento.
Thanks for answering this guys question Zento.
Chili
Re: Problem with lesson 8
Thanks Zento! I managed to fix the problem