Arrow Keys Left and Right. Space or Up to Jump.
I have used only 2 variables to create 3 points of a triangle and scroll that triangle infinitely. I then added 2 more variables to turn it into a platformer. So 4 variables total. Oh, and I used the timer for jump. I just realized I did not even use Hero X because the triangle is what moves left/right not the hero. So 3 variables and a timer.