add build file
handle game loop in a nicer way