As for checking buttons, there are some things that can be improved. First, note that there are built-in constants for the buttons like #UP, #DOWN, #A, #B, #L, and so on. So, rather than B==8, you can write B==#RIGHT, which is a lot easier to understand.