It's not a huge deal, but I don't really like declaring a variable at a place other than where it's used...

I don't really have any better ideas, though, except putting every usage of `var player` into a block and then use `let player`.