Game Development Reference
In-Depth Information
Challenges
1. Changing colors
In this challenge, we're going to modify the DiscoWorld example explained in
Chap. 4 .
(a) Change the program so that the color changes from black to blue instead of
from black to red.
(b) Now modify the program so that the color changes from black to purple.
Can you also modify the program so that the color changes from purple to
black ?
2. Drawing sprites in different locations
As a basis for this challenge, we use the SpriteDrawing example explained in
Chap. 4 .
(a) Modify the program so that three balloons are drawn: one in the top right
corner of the screen, one in the bottom left corner of the screen, and one in
the middle of the screen. (Hint: use the Width and Height properties part of the
Texture2D class.)
(b) Find a few nice sprites on the Internet (confetti, clowns, candy, or any other
party-related things) and draw them on the screen at different positions.
Search for appropriate background music and play it when the application
starts.
3. Flying balloons
This challenge uses the FlyingSprites example (also from Chap. 4 ) as a basis.
(a) Modify the program so that the balloon flies from the top to the bottom of
the screen.
(b) Now modify the program so that the balloon flies in circles around the point
that indicates the center of the screen. Use the Sin or Cos methods that are
available in the Math class. Define a constant that contains the speed at which
the balloon turns around the center point. Also define a constant that con-
tains the distance from the balloon to the center point (e.g. the radius of the
circle).
(c) Change the program so that the balloon flies in circles around a point moving
from the left to the right.
(d) Change the program so that a second balloon also turns in circles around
that point, but in the opposite direction, and with a bigger radius. Feel free
to try a couple of other things as well such as: a balloon that flies in a circle
around another flying balloon, or use another Math method to change the
position of the balloon. Don't go too crazy on this or you'll end up with a
headache!
(e) Finally, add a few flying objects (you could for example use the 'spr_ball_xx'
sprites for that) that bounce off the edges of the screen, by using the Sign
method in the Math class.
Search WWH ::




Custom Search