re-factor user event handling

in order to reduce game_loop function length and increase readability,
the event handling has been moved to a separated function
re-factor game drawing to a separate function

drawing on screen if now done in a separate function
game loop is more readable this way