Game Development Reference
In the previous example, [_heajpD]oIkjauEj=__kqjp is b]hoa, so the cap method returns b]hoa. The
poor client's [d]oIkjau property then also gets a value of b]hoa. pnqa and b]hoa are Boolean values,
so you need to include this information as part of the function definition:
The result of all this is bad for the client, but great for the bank, and actually reflects the reality of the
situation. Using the cap method prevented the client from directly changing one of the bank's prop-
erties and the bank from being robbed. It's this kind of careful programming that that will save your
games from strange bugs that might be extremely difficult to trace or track down.
As you might have guessed, cap methods are affectionately known as getters .
Getters have partners in crime called setters . Setters use the oap keyword and are used by an object
to receive information from another object.
Hooray! The client just a received a check in the mail for a Flash game she designed! Let's have a look
at how you could use a setter to help the impoverished client put this money into the bank:
Here's what the >]jg class looks like, featuring a setter called `alkoep: