⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 appa.htm

📁 对于程序员来说可以利用JAVA来开发网络游戏!
💻 HTM
📖 第 1 页 / 共 2 页
字号:
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 <TT><FONT FACE="Courier">update</FONT></TT>
method for <TT><FONT FACE="Courier">Gecko</FONT></TT>.
<LI>Pretty well. Geckos are extremely fast-much faster than your
Java-handicapped gecko.
<LI>By overriding the <TT><FONT FACE="Courier">action</FONT></TT>
method and checking to see whether the event target is of type
<TT><FONT FACE="Courier">Button</FONT></TT>. If so, the <TT><FONT FACE="Courier">arg</FONT></TT>
parameter is cast to a <TT><FONT FACE="Courier">String</FONT></TT>
and compared to the string <TT><FONT FACE="Courier">&quot;New
Game&quot;</FONT></TT>. If there is a match, the button was indeed
pressed, so the <TT><FONT FACE="Courier">newGame</FONT></TT> method
is called.
</OL>
<H2><A NAME="Day11"><B><FONT SIZE=5 COLOR=#FF0000>Day 11</FONT></B></A>
</H2>
<OL>
<LI>A sound wave is a series of traveling pressure changes in
the air.
<LI>A/D converters handle the task of converting analog audio
signals to digital audio signals that can be represented in a
computer.
<LI>8000 Hz.
<LI>The amount of time between when you play a sound in an applet
and when the user actually hears it.
</OL>
<H2><A NAME="Day12"><B><FONT SIZE=5 COLOR=#FF0000>Day 12</FONT></B></A>
</H2>
<OL>
<LI>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 Day 11 you learned that many popular sound
editing tools enable you to convert sounds across a wide variety
of formats.
<LI>The <TT><FONT FACE="Courier">getCodeBase</FONT></TT> method
returns the base URL for the location of the current applet, whereas
the <TT><FONT FACE="Courier">getDocumentBase</FONT></TT> 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 <TT><FONT FACE="Courier">getCodeBase</FONT></TT>
when you need a URL for loading a resource.
<LI>When you need to play a looped sound or when you plan on playing
a sound more than once.
<LI>By calling the <TT><FONT FACE="Courier">stop</FONT></TT> method
on the <TT><FONT FACE="Courier">AudioClip</FONT></TT> object used
to loop the sound.
</OL>
<H2><A NAME="Day13"><B><FONT SIZE=5 COLOR=#FF0000>Day 13</FONT></B></A>
</H2>
<OL>
<LI>Sky Harbor Airport in Phoenix, Arizona.
<LI>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.
<LI>Because they're nocturnal creatures.
<LI>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.
<LI>Because it must be accessible by other classes. More specifically,
the <TT><FONT FACE="Courier">lost</FONT></TT> member variable
is incremented in the <TT><FONT FACE="Courier">update</FONT></TT>
method of the <TT><FONT FACE="Courier">Scorpion</FONT></TT> class.
</OL>
<H2><A NAME="Day14"><B><FONT SIZE=5 COLOR=#FF0000>Day 14</FONT></B></A>
</H2>
<OL>
<LI>Single-stepping provides you with a means to see exactly how
your code is being executed, one line at a time.
<LI>A runtime error in your code.
<LI>When a derived class adds a variable with the same name as
a variable in one of its parent classes.
<LI>A list of the methods called en route to the currently executing
code.
</OL>
<H2><A NAME="Day15"><B><FONT SIZE=5 COLOR=#FF0000>Day 15</FONT></B></A>
</H2>
<OL>
<LI>Chasing, evading, and patterned.
<LI>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.
<LI>Calculating a score based on the current state of the game.
<LI>Because hardware has only recently reached a point where it
can begin dealing with the heavy amount of processing required
of most AI systems.
</OL>
<H2><A NAME="Day16"><B><FONT SIZE=5 COLOR=#FF0000>Day 16</FONT></B></A>
</H2>
<OL>
<LI>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.
<LI>Because it logically makes sense to divide it into two separate
components. More important, however, is the fact that <TT><FONT FACE="Courier">Connect4State</FONT></TT>
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.
<LI>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.
</OL>
<H2><A NAME="Day17"><B><FONT SIZE=5 COLOR=#FF0000>Day 17</FONT></B></A>
</H2>
<OL>
<LI>Turn-based and event-based.
<LI>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.
<LI>State synchronization, input synchronization, and hybrid.
</OL>
<H2><A NAME="Day18"><B><FONT SIZE=5 COLOR=#FF0000>Day 18</FONT></B></A>
</H2>
<OL>
<LI>A software abstraction that represents a communication channel
for a particular service such as FTP or HTTP.
<LI>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.
<LI>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.
<LI>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.
</OL>
<H2><A NAME="Day19"><B><FONT SIZE=5 COLOR=#FF0000>Day 19</FONT></B></A>
</H2>
<OL>
<LI>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.
<LI>The <TT><FONT FACE="Courier">Game</FONT></TT> class handles
the details of managing the game logic and the communication between
players from the server side.
<LI>The <TT><FONT FACE="Courier">Connect4ClientConnection</FONT></TT>
class handles establishing a client socket connection, along with
managing the communication between players from the client's perspective.
</OL>
<H2><A NAME="Day20"><B><FONT SIZE=5 COLOR=#FF0000>Day 20</FONT></B></A>
</H2>
<OL>
<LI>Maintainability, size, and speed.
<LI>Method inlining.
<LI>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.
<LI>When your code is reliant on costly calculations that can
be replaced with a table of integer constants.
</OL>
<H2><A NAME="Day21"><B><FONT SIZE=5 COLOR=#FF0000>Day 21</FONT></B></A>
</H2>
<OL>
<LI>Graphics utilities and sound utilities.
<LI>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.
<LI>Rest and relaxation! Come on, you've finished the book; go
have a little fun and unwind!
</OL>
<P>
<HR WIDTH="100%"></P>

<CENTER><P><A HREF="ch4rev.htm"><IMG SRC="pc.gif" BORDER=0 HEIGHT=88 WIDTH=140></A><A HREF="index.htm"><IMG SRC="hb.gif" BORDER=0 HEIGHT=88 WIDTH=140></A><A HREF="#CONTENTS"><IMG SRC="cc.gif" BORDER=0 HEIGHT=88 WIDTH=140></A><A HREF="appb.htm"><IMG 
SRC="nc.gif" BORDER=0 HEIGHT=88 WIDTH=140></A></P></CENTER>

<P>
<HR WIDTH="100%"></P>

</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -