If you're seeing this message, it means we're having trouble loading external resources for Khan Academy.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Many games and visualizations have what we call "scenes", and they need some way of managing those "scenes." What do I mean by scenes?

Take for example, Balloon Popper 2. It has four scenes:

A start scene
A how-to-play scene  
A playing scene  
A game over scene  

Most games have those scenes, in fact. Each scene is a distinct state of the program that displays different information, and there is some way for the user to get from one scene to the next. Maybe it's a simple mouse click or key press, or maybe it's selecting a scene from a menu.

Once you've realized that you need something like scenes for your program, you'll have to decide how to program them. Like many things in programming, there are many ways to do that, but we'll hopefully give you a few ideas.