28.04.2019 Views

[JAVA][Beginning Java 8 Games Development]

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 8 ■ Creating Your Actor Engine: Design the Characters for Your Game and Define Their Capabilities<br />

Figure 8-15. Use the Source ➤ Insert Code ➤ Generate ➤ Getter and Setter menu sequence and select all class variables<br />

After you click on the Generate button at the bottom of the Generate Getters and Setters dialog, you will see the<br />

22 new methods, all shiny and new and coded for you by NetBeans. The methods will look like the following:<br />

public double getvX() {<br />

return vX;<br />

}<br />

public void setvX(double vX) {<br />

this.vX = vX;<br />

}<br />

public double getvY() {<br />

return vY;<br />

}<br />

public void setvY(double vY) {<br />

this.vY = vY;<br />

}<br />

public double getLifeSpan() {<br />

return lifeSpan;<br />

}<br />

public void setLifeSpan(double lifeSpan) {<br />

this.lifeSpan = lifeSpan;<br />

}<br />

www.it-ebooks.info<br />

183

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!