JavaScript sidescroller engine