Sometimes they fail to even start because of errors. Other times they run, but with glitches and bugs.
Sometimes we can stare at our code for hours, not seeing why it's glitching and not doing what we intended.
It's definitely doing what we told it to do. Just not what we wanted.
In those situations, it can be very useful to some idea of what's going on as your program runs. Of course, you can see your sprites move around the screen, and maybe you're even using fillText() to display the values of a few important variables (like the mouse position) on the canvas.
Some of you may even have used alert() in some important places to let you know what's going on. For example, raise an alert() every time the hero bounces off the bad-guy.
Alert() is really helpful, but it can interrupt the flow of your program, and it's entirely possible to have too many alerts going on, to the point they become unwieldy.
Fortunately there's a better way to get information from a running program.
|
|