Small improvements

1. Add button check. Now, users can quit game any time by "space".
2. Change calculation method for next coordinate of the ant