Local vars are vars that have been created insinde the function. Move 'var momentun=0;' before your function main() and it'll work. (This way you'll make it a global var)
Quote: Too many globals are a sign of bad programming...
Ok , so we're all bad programmers If you sit down and think about it for a minute , you have one 'you' pointer wich is global and is used by 100s of functions at the same time. How ? I'll leave that up to you , because a sign of bad programming is exactly that , not knowing how you could use one global var/pointer in many diffrent functions between two frames.