O'Reilly logo

Going to War: Creating Computer War Games by Jason Darby

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Counters or Other Objects

In addition to using the debugger, you can also place objects on your frame and set a value to them in real-time to see that your program is working correctly (or not).

A perfect example of when you might use this is for items such as fixed values or spread values. This is where values are assigned to objects when you have many objects. For example, if you want to know the value of a particular fixed value or other value of any of the 50 objects, you may not want 50 counters on screen to show you if they are set correctly or not.

A useful way is to set a single counter to a value when you click on an object. This is very useful in our war game examples for checking to see if a fixed value is returned correctly. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required