Fix: error C2360: initialization of 't' is skipped by 'case' label (#1146)

* Fix: error C2360: initialization of 't' is skipped by 'case' label

case ExampleGameState::update:
        /////////////////////////////
        // Add your codes below...like....
        //
        // UpdateJoyStick();
        // UpdatePlayer();
        // UpdatePhysics();
        // ...
        int t = 10;
        break;

* Update HelloWorldScene.cpp

* Update HelloWorldScene.cpp
This commit is contained in:
aismann 2023-03-30 15:41:44 +02:00 committed by GitHub
parent 872693b5e0
commit 973239f8a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 12 deletions

View File

@ -134,7 +134,7 @@ bool HelloWorld::init()
drawNode->setPosition(Vec2(0, 0));
addChild(drawNode);
drawNode->drawRect(safeArea.origin + Vec2(1,1), safeArea.origin + safeArea.size, Color4F::BLUE);
drawNode->drawRect(safeArea.origin + Vec2(1, 1), safeArea.origin + safeArea.size, Color4F::BLUE);
}
// scheduleUpdate() is required to ensure update(float) is called on every loop
@ -207,10 +207,13 @@ void HelloWorld::update(float delta)
switch (_gameState)
{
case ExampleGameState::init:
{
_gameState = ExampleGameState::update;
break;
}
case ExampleGameState::update:
{
/////////////////////////////
// Add your codes below...like....
//
@ -219,36 +222,44 @@ void HelloWorld::update(float delta)
// UpdatePhysics();
// ...
break;
}
case ExampleGameState::pause:
{
/////////////////////////////
// Add your codes below...like....
//
// anyPauseStuff()
break;
}
case ExampleGameState::menu1:
/////////////////////////////
{ /////////////////////////////
// Add your codes below...like....
//
// UpdateMenu1();
break;
}
case ExampleGameState::menu2:
/////////////////////////////
{ /////////////////////////////
// Add your codes below...like....
//
// UpdateMenu2();
break;
}
case ExampleGameState::end:
/////////////////////////////
{ /////////////////////////////
// Add your codes below...like....
//
// CleanUpMyCrap();
menuCloseCallback(this);
break;
}
} //switch
}
void HelloWorld::menuCloseCallback(Ref* sender)