Why Switch failing?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
void handleKeypress(unsigned char key, int x, int y) {
switch (key) {

case 'a':
if(selection == 0){//2nd Option
	xmove -= 7;
	if(xmove == -14){
			xmove += 7;
         }
      }
case 'd':
if(selection == 0){//2nd Option
	xmove += 7;
	if(xmove == 14){
			xmove -= 7;
         }
      }
}
}
Last edited on
Did you forget a break; after line 6?

Also... what do you mean by "failing"?
Topic archived. No new replies allowed.