jQuery jAM, Season 6

Exercise 15.01

A Platform Game

	 
function runGame(plans,Display){
  function startLevel(n){
	runLevel(new Level(plans[n]), Display, function(status){
	  if(status == "lost")
	    startLevel(n);
	      else if (n < plans.length -1)
		    startLevel(n + 1);
			 else
			  console.log("You win!");
   });
 }
  startLevel(0);
}
	 
	

To open the JavaScript console, press F12 or on MAC press COMMAND-OPTION-I.