0
Expected expression help
I'm trying to implement a WASD key input for a snake game and can't seem to get why im getting an error Notes: I'm using Xcode on MacOs and language is C++ here's the input code. void Input() { if (getchar() ({ switch _getch(); { case 'a': dir = LEFT; break; case 'w': dir = UP; break; case 's': dir = RIGHT; break; case 'd': dir = DOWN; break; case 'x': gameOver = true; break; } } }
1 Réponse
+ 3
It's kind of confusing...
On the third line, I don't know what you tried to achieve but you probably just confused a starting round bracket with a closing one :/