move game mechanics to mechanics.c