Dug this old thing I said up and thought it would fit well in this thread:
The order goes as follows.
To determine the correct spelling of an accidental, first ask:
1) Is it part of the chord? Does it function harmonically? If, for example, you've transcribed the notes E Ab B, you might want to reconsider that Ab, as E G# B spells out an E major triad. This also applies to what key you're in. If you are in Db Major, chances are you will be using more Gb's over F#'s. This will be the way to go the majority of the time.
If the harmony is irrelevant:
2) Apply the accidental according to the direction it travels towards the next note. This is usually more prevalent in chromatic passages.
Sub-rule: if you are planing or writing in harmony with a consistent interval, keep that interval preserved. If two or more voices are traveling in parallel motion, the interval in which they begin at should remain consistent throughout the passage.
If all else fails:
3) Make it as easy as possible to read. However, you will MOST LIKELY never get to this point. If you think you have, ask someone for a second opinion. This is only for the extreme cases and I doubt something like this would occur in a video game tune.