Free Tutorials
Internet
What is Internet
Internet Games
Learn TCP IP
HTML
Learn HTML
Learn CSS
Learn XML
Learn WML
Database
Learn Access
Learn Data-VB
Learn Oracle
Learn SQL
Programming
Learn ActiveX
Learn C++
Learn CGI_Perl
Learn Interdev
Learn Java
Learn JavaScript
Learn Vbscript
Learn VisualBasic
Learn VC++
Operating systems
Learn RedHat
Learn Unix
Learn Winnt

appendix A

Quiz Answers


CONTENTS


This appendix contains answers to the quiz questions presented at the end of each lesson. Please refer to these answers to check your own answers to the questions. I would tell you to feel free to grade yourself, but this is supposed to be fun!

Chapter 1

  1. This is just too easy-it's Visual Basic! Just kidding, the correct answer is Java.
  2. The opportunity to allow people from all over to share in an interactive gaming experience.

Chapter 2

  1. The keyboard and mouse.
  2. It only supports the ULAW sound format and doesn't provide any means to manipulate sound data.
  3. A piece of multimedia data used by a game, such as an image or a sound.
  4. To tell the story of a game graphically, scene by scene, by using rough sketches of each scene.

Chapter 3

  1. Software bundles of data and the methods that act on that data.
  2. The process of packaging an object's data together with its methods.
  3. Because it allows parts of a program to change without subsequently affecting other parts, resulting in far better control over code maintenance.
  4. Performance.

Chapter 4

  1. CompuServe created the GIF image format in 1987 as a means to establish platform-independence in graphical images.
  2. The technique of storing an image so that it can be drawn incrementally as it is being loaded. Interlacing is used frequently in Web page images.
  3. The process of reducing the colors in an image to a lesser number of colors, while still maintaining a similar look.
  4. A graphical object with multiple animation frames, which are also known as phases of the object.
  5. Decide how much you can afford to pay for the artwork, find out if the artist has experience with computer graphics, and develop a good idea of what specific artwork you want the artist to create.

Chapter 5

  1. Red, green, blue, and alpha.
  2. An abstract representation of a drawing surface.
  3. The FontMetrics class.
  4. To provide a means of monitoring the load progress of images and (eventually) other media objects.

Chapter 6

  1. The illusion of movement is created by displaying images in rapid succession with small changes in content between each.
  2. Frame-based animation and cast-based (sprite) animation.
  3. Transparency is a technique used to draw only the relevant part of a rectangular image. This is extremely useful in sprite animation, where many objects have irregular shapes yet are modeled as rectangular images.
  4. Flicker is the annoying phenomenon created when the screen is erased between each frame of an animation sequence. This is caused by the rapid combination of erasing and then drawing the next frame, and it can be fixed only by eliminating the requirement of erasing the screen.
  5. Double buffering is a technique that helps eliminate flicker when displaying an animation. It involves drawing the next frame of animation to an offscreen buffer and then drawing the buffer to the screen. This eliminates flicker because the screen never has to be erased; the offscreen buffer is erased with each new frame.

Chapter 7

  1. By the integers 0 to 7, where 0 represents 0 degrees (facing up) and each other integer represents angles increasing by 45 degrees each time. For example, 3 represents 135 degrees and 4 represents 180 degrees.
  2. The velocity multipliers are used to alter the velocity based on the direction. For example, if the direction is 2, the angle is 90 degrees and the sprite is facing right. Therefore, the X velocity needs to be positive and the Y velocity needs to be zero.
  3. In the update method of the Tarantula class, the decision of whether to create new spiderlings is determined in a completely random fashion.
  4. The same way that they determine whether to create spiderlings: randomly via the update method.
  5. Two reasons. First, because you want to limit to 10 the number of sprites that could be added to the list. Second, because you want to eliminate collision detection and let the tarantulas walk all over each other.

Chapter 8

  1. Absolute and relative.
  2. Sorry, this was a little bit of a trick question. The answer is whichever one works best! The point is that there are no hard rules when determining the best user input approach in games.
  3. In Java, it's not! This is a little inside joke for DOS (yikes!) game programmers. Fortunately, Java frees you from the burdens of low-level, processor-specific coding such as interrupt routines, and it lets you deal with input at a more meaningful level.

Chapter 9

  1. An event is simply something that happens that you might want to know about.
  2. Call the shiftDown method on the Event object that is passed into the mouseMove event handler method.
  3. By overriding the mouseExit event handler method.
  4. The keyboard controls for the saucer are implemented by overriding the keyDown event handler method and setting the velocity of the saucer according to which arrow key was pressed. The mouse controls for the saucer are implemented by overriding the mouseDown and mouseDrag methods and setting the position of the saucer based on the mouse position.

Chapter 10

  1. Frogger! That was just too easy.
  2. With some lousy, meaningless points!
  3. The keyDown event handler method is used to detect when the arrow keys are pressed. If an arrow key is pressed, the gecko's velocity is set accordingly. To only allow one movement per key press, the gecko's velocity is reset to zero in the update method for Gecko.
  4. Pretty well. Geckos are extremely fast-much faster than your Java-handicapped gecko.
  5. By overriding the action method and checking to see whether the event target is of type Button. If so, the arg parameter is cast to a String and compared to the string "New Game". If there is a match, the button was indeed pressed, so the newGame method is called.

Chapter 11

  1. A sound wave is a series of traveling pressure changes in the air.
  2. A/D converters handle the task of converting analog audio signals to digital audio signals that can be represented in a computer.
  3. 8000 Hz.
  4. The amount of time between when you play a sound in an applet and when the user actually hears it.

Chapter 12

  1. Unfortunately, the answer is no. You'll have to wait for a future release of Java to remedy this situation. However, all is not lost, because on Chapter 11 you learned that many popular sound editing tools enable you to convert sounds across a wide variety of formats.
  2. The getCodeBase method returns the base URL for the location of the current applet, whereas the getDocumentBase method returns the base URL for location of the HTML document containing the applet. Because resources such as sounds are typically stored relative to the applet, it is both safer and smarter to use getCodeBase when you need a URL for loading a resource.
  3. When you need to play a looped sound or when you plan on playing a sound more than once.
  4. By calling the stop method on the AudioClip object used to loop the sound.

Chapter 13

  1. Sky Harbor Airport in Phoenix, Arizona.
  2. Because you need to be able to ignore the net sprite when looking to see whether the player clicked a scorpion. It also enables you to override the default response to collision detections.
  3. Because they're nocturnal creatures.
  4. Because it is necessary to stop the looped music when the update thread is stopped. Otherwise, it would be possible for the music to keep playing even though the rest of the applet was stopped.
  5. Because it must be accessible by other classes. More specifically, the lost member variable is incremented in the update method of the Scorpion class.

Chapter 14

  1. Single-stepping provides you with a means to see exactly how your code is being executed, one line at a time.
  2. A runtime error in your code.
  3. When a derived class adds a variable with the same name as a variable in one of its parent classes.
  4. A list of the methods called en route to the currently executing code.

Chapter 15

  1. Chasing, evading, and patterned.
  2. Different behaviors are assigned probabilities for an object and then selected based on these probabilities; each behavior represents a particular type of action for an object, such as fighting or fleeing.
  3. Calculating a score based on the current state of the game.
  4. Because hardware has only recently reached a point where it can begin dealing with the heavy amount of processing required of most AI systems.

Chapter 16

  1. The map is used to provide an efficient and logical way of representing all the different winning scenarios in the game. Without the map, you would have a significantly more difficult time calculating scores and determining whether a player has won.
  2. Because it logically makes sense to divide it into two separate components. More important, however, is the fact that Connect4State must be able to be copied and used temporarily in a recursive manner. This usage wouldn't be possible if everything was combined in a single class.
  3. Because the computer player's thinking algorithm is not implemented in a thread. This results in the algorithm tying up the system while it is running. Because the system is tied up, the screen isn't updated and, therefore, the hand selector isn't drawn.

Chapter 17

  1. Turn-based and event-based.
  2. From a strictly game design perspective, there is no difference. The difference arises when you assess the bandwidth limitations of each. Modem connections have much smaller bandwidths than physical connections.
  3. State synchronization, input synchronization, and hybrid.

Chapter 18

  1. A software abstraction that represents a communication channel for a particular service such as FTP or HTTP.
  2. Sockets are significant to network programming because they allow you to focus on input and output operations, independent of the intricacies and specifics involved with the network itself.
  3. Stream sockets act like active connections, with data being transferred immediately in real time; datagram sockets just broadcast data over the Internet and hope that it eventually makes it to the intended destination at some point in the future.
  4. The generic socket class is important because it isolates the common code involved in establishing general communications between clients and a server. This code can be easily reused in more specific client/server classes designed to support a particular game.

Chapter 19

  1. A daemon thread is a thread that runs in the background and performs some type of support function, such as managing client communications in the NetConnect4 game.
  2. The Game class handles the details of managing the game logic and the communication between players from the server side.
  3. The Connect4ClientConnection class handles establishing a client socket connection, along with managing the communication between players from the client's perspective.

Chapter 20

  1. Maintainability, size, and speed.
  2. Method inlining.
  3. A profiler helps you isolate which code is being called the most and how much time is being spent there, which tells you where to direct your optimization efforts.
  4. When your code is reliant on costly calculations that can be replaced with a table of integer constants.

Chapter 21

  1. Graphics utilities and sound utilities.
  2. The one that works for you! That's no joke, because a development tool is only useful to the degree that it saves you time and energy. Research the tools for yourself and decide which, if any, of them might suit your needs.
  3. Rest and relaxation! Come on, you've finished the guide; go have a little fun and unwind!







|  About us | Categories | New Releases | Most Popular | Web Tutorial | Free Download | Drivers |



2019 Soft Lookup Corp. Privacy Statement