c# - Control cannot fall through from one case label ('case 1:') to another -
this question has answer here:
- control cannot fall through 1 case label 5 answers
im trying make space invader style game in visual studios xna, , after creating basic game have attempted input menu screen. in order have moved around alot of code , put bulk of under case state.playing: . rest of fine 'case' coming above error message , im stumped. should looking?
//updating playing state switch (gamestate) { ***case*** state.playing: { // todo: add update logic here int rightside = graphicsdevice.viewport.width; int leftside = 0; //moving of aliens (int r = 0; r < rows; r++) (int c = 0; c < collumes; c++) {
i assume you're missing break
s @ end of cases. use this:
switch (gamestate) { case state.playing: { // code break; } case state.whatever: { // code break; } }
Comments
Post a Comment