Game Development Reference
In-Depth Information
Figure 13-14 . Create event handling for the WSAD keys specifically, by using wKey, sKey, aKey, and dKey variables
Next, we need to use the Source Insert Code Generate Getters and
Setters work process, to have NetBeans write the eight .is() and .set() methods for us,
so that we can access the variables in our Bagel.java class.
Creating ASDW Key Get and Set Methods: NetBeans
Insert Code
Place your cursor in front of the closing } curly brace for the InvinciBagel.java class,
as shown by the light blue area in Figure 13-15 , and use the Source menu to select the
Insert Code option. In the Generate floating menu select the Getter and Setter op-
tion and aKey, dKey, sKey and wKey options, shown in Figure 13-15 , so NetBeans
will generate eight .is() and .set() methods, based on this new Boolean declaration
statement, also shown at the top of this Figure:
 
 
Search WWH ::




Custom Search