Levels: If - The-Source-Eternal/Children-of-IO GitHub Wiki

Teaches: javascript/general programming concept Specifically: The "if" statement Note: Possibly multi-level. First the concept of "if" statements, then programming them, then programming them in more complicated ways.

Monkey See, Monkey Change

In short, player sees AI opening doors with "true" written on them, must get in the "false" doors, changes code so AI opens "false" door for them. Player probably first has to learn to go through the "true" doors when they open.

A Maze

A Dungeon

  • If the door is wood go through it. Transitions to...
  • Words above the door - if "true", go through it or
  • If there is a wood door go through it.
  • Some step would have values (numbers or strings or object.hits) above the way to go through?

IMPORTANT NOTE: This can have multiple iterations as well - First time around, the player does all the work, receiving and carrying out the instructions of the if statement (maybe they can disobey and thus see there's stuff there that they can't get to yet). Second time around, they code something else (some object or something) to do the same (2d?). Third time around, they program keyboard and/or mouse input controls. This allows them to break out of the programatic thing and get the stuff they weren't able to get before. (Perhaps the object is smaller and that's why it's able to get those objects, perhaps they have learned to program points that the object runs into to come to them, perhaps they have learned how to scale themselves down to a smaller size and can ride in a small care they control themselves. Perhaps some things they can get when scaled down, but there are others that only the object can get because... for some reason...).

Easter Egg: If they code the moving object to pay attention to tags, there will be a special tag at the end that will get them something.

Object tags

  • The player must check the object's tag, name, or, later on, some property and if it is of a specific value, they do an action to that object. Transitions to...
  • Create an actual if statement that will check that value and do the action to an object.
  • This would come before iterating through arrays where there would be a for loop or some such to do this to all the items in the room with that value.

Note: We can probably make this multi-level as well in a similar way.