I suggest you to see lowerdash or N# for your game. It's hard to keep track of all the code when everything is on one file(Specially if you want to develop a lot of features). Also, this help to isolate the code, which is useful to avoid break modules that are already work.