Game Development Reference
You might have noticed that there's no limit to how high or low the cat can go on the stage. In fact,
you can make the cat go all the way to the top of the stage and continue going beyond it endlessly.
There is a kind of existential appeal to being able to model such an abstract concept as infinity in such
a concrete way, but it doesn't help your game!
You have to limit the cat's range by using a conditional statement with the eb keyword. The condi-
tional statement checks to see whether the cat's y position is in an allowable range; if not, it prevents
the directive in the event handler from running.
An eb statement is very easy to implement. It's a block statement that you can drop anywhere in the
program to check whether a certain condition is pnqa. If the condition is pnqa, the directives inside
the block run. If they're b]hoa, they don't run.
Here's a plain English example of how an eb statement works:
Let's use a real-world eb statement in the methods you've just written to test it:
1. Add the following code in bold to the program (remember to replace -., and .., with what-
ever numbers you've been using):
2. Save the I]ej*]o file and test the project.