Game Development Reference
In-Depth Information
Fig. 18.1 Selecting a
different build configuration
And the same goes for the Draw method. Here we add an extra instruction ( after
having drawn the jewel!) to draw the glitter field. For the complete Jewel class, see
the JewelJam7 example.
Adding glitters to the jewel cart is done in a similar fashion. The only difference
is that we do not provide a target texture in this case. The reason is that the jewel
cart sprite contains partly other colored pixels that are not jewels (such as the cart
and the light beams). Therefore, using the transparency to determine if we can add
a glitter is not really a consistent method. As a result, we allow glitters to appear
everywhere on the top part of the cart by passing null as a parameter for the target
sprite:
glitters = new GlitterField( null , 40, 435, 75);
glitters.Position = new Vector2(275, 475);
glitters.Parent = this ;
Furthermore, we choose a size and position for the glitter field to match the top part
of the cart as closely as possible. For the complete JewelCart class, see the JewelJam7
example.
Debug and release— Just like any piece of software, the compiler that we use
to build an executable has many different options. For example, a compiler
can try to optimize your code during the compilation phase. Other options
are related to the kind of code table used for representing characters, what
kind of application we are building, location of assets and other required files,
and so on. A complete collection of these settings is called a configuration .
When you create a new project, two configurations are created automatically
for you: a debug and a release configuration (see Fig. 18.1 ). The debug con-
figuration does not use any code optimization, and adds additional code to
your executable, so that when you run the program and encounter a bug or the
program crashes, it is easier to find out what happened. When you are running
the debug configuration, the development environment also allows you to put
break points in your code, where the program will automatically pause the
execution. This can be very useful if you want to find out what the values of
member variables or method parameters are while the game is running.
Search WWH ::




Custom Search