I used to play this game in grade school. You were some kid in a school at night time.
You walked around with a flash light and went into class rooms and "battled" evil clowns.
I think that the way you battled them was either with math problems or trivia questions.
It was a 2d scroller. I think you wore a hat and had big shoes.
I thiiink I know what game you're describing, but sadly I can't remember its name either. Did you play some bluish guy with a red cap, and one of the most prominent songs was (or at least sounded like) In The Hall of the Mountain King?