0
私は、なぜ片方向の仕組みが見えないのか見ているのが難しいです。switchステートメント内のifステートメント?
私は持っています。 MおよびEの場合には
switch (key)
{
//If Game over Label is visible, enable the m and e buttons
if(mGameOverLabel->GetVisible())
{
case 'm': case 'M':
ResetScreen();
break;
case 'e': case 'E':
// //Exit the game
Stop();
break;
} else {
case ' ':
mSpaceship->Shoot();
break;
default:
break;
}
、mGameOverLabelは、この現在の時点ではfalseに設定されているにもかかわらず、私はまだMとEを押すことができ、これらは方法に従って反応しますが、私はそれを変更した場合これはMのために、私がそれを必要とするときにのみ動作します。私は何かここで行方不明ですか?
switch (key)
{
//If Game over Label is visible, enable the m and e buttons
case 'm': case 'M':
if(mGameOverLabel->GetVisible()) ResetScreen();
break;
}
スウィッチ声明の前にすることはできますか? – Andrew
@Andrew:何? – Ryan