This tutorial walks you through implementing a 2D scrolling game in JavaScript.
Why didn't sin and tan go to the party? Just cos.