dr.com宽带认证dalipaycom客户端登录提示清理UI socket资源 然后就自动退出怎么办

----> 网络游戏的设计与实现论文作者姓名
网络游戏的设计与实现论文作者姓名
&&&&&&&&&&&&
毕业设计(论文)&&&&&&&&泡泡堂网络游戏的设计与实现&&&&&&&&论文作者姓名:申请学位专业:申请学位类别:指导教师姓名(职称):论文提交日期:&&&&&&&& 泡泡堂网络游戏的设计与实现摘要&&&&&&&&网络游戏开发是一项很大的工程,需要很多综合性的知识。这对于刚刚入门的开发者来说很难理解。本论文从研究开发一个模仿泡泡堂网络游戏的例子出发,讲述网络游戏开发中用到的一些最基本的知识和设计思想,使大家清晰的理解游戏开发的过程。整个设计中利用java中的swing编程,结合游戏的操作流程,对整个游戏进行精心的设计和大量的测试,实现游戏软件服务器端和客户端的开发,为玩家提供一个友好美观的操作界面,并添加聊天等功能以增加玩家之间的互动性,此外实现了可编辑场景地图的功能,使得游戏内容的更加丰富,玩家交互性更好,确保了游戏更具有趣味性、灵活性,以满足玩家对这款网络游戏的要求。&&&&&&&&关键词:消息传输;java-swing;网络游戏;线程;场景&&&&&&&& TheDesignandImplementationof“PaoPaoTang”NetworkPaoPaoTang”Game&&&&Abstract&&&&Networkgamedevelopmentisabigprojectthatrequiresalotofintegrationofknowledge.Itisdifficulttounderstandforbeginnerinthisfield.ThisthesisbaseontheresearchanddevelopmentofaGamenamed“PaoPaoTang”,asanexample,itdescriptthedevelopmentoffundamentalknowledgeandtheorywhendesignanetworkgame,sothatwecanmoreclearlyunderstandthegamedevelopmentprocess.Thewholedesignusesthejava-swingprogramming,combineswiththeoperationofthegame,designstheentiregameanddoesnumeroustests,realizethegamesoftwarerunningatserverandclient,provideafriendlyandaestheticallypleasinginterfaceforplayers,andaddchatfunctionstoincreasethecommunionbetweentheplayerseachother.Inadditiontodesignsthescenemapeditingfunctionstomakethegameforrichercontentandbetterinteractivewithplayers.Finallytoensurethatthegameismorefunandflexibilityitcansatisfythenetworkgamerequirementsforplayers.&&&&&&&&Keywords:java-scene&&&&&&&& 目&&&&1&&&&&&&&录&&&&论文总页数:21页&&&&&&&&引言..........................................................................................................................................11.11.21.3课题背景...........................................................................................................................1泡泡堂游戏简介...............................................................................................................1本课题研究的意义...........................................................................................................1&&&&&&&&2&&&&&&&&开发的环境及相关技术的介绍...............................................................................................22.12.2开发环境...........................................................................................................................2JAVA语言的特点..............................................................................................................2&&&&&&&&3&&&&&&&&需求分析..................................................................................................................................23.13.2游戏的操作流程...............................................................................................................2应该解决的问题...............................................................................................................4&&&&&&&&4&&&&&&&&系统设计..................................................................................................................................44.14.24.3处理流程...........................................................................................................................4数据流..............................................................................................................................5部署方案...........................................................................................................................6&&&&&&&&5&&&&&&&&系统实现..................................................................................................................................65.15.25.35.4代码结构...........................................................................................................................6公共类的介绍...................................................................................................................7服务器端的开发...............................................................................................................8客户端..............................................................................................................................9模块设计...................................................................................................................9游戏入口程序.........................................................................................................10登陆.........................................................................................................................10游戏大厅.................................................................................................................11对战场地.................................................................................................................13&&&&&&&&5.4.15.4.25.4.35.4.45.4.56结&&&&&&&&测试........................................................................................................................................18论........................................................................................................................................19&&&&&&&&参考文献........................................................................................................................................19致声谢........................................................................................................................................20明........................................................................................................................................21&&&&&&&& 1引言&&&&1.1课题背景&&&&最近几年游戏产业特别是网络游戏得到飞速发展。而随着人们工作节奏的加快,小型的、竞技性的网络游戏因为游戏所需时间短,竞技性和娱乐性强等特点,越来越受到工作人士的喜爱。盛大公司推出的“泡泡堂”是一款比较好也是比较成功的网络小游戏。本课题就是想对该游戏进行分析研究,借助于它的游戏规则,用java语言模拟开发一个类似的,功能相对简单的网络小游戏。从而使自己更清楚的认识小游戏开发需要的知识和开发的环节和涉及到的领域。&&&&&&&&1.2泡泡堂游戏简介&&&&在2004年全世界最火爆、在线人数最多的网络游戏,不是《传奇》、《奇迹》等深受欢迎的传统MMO,也不是《梦幻西游》《剑网》《巨商》等一大批后起、、之秀,而是盛大旗下的一款休闲游戏—《泡泡堂》。《泡泡堂》是韩国第一人气网络游戏,拥有多达2500万的注册用户。它以简单趣味征服玩家。有专家将玩家区分为临时玩家、中间玩家和忠实玩家三类。而《泡泡堂》的服务对象大部分都是临时玩家。对于这一概念的定义为:年龄层从10岁到20岁甚至35岁左右,每天平均游戏时间约为2小时,希望选择可以即刻得到结果、界面简洁的游戏。临时玩家是互联网娱乐初级阶段的玩家层,对数字娱乐有一定渴望,对上手较难的游戏有畏惧感。他们比忠实玩家要更广泛,而且还是最有开发价值的目标人群。有资料统计,在美国临时玩家和忠实玩家之间的比例大约是50:1,在中国这种差距可能会更高。而休闲游戏恰恰抓住了这些临时玩家对互动娱乐的需求。休闲游戏简单轻松,趣味十足,临时玩家们在短时间内就可获得游戏所带来的互动趣味和成就感。这些其实是休闲游戏成功的最大法宝。开发商非常清楚的认识到了这一点,他们以红白机的《炸弹人》作为原形,针对市场开发出了《泡泡堂》。使游戏操作简单,极易上手,富有乐趣,充分吸收了《炸弹人》的诸多优点。在保留精髓的同时,《泡泡堂》还开发了一些有创意的玩点,加入一些很有影响力的娱乐元素(Avatar),使产品线更丰富,满足了临时玩家多方面的互联网娱乐需求。&&&&&&&&1.3本课题研究的意义&&&&本课题以开发该游戏为平台,综合运用网络编程,数据之间的通讯,程序中算法的实现,线程的分配,程序运行中的内存使用情况的控制等。通过这些技术的综合运用,更深入的了解计算机程序方面的相关知识,熟悉游戏开发的理念和流程,了解整个游戏项目开发的关注点。该课题属于研究性的一个课题,不考虑商业上的应用。只是对技术研究的&&&&&&&&第1页共21页&&&&&&&& 并不是游戏本身的娱乐性。&&&&&&&&2开发的环境及相关技术的介绍&&&&2.1开发环境&&&&操作系统:MicrosoftWindowsXP开发语言:java2开发包:Java(TM)2StandardEdition(5.0),JFCSwing.IDE:Eclipse3.2测试环境:局域网,PC机&&&&&&&&2.2Java语言的特点&&&&1.平台无关性Java引进虚拟机原理,并运行于虚拟机,实现不同平台之间的Java接口。Java的数据类型与机器无关。2.安全性Java的编程类似C++,但舍弃了C++的指针对存储器地址的直接操作,程序运行时,内存由操作系统分配,这样可以避免病毒通过指针入侵系统。它提供了安全管理器,防止程序的非法访问。3.面向对象Java吸收了C++面向对象的概念,将数据封装于类中,实现了程序的简洁性和便于维护性,使程序代码可以只需一次编译就可反复利用。4.分布式Java建立在TCP/IP网络平台上,提供了用HTTP和FTP协议传送和接收信息的库函数,使用其相关技术可以十分方便的构建分布式应用系统。5.健壮性Java致力与检查程序在编译和运行时的错误,并自动回收内存,减少了内存出错的可能性。Java取消了C语言的结构、指针、#define语句、多重继承、goto语句、操作符、重载等不易被掌握的特性,提供垃圾收集器自动回收不用的内存空间。&&&&&&&&3需求分析&&&&本设计主要是实现一个类似于“泡泡堂”功能的网络游戏。其操作流程及其主要功能如下介绍&&&&&&&&3.1游戏的操作流程&&&&游戏的操作类似于网络游戏QQ堂。其操作流程如图1所示。&&&&&&&&第2页共21页&&&&&&&& 图1游戏操作流程&&&&&&&&1.首先要先运行服务器端,来处理各个客户端发来的请求。2.玩家运行客户端,首先展现一个版权声明的界面,因为游戏中的图片来源于腾迅公司的QQ堂游戏,图片的版权归腾迅公司所有。3.几秒后自动跳到登录界面。在这里输入用户名称,密码。因系统中没有对数据库进行操作,并没有保存用户的相关信息,所以没有注册的功能,也没有对密码的正确与否进行验证。输入密码后点击登录进入游戏大厅,退出则关闭程序。4.进入大厅后,用户可以选择自己的角色,蓝队或者红队,并可以进行聊天对话。点击准备时将进入准备状态。当所有用户都进入准备状态,游戏自动进入对战场地进行对战游戏。5.在对战时,玩家可以用方向键盘控制人物的移动,人物只能在空地中移动,当遇到“箱子”时,可以使用“空格键”放置“泡泡”,利用“泡泡”的爆炸的威力去破坏周围的障碍物(“仙人掌”不能被破坏掉)。同时可以一连串放置多个“泡泡”,放置“泡泡”后,“泡泡”将持续几秒钟才会爆炸,在这段时间玩家可以放置更多的“泡泡”来攻击对手,在运动过程中还要及时躲开“泡泡”的爆炸区域。当玩家被“泡泡”炸中,则该玩家的生命将结束,不能继续进行游戏6.当有一个队中的所有玩家都死掉,则该队挑战失败,对方获胜。&&&&&&&&第3页共21页&&&&&&&& 3.2应该解决的问题&&&&本程序需要解决的主要问题:1.游戏程序是一项精度要求很高的程序系统,因为其代码利用率很高。一个实时运行的最终作品,每秒都会运行成千上万行程序,绘图事件、键盘事件都会以极高的频率在后台等待响应,若有丝毫的差别都将很容易导致程序在运行不久后可能出现严重错误,甚至死循环。因此,其逻辑设计应当相当严谨,需将所有可能发生的事件及意外情况考虑在设计中。2.网络计算机之间的数据通讯:用socket进行编程,同时由于对人同时游戏,要尽量减少网络数据的传输量,提高传输效率,防止堵塞。3.算法的设计:算法是游戏的核心,要设计很好的算法,提高游戏运行的效率,运行速度要高,并且资源占用的要少。4.线程的控制:由于涉及到对个玩家,并且要即时的将数据进行网络传输,因此可以用多个线程来并发执行这些操作。线程之间的同步和调度上要很好的控制。5.双缓存:在图片之间相互调用转换时,图像的画面要流畅,不能有停顿和闪烁6.游戏中为了美观,适用性强,可能需要采用外部文件引入的图片贴图,有关贴图,这里使用了QQ堂游戏里的一些截图来美化界面,同时对解决静态或动态、画面背景、屏幕刷新的双缓冲等都有较好的解决方案。以上相关技术细节和整体流程将分别在以下小节阐述。&&&&&&&&4系统设计&&&&本游戏开发采用C/S结构,分为服务器端和客户端两部分。&&&&&&&&4.1处理流程&&&&服务器端主要处理各个客户端发过来的消息(Message),并根据消息的类型,对消息进行不同的处理,然后将处理后的消息转发或者直接转发消息到所有玩家。客户端则监听用户的输入动作,包括键盘和鼠标动作,对于不同的动作做不同的处理,并根据玩家动作的类型,把所有信息封装为一个消息的实体(Message),然后发到服务器端。同时要监听服务器端的回复过来的消息当收到一个新的消息,将对消息进行解析,根据消息的类型作不同的处理,从而改变游戏场景或者状态等。处理流程如图2所示。&&&&&&&&第4页共21页&&&&&&&& 图2处理流程&&&&&&&&4.2数据流&&&&在整个系统中,客户端和服务器端所有的信息都是通过一个封装的Message来传输的,它们的传输数据流如图3所示(这里以一次通讯为例)&&&&&&&&图3数据流&&&&&&&&当一个客户端把玩家的动作封装为一个的消息,之后发送到服务器端。服务器端接收到该消息,并对该消息进行解析处理。然后将处理过的消息转发给当前的所有客户端,包括消息的发出者。客户端收到该消息,根据消息的类型&&&&&&&&第5页共21页&&&&&&&& 来解析,然后处理并改变当前的场景。&&&&&&&&4.3部署方案&&&&因为游戏为一个网络游戏,要多个玩家同时参加互动。所有程序有服务器端和客户端两部分。它们部署图如图4所示:&&&&&&&&图4部署图&&&&&&&&服务器端部署服务器端程序,负责保存当前玩家的信息,对客户端发过来的消息进行处理并转发等。客户端只需要部署客户端程序,负责发送消息并处理游戏主要逻辑。&&&&&&&&5系统实现&&&&5.1代码结构&&&&&&&&图5代码结构&&&&&&&&第6页共21页&&&&&&&& 程序是用eclipse平台开发,在该平台下代码组织如图5所示。代码结构的详细介绍参考表1。&&&&表1&&&&文件夹Src游戏源代码包名称net.jeson.game.util(存放系统中经常用到的类,系统级)net.jeson.game.server(存放服务器端相关的类)net.jeson.game(存放启动游戏所有到的类)net.jeson.game.biz(存放处理一些业务逻辑的类)Bomb.javaMessage.java管理放置的“泡泡”的类用来封装客户端和服务器端直接通讯的消息的类MessageManager.javanet.ponent(存放一些可以被重用的swing组件,主要是用来UI的设计)CenterShowDialog.javaGameImage.javaImageButton.javaImageLabel.javaImagePanel.javanet.jeson.game.ui(游戏主要显示的界面)Login.javaGameHall.javaQQFrame.javaQQPad.javaImages(存放游戏所用到的图片)Map(存放游戏对战场景中的地图。)管理消息的接收和发送把窗口显示的位置在屏幕上居中管理图片加载创建的类定义一个图片按钮定义一个图片的label.定义一个图片的panel登陆游戏的界面游戏大厅的界面启动对战场景的窗口对战场景中的画布Game.java启动游戏的入口类Util.javaServer.java系统级的类服务器端的主程序&&&&&&&&代码结构介绍&&&&类GameKey.java描述系统级参数&&&&&&&&5.2公共类的介绍&&&&系统中定义了一些公共的类,可以被客户端和服务器端多次使用,这些类里的方法多是静态的。?GameKey.java这里定义了一些系统级的一些参数,都是静态的。?Util.java主要定义了4个方法,用户测试时候打印信息的,全屏的,和关闭显示窗口的方法。?MessageManager.java声明了发送消息和接收消息的两个方法。控制着客户端和服务器端之间的数据交换。&&&&&&&&第7页共21页&&&&&&&& 5.3服务器端的开发&&&&服务器端开发是使用JAVA语言中的套接字,采用TCP协议进行通讯的。通讯的数据全部封装在一个Message类里面。这些数据在网络之间传输并在客户端和服务器端进行解析,得到后作出相应的动作。处理流程参考图6.&&&&&&&&图6服务器端处理流程&&&&&&&&服务器端主要用到了java中的网络编程和线程。在构造函数中,利用默认端口创建一个套接字ServerSocket(Port);然后进入一个无限循环来监听网络连接,每当有一个新的客户端连接到服务器,建立一个新的线程来处理该客户请求。之后服务器端继续监听,等待新的客户端连接。&&&&try{serversocket=newServerSocket(port);System.out.println(GameServerstartedat:+serversocket.getInetAddress().getLocalHost()+:+serversocket.getLocalPort());while(true){//设置玩家的编号:1-8if(number8){number++;}else{number=0;}&&&&&&&&第8页共21页&&&&&&&& clientsocket=serversocket.accept();System.out.println(Connectionfrom:+clientsocket);out=newObjectOutputStream(clientsocket.getOutputStream());ht_out.put(clientsocket,out);ServerThreadserverThread=newServerThread(clientsocket,ht_out,number,out,allMessage);Threadthread=newThread(serverThread);thread.start();}&&&&&&&&ServerThread被启动后,也执行一个无限循环,对连接通道进行监听,如果有该通道发过来的信息,就对相关的信息进行处理,之后把处理后的消息转发给所有玩家。&&&&&&&&5.4客户端&&&&首先在程序中定义了几个通用的组件和方法:CenterShowDialog,GameImage.java,ImageButton.java,ImageLabel.java和ImagePanel.javaCenterShowDialog:这个类的功能是使显示的图形界面居中。ImagePanel:定义一个背景为一个image的画板(panel)GameImage:这里定义了一些对图片操作的类,如创建一个图片等。ImageButton:定义一个图片按钮(JButton)ImageLabel:定义一个图片的标签这些通用的组件和方法供各个模块所公用。一些场景的设置是在它们的基础上进行搭建的。5.4.1模块设计如图7所示,游戏客户端总体分为4个大的模块:游戏入口,登陆,游戏大厅,和对战场地。&&&&&&&&第9页共21页&&&&&&&& 客户端游戏入口&&&&&&&&提示一些版权信息&&&&&&&&登陆&&&&&&&&输入玩家名称,密码&&&&&&&&游戏大厅&&&&&&&&角色选择,聊天,状态改变&&&&&&&&对战场地&&&&&&&&利用泡泡攻击对方&&&&&&&&图7客户端模块划分图&&&&&&&&以下对具体模块的设计进行详细介绍。5.4.2游戏入口模块主要类:Game.java描述:显示一个无标题栏的窗口,提示一些版权信息,如图8所示。&&&&&&&&图8游戏声明&&&&&&&&首先在它的构造方法中初始化该JFrame的相关属性。在main方法中,先声明一个Game类,创建声明窗口。之后调用Util方法中的showWindow()方法,显示该窗口的动态展开,产生一个动画的效果。窗口将停顿5秒,以便玩家有足够的时间来阅读相关内容。最后调用Util方法中的closeWindow()方法来动态地收缩关闭该窗口。随后创建一个Login类,并将其显示,进入登录模块,同时隐藏该声明信息窗口。5.4.3登陆模块主要类:Login.java描述:显示登陆界面(效果请参考图9),并处理相关的鼠标动作,输入玩&&&&第10页共21页&&&&&&&& 家名称,密码等,登陆后和服务器建立连接,并发送信息到服务器。(因为不设计到数据库,这里并没有对玩家输入的相关信息进行验证,也没有注册玩家信息的功能)&&&&&&&&图9登陆界面&&&&&&&&因设计到对一些组件的监听,并对鼠标事件进行监听,该类实现了相关方法:&&&&publicclassLoginextendsJFrameimplementsActionListener,mouseMotionListener&&&&&&&&构造方法调用init()方法对类进行初始化,这里主要是创建了两个ImageButton:login_bt和exit_bt,两个文本框:user和password,设置它们被显示的位置和样式,同时为两个ImageButton增加鼠标监听事件。当鼠标点击login_bt时,将触发一个事件,捕捉该事件,并进行处理。处理过程:从user和password两个文本框得到玩家输入的信息,把这些信息作为属性值赋值给一个新的Message实体。创建一个和服务器的新的连接,把这个message发送到服务器段。之后创建一个GameHall:new&&&&GameHall(msg,in,out);&&&&&&&&5.4.4游戏大厅模块主要类:GameHall.java描述:游戏大厅的主界面,同时负责处理玩家一些鼠标事件,并和服务器进行通讯,发送/接受消息。当鼠标触发一些事件时候,对事件的内容进行解析,然后根据不同的事件,创建不同类型的消息,把相关的必要的信息进行封装,最后发给服务器。由服务器进行处理后,服务器发送消息给所有客户端,客户端接收到消息,并对接收到的消息进行处理,来改变大厅场景。该类中设计到对整个大厅中鼠标和键盘事件的监听,并创建一个主的线程来监听从服务器端发来的消息。因此该类实现了MouseListener,&&&&第11页共21页&&&&&&&& MouseMotionListener,Runnable,KeyListener等接口。构造方法中调用了init()方法。初始化大厅用到的一些组件。整个大厅是一个ImagePanel,一个画布。所有的组件都是在这个画布上增加。并为这些组件增加一个监听器来监听它们的动作。之后程序启动主线程,对服务器发来的消息进行监听,并在解析后作出相应的动作。&&&&thread=newThread(this);thread.start();&&&&&&&&当受到一个消息时,根据消息的类型,作出不同的动作。最后调用paint()方法来刷新主画布从而改变场景。调用paint()方法时,首先把所要玩家都移除,然后重新画整个场景:&&&&removeAllPlayer()for(Enumeratione=htPlayer.elements();e.hasMoreElements();){Messagemsg=(Message)e.nextElement();showPlayer(msg);}&&&&&&&&其中的showPlayer()方发中是根据玩家不同的编号(number)和小组(team)来把玩家的图片画到画布的不同位置。并判断该玩家现在的准备情况,如果准备好了就显示准备状态。游戏大厅中主要实现了小组的选择,聊天功能,准备和取消准备等功能。?小组的选择:游戏中的小组分为“蓝队”和“红队”它们的选择图标都是一个,ImageButton。当有鼠标点击它们的动作时,将触发一个鼠标点击事件,这时鼠标监听器将捕捉到该动作。然后创建一个新的消息,把玩家的一些信息赋值给该消息,同时设置消息的类别为“更换小组”,最后发送消息.这里以选择蓝队为例:&&&&Messagetest=newMessage();test.team=GameKey.TEAM_BLUE;test.type=GameKey.MESSAGE_TYPE_CHANGE_TEAM;test.number=meMessage.test.UserName=meMessage.UserNUtil.printMessage(SelectTeam,test);&&&&&&&&当客户端收到Type为GameKey.MESSAGE_TYPE_CHANGE_TEAM(数值为5)的消息时,从保存的所有玩家的信息中得到状态改变的该玩家,并更换它的TEAM,之后还放到HashTable中。&&&&&&&&第12页共21页&&&&&&&& for(Enumeratione=htPlayer.elements();e.hasMoreElements();){Messagetest=(Message)e.nextElement();if(test.number==msg.number){test.team=msg.htPlayer.put(Integer.toString(test.number),test);}}&&&&&&&&最后要调用paint()方法来重新刷新该画布,改变场景,使该玩家的颜色显示和选择小组颜色一致。?聊天功能:原理和小组选择相似,首先玩家在文本框中输入要发送的消息内容,当点击“发送”的图片按钮时,触发一个鼠标动作。监视器拦截该动作,并得到输入文本框中的信息,把它封装到一个消息里面Message。最后发往服务器。服务器端只是把消息进行转发给所有玩家。玩家的客户端收到消息后,判断该消息的类型,如果是聊天消息,将聊天的内容提取,然后显示在聊天信息板里面。?准备/取消准备功能:点击准备图片按钮,触发一个事件,然后封装生成一个消息发送到服务器,服务器转发。客户端收到消息后把该玩家的状态改为“准备”。之后判断是否所有玩家都已经准备好,如果都准备好,把全局变量Ready的数值设置为“OK”,然后在主线程里判断这个值从而得到是否所有玩家都已经准备好。都准备好的话就创建一个新的窗口进入对战区。5.4.5对战场地模块&&&&&&&&主要类:QQPad.java描述:这个类为游戏大厅的画布,同时处理对战时的主要逻辑,是整个游戏的核心。负责处理了玩家移动,泡泡的放置及引爆,障碍物的清除和胜负判断等多个功能。当玩家进入大厅时,程序首先要初始化场景,包括对地图和玩家位置的初始化,并为场景增加监听器监听玩家键盘和鼠标的动作,之后启动一个主线程。该线程负责处理玩家的鼠标和键盘动作,并对从服务器端接收到的消息进行处理,从而改变当前的场景。当有一个小组的全部玩家都被消灭后,就判断胜负并显示结果,这次对战就结束,返回到游戏大厅。整体流程如图10所示。&&&&&&&&第13页共21页&&&&&&&& 图10对战处理流程&&&&&&&&以下将对几个主要的流程作详细的介绍。?地图的生成地图是每个游戏必需的一个元素,地图主要是生成游戏的场景,然后在画布上显示该场景。在开发很多类型的游戏中,地图系统都需要良好的设计,直观的说,我们需要的地图系统仅仅是一个2D数组,然后用最快的方式将数组影射到屏幕上。地图的设计方式有很多,大多数2D游戏是通过开发的地图编辑器来实现的。而该游戏的设计是首先定义一个地图文件,这个地图文件是用一些0,1等数字表示一种物体。然后在用流对该文件进行读取,把内容读取到一个数组里面。不同的数字就会在场景中显示出不同的物体。程序中首先在map文件夹下定义好一个“map1.txt”文件,该文件是由0,1,2三种数字组成:100&&&&&&&&第14页共21页&&&&&&&& 其中,0在场景中显示的是一个空地,1显示的是一个箱子,2显示为一个植物。之后通过流将数据读取到一个数组里面:&&&&while(true){Stringline=reader.readLine();if(line==null){reader.close();}//过滤掉#开头的行if(!line.startsWith(#)){line=line.trim();lines.add(line);width=Math.max(width,line.length());}}height=lines.size();//对数组赋值for(inti=0;i++){Stringline=(String)lines.get(i);for(intj=0;jline.length();j++){intc=(int)line.charAt(j);c=c-48;map[j][i]=c;}}//把ASC码转化成数字&&&&&&&&根据初始化好的数组,对数组中每一个元素的值,将显示不同的物体,从&&&&&&&&第15页共21页&&&&&&&& 而实现地图的初始化。上例中地图数组最终显示到画布中的场景如图11所示:&&&&&&&&图11对战场地&&&&&&&&?初始化场景:初始化场景主要是初始化场景中使用到的图片,玩家的位置,为场景中的相关组件增加监听器等。对于玩家的位置的初始化,这里先判断玩家的编号,每个编号对应一个不同的位置。而显示玩家时,是通过地图中的数据来显示的。每一个地图代码代表不同的玩家状态。地图中的一个格子是一个数据,拿map[m][n]=1322为例,这个数据“1322”它们组成为:小组编号+当前朝向+X轴方向的格子数+Y轴方向的格子数。其中小组和朝向的代码制定如下:玩家的小组:1-蓝队;2-红队朝向:1-朝北;2-朝东;3-朝南;4-朝西最后根据该数值,来最终决定该玩家的当前的状态,根据状态中的位置朝向等信息,在场景中显示相应的图片来创造当前状态下玩家的实体。?玩家移动对战过程处理流程的原理和大厅相似,不过很多是对键盘的监听。当按下键盘的方向键的时候,监听器将捕获该动作,然后将该动作的信息封装为一个消息,在服务器端再对消息进行转发给所有玩家。玩家收到消息,对消息进行解析,得用户的操作,然后改变玩家对应单元格的代码,之后刷新整个画布,玩家的位置将做出变化。其中在移动玩家的时候,要先判断前方是否有障碍物或者是否已经到达了边界,是的话将不能进行移动。?泡泡处理泡泡的显示也是用一个数组坐标来表示,不过这个是另外建了一个新的数组map2[][],它的大小和场景坐标一样,但是状态只有两种:放置的泡泡和爆炸中的泡泡。当玩家按下空格建,将会把玩家当前位置出放置一个泡泡,即把map2中的对应状态改为“8”。放置泡泡的时候,其实建立了一个泡泡的线程,为这个泡泡设置位置,然后就启动该线程,当停顿4妙后,将把这个泡泡给引爆。&&&&&&&&第16页共21页&&&&&&&& pad.setBomb(m,n);sleep(sleepTime);//sleepTime=4spad.Bombing(m,n,power);sleep(500);pad.cleanBomb();sleep(1000);pad.cleanPlayer();&&&&&&&&引爆时调用了Bombing方法。该方法主要是根据泡泡的威力,把在爆炸范围内的箱子或者玩家给清除。也就是改变坐标的代码。首先要显示一个爆炸时候的图片,之后清楚相关的物体。&&&&for(inti=m;i=m+i++){if(i=15){}if(map[i][n]==2){}if(map[i][n]==0){map[i][n]=88;}if(map[i][n]==1){map[i][n]=88;}……}//向右&&&&&&&&泡泡的爆炸场景显示持续半秒后,将把爆炸范围内的物体(植物除外)的值设置为0,这样在下次刷新场景时将清理被炸掉的物体。?结束判断:在每次泡泡爆炸后,都要进行一次判断,首先要判断是否有玩家被炸到,如果有就将该玩家的状态设置为’DEAD’,然后判断整个小组是否所有成员都已经dead掉,如果是,则认定该组失败,而对方获胜。游戏结束。&&&&if(myLive==0blue_team_alive==truered_team_alive==true){g.drawImage(deathImg,84,140,this);&&&&&&&&第17页共21页&&&&&&&& }if(myTeam==1){if(!blue_team_alive){g.drawImage(lossImg,84,140,this);}if(!red_team_alive){g.drawImage(winImg,84,140,this);}}if(myTeam==-1){if(!red_team_alive){g.drawImage(lossImg,84,140,this);}if(!blue_team_alive){g.drawImage(winImg,84,140,this);}}&&&&&&&&6测试&&&&因为完全开发一个完整的网络游戏需要巨大的时间和精力上的投入,该程序的主要目的是研究泡泡堂游戏的主体开发原理和流程。在开发过程中还有一些BUG要完善。测试过程中主要精力分析数据在传输过程中数据丢失和对战中玩家坐标的调整上。为了最大可能的增加系统的稳定性,曾大范围的改变了游戏的设计思想,争取做到最优。通过测试,整个游戏能够很好的完成整个操作流程。并可以实现多人登陆,在游戏大厅进行信息交换,和在对战场地进行对战等功能,达到了预期目标。&&&&&&&&第18页共21页&&&&&&&& 结&&&&&&&&论&&&&&&&&通过本次课题的研究,很好的把握开发网络游戏的整个流程及其设计思想,更加深入的理解JAVA语言的编程思想。开发改游戏综合灵活的运用了swing中主要组件,很好的设计并优化美观了游戏的界面,使其更加贴近玩家。作为一个可运行的网络游戏,游戏全部实现了登陆,游戏大厅,对战等必须的场景。并为玩家提供一个互动的聊天平台,这样极大的提高了游戏的趣味性,吸引玩家的兴趣。开发一个好的网络游戏是一项很复杂的工程,不仅仅是程序的实现,游戏剧本,美工,人物角色划分,任务分派等,都是影响一个游戏成败的关键因素。为了获得最大化的市场空间,增加吸引玩家兴趣的趣味性必不可少。作为本课题研究的对象,“泡泡堂”游戏在实际的开发中,可以在课题研究的理论基础上增加数据库管理,记录游戏中必要的信息,并增加速度和威力等因素,增强游戏的趣味性,使游戏真正产生实际的使用价值。&&&&&&&&参考文献&&&&[1]耿祥义,张跃平.java2使用教程[M].北京:清华大学出版社,2004[2]DavidBrackeen[美].Java游戏编程[M].邱仲潘译.北京:科学出版社,2004[3]KathyWalrath[美].JFCSwing标准教材[M].邓一凡译.北京:电子工业出版社,2005[4]BruceEckel[美].Java编程思想[M].陈昊鹏译.北京:机械工业出版社,2005[5]赤金,聂松.JavaApplet实例编程[M].北京:中国水利水电出版社,2003[6]彭波,孙一林.java多媒体技术[M].北京:清华大学出版社,2005[7]黄嘉辉.Java网络程序设计[M].北京:清华大学出版社,2002&&&&&&&&第19页共21页&&&&&&&& 致&&&&&&&&谢&&&&&&&&本论文的工作是2007年2月至2007年06月在成都信息工程学院网络工程系完成的。在整个系统设计和论文写作过程中得到了很多人的支持。在此感谢他们感谢我的导师甘刚老师,他渊博的知识和严谨的治学作风使我受益匪浅,对顺利完成本课题起到了极大的作用。在此向他表示我最衷心的感谢!感谢我的室友们,从遥远的家来到这个陌生的城市里,是你们和我共同维系着彼此之间兄弟般的感情,维系着寝室那份家的融洽。在论文完成过程中为我提供了很好的环境。感谢我的爸爸妈妈,养育之恩,无以回报,你们永远健康快乐是我最大的心愿。在论文完成过程中,本人还得到了其他老师和许多同学的热心帮助,本人向他们表示深深的谢意!最后向在百忙之中评审本文的各位专家、老师表示衷心的感谢!&&&&&&&&作者简介姓名:何震雨性别:男民族:汉出生年月:1985年02月E-mail:&&&&&&&&第20页共21页&&&&&&&& 声&&&&&&&&明&&&&&&&&本论文的工作是2007年2月至2007年6月在成都信息工程学院网络工程系完成的。文中除了特别加以标注地方外,不包含他人已经发表或撰写过的研究成果,也不包含为获得成都信息工程学院或其他教学机构的学位或证书而使用过的材料。除非另有说明,本文的工作是原始性工作。关于学位论文使用权和研究成果知识产权的说明:本人完全了解成都信息工程学院有关保管使用学位论文的规定,其中包括:(1)学校有权保管并向有关部门递交学位论文的原件与复印件。(2)学校可以采用影印、缩印或其他复制方式保存学位论文。(3)学校可以学术交流为目的复制、赠送和交换学位论文。(4)学校可允许学位论文被查阅或借阅。(5)学校可以公布学位论文的全部或部分内容(保密学位论文在解密后遵守此规定)。除非另有科研合同和其他法律文书的制约,本论文的科研成果属于成都信息工程学院。特此声明!&&&&&&&&作者签名:2
007年06月日&&&&&&&&第21页共21页&&&&&&&& Areyouhungrynow?&&&&&&&&No,IifIpursueyouIwillnotcatchyou,andifIcatchyou-throughyourownslownessandclumsiness-Iwillnotkillyou,andifIkillyouIwillnoteatyou.&&&&&&&&Nicholashadbeguntobackaway,words,realizingthattheywereasignal,heturnedand&&&&&&&&begantorun,splashingthroughtheshallowwater.Ignacioranafterhim,muchhelpedbyhislongerlegs,hishairflyingbehindhisdarkyoungface,hissquareteeth-eachwhiteasaboneandasbigasNicholassthumbnail-showinglikespectatorswholinedtherailingsofhislips.&&&&&&&&Dontrun,Nicholas,Dr.Islandsaidwiththevoiceofawave.Itonlymakeshimangrythatyourun.Nicholasdidnotanswer,butcuttohisleft,upthebeachandamongthetrunksofthepalms,sprintingallthewaybecausehehadnowayofknowingIgnaciowasnotrightbehindhim,abouttograbhimbytheneck.Whenhestoppeditwasinthethickjungle,amongthebolesofthehardwoods,whereheleaned,.;outofbreath,thethumpingofhisownhearttheonly&&&&&&&&.&&&&&&&&soundinanatmospheresilentandunwakedasEarthslong,prehumanday.ForatimehelistenedforanysoundIgnaciomightherewasnone.Hedrewadeepbreaththenandsaid,Well,thatsover,expectingDr.Islandttherewasonlythegreenhush.&&&&&&&&Thelightwasstillbrightandstrongandnearly,shadowless,butsomeinteriorsensetoldhimtheday,wasnearlyover,andhenoticedthatsuchfaintshadesashecouldseestretchedlong,horizontaldistortionsoftheirobjects.Hefeltnohunger,buthehadfastedbe-foreandknewonwhichewasnotasstrongashehadbeenonlyadaypast,andbythistimenextdayhewouldprobablybeunabletooutrunIgnacio.Heshould,henowrealized,haveeatenbuthisstomachrevoltedatthethoughtoftherawflesh,andhedidnotknowhowhemightbuildafire,althoughIgnacioseemedtohavedonesothenightbefore.Rawfish,evenifhewereabletocatchafish,wouldbeasbad,orworse,herememberedhisefforttoopenacoconut-hehadfailed,butitwassurelynotimpossible.Hismindwashazyastowhatacoconutmightcontain,buttherehadtobeanediblecore,becausetheywereeateninbooks.HedecidedtomakeawidesweepthroughthejunglethatwouldbringhimbacktothebeachwellawayfromIhehadseveraltimesseencoconutslyinginthesandunderthetrees.&&&&&&&&Hemovedquietly,stillalittleafraid,tryingtothinkofwaystoopenthecoconutwhenhefoundit.Heimaginedhimselfstandingbeforealargeandraggedlyfacetedstone,holdingthecoconutinbothhands.Heraiseditandsmasheditdown,butwhenitstruckitwasnolongeracoconutbutMheheardhernosecartilagebreakwithadistinct,rubberysnap.Hereyes,asblueastheskyaboveMadhyaPradesh,thesparklingblueskyoftheegg,lookedupathim,buthecouldnolongerlookintothem,theyretreatedfromhisown,anditcametohimquitesuddenlythatLucifer,infalling,musthavefallenup,intothefiresandthecoldnessofspace,neveragaintoseethewarmbluesandbrownsandgreensofEarth:1waswatchingSatanfallaslightningfromheaven.Hehadheardthatontapesomewhere,buthecouldnotrememberwhere.HehadreadthatonEarthlightningdidnotcomedownfromtheclouds,butleapedupfromtheplanetarysurfacetowardthem,nevertoreturn.&&&&&&&&Nicholas.&&&&&&&&Helistened,butdidnothearhisnameagain.FaihadDr.Islandusedthatsoundtospeaktohim?Hewalkedtowarditandfoundalittlerillthatthreadedawayamongthetrees,andfollowed&&&&&&&&it.Inahundredstepsitgrewbroader,slowed,andendedinalongblindpoolunderadomeofleaves..Dianewassittingonmossshelookedupasshesawhim,andsmiled.&&&&&&&&Hello,hesaid.&&&&&&&&Hello,Nicholas.IthoughtIheardyou.Iwasntmistakenafterall,wasI?&&&&&&&&IdidntthinkIsaidanything.Hetestedthedarkwaterwithhisfootandfoundthatitwasverycold.&&&&&&&&第22页共21页&&&&&&&& Yougavealittlegasp,Ifancy.Iheardit,andIsaidtomyself,thatsNicholas,andIcalledyou.ThenIthoughtImightbewrong,orthatitmightbeIgnacio.&&&&&&&&Ignaciowaschasingme.Maybehestillis,buththinkhesprobablygivenupbynow.&&&&&&&&Thegirlnodded,lookingintothedarkwatersoftheypool,butdidnotseemtohaveheardhim.Hebegantoworkhiswayaroundtoher,climbingacrossthesnakelikerootsofthecrowdingtrees.WhydoesIgnaciowanttokillme,Diane?&&&&&&&&Sometimeshewantstokillme,too,thegirlsaid.&&&&&&&&Butwhy?&&&&&&&&Ithinkhesabitfrightenedofus.Haveyouevertalkedtohim,Nicholas?&&&&&&&&TodayIdidalittle.Hetoldmeastoryaboutapetfishheusedtohave.&&&&&&&&Ididhetellyouthat?On=Earth.OnaplantationinBrazil,wayuptheAmazon--Dr.Islandtoldme.&&&&&&&&IthoughtitwascrowdedonEarth.&&&&&&&&Thecitiesarecrowded,andthecountrysideclosestothecities.Butthereareplaceswhereitsemptiethanitusedtobe.WhereIgnaciowas,therewouldhavebeenRedIndianhunterstwoorthreehundred&&&&&&&&whenhewasthere,therewasntanyone,`justthemachines.Nowhedoesntwanttobelookedat,doesntwantanyonearoundhim.&&&&&&&&Nicholassaidslowly,Dr.Islandsaidlotsofpeoplewouldntbesickifonlytherewerentotherpeoplearoundallthetime.Rememberthat?aOnlythere.areotherpethatshowtheworldis.NotinBrazil,maybe,Nicholassaid.HewastryingtoremembersomethingaboutBrazil,buttheonlythinghecouldthinkofwasaparrotsinginginastrawhatfrandthenaturtleandahedgehogthatturnedintoarmadillosfortheloveofGod,Montressor.Hesaid,Whydidnthestaythere?DidItellyouaboutthebird,Nicholas?Shehadbeennotlisteningagain.Whatbird?Ihaveabird.Inside.Shepattedtheflatstomachbelowhersmallbreasts,andforamoment,Nicholasthoughtshehadreallyfoundfood.Shesitsinhere.Shehastangledanestinmyentrails,whereshesitsandtearsatmybreathwithherbeak.Ilookhealthytoyou,dontI?ButinsideImhollowandrottenandturningbrown,dirtandoldfeathers,oozingaway.Herbeakwillbreakthroughsoon.Okay.Nicholasturnedtogo.Ivebeendrinkingwaterhere,tryingtodrownher.IthinkIveswallowedsomuchIcouldntstandupnowifItried,butsheisntevenwet,anddoyouknowsomething,Nicholas?IvefoundoutImnotreallyme,Imher.TurningbackNicholasasked,Whenwasthelasttimeyouhadanythingtoeat?Idontknow.Two,threedaysago.Ignaciogavemesomething.Imgoingtotrytoopenacoconut.IfIcanIllbringyoubacksome.&&&&&&&&Whenhereachedthebeach,Nicholasturnedandwalkedslowlybackinthedirectionofthedeadfire,thistimealongtherimofdampenedsandbetweentheseaandthepalms.Hewasthinkingaboutmachines.Therewerehundredsofthousands,perhapsmillions,ofmachinesoutbeyondthebelt,butfewornone&&&&&&&&ofthesophisticatedservantrobotsofEarth-thosewereluxuries.WouldIgnacio,inBrazil(whateverthatwaslike),havehadsuchluxuries?Nthoserobotswerealmostlikepeople,andlivingwiththemwouldbelikelivingwithpeople.NicholaswishedthathecouldspeakBrazilian.TherehadbeenthetherapyrobotsatSt.JNicholashadnotlikedthem,andhedidnotthinkIgnaciowouldhavelikedthemeither.Ifhehadlikedhistherapyrobotheprobablywouldnothave&&&&&&&&第23页共21页&&&&&&&& hadtobesenthere.Hethoughtofthechippedandrustedoldmachinethathadcleanedthecorridors-MayahadcalleditCorradora,butnooneelseevercalleditany-FthingbutHey!Itcouldnot(oratleastdidnot)speak,1andNicholasdoubtedthatithademotions,exceptpossiblyasortofloveofcleannessthatdidnotextendtoitsownperson.Youwillunderstand,someonewassayinginsidehishead,thatmotivesofallsortscanbedividedintotwosorts.Adoctor?Atherapyrobot?Itdidnotmatter.Extrinsicandintrinsic.Anextrinsicmotivehasalwayssomefurtherendinview,andthatendwecallanintrinsicmotive.Thuswhenwehavereducedmotivationtointrinsicmotivationwehavereducedittoitssimplestparts.Takethatmachineoverthere.Whatmachine?Freudwouldhavesaidthatitwasfixatedatthelatteranalstage,perhapsduetothecareitsbuildersexercisedinseeingthatthedirtitcollectsisnotreleasedagain.Becauseofitsfixationitis,asyousee,obsessedwitcompulsivesweepingandscrubbingpalliateitsanxieties.ItisastrengthofFreudstheory,andnotaweakness,thatitserves`toexplainmanyoftheactivitiesofmachinesaswellastheactsofpersons.Hellothere,Corradora.Andhello,Ignacio.Myhead,movingfromsidetoside,mustremindyouofaradarscanner.Mystepsaremeasured,slow,andprecise.1emitascarcelyaudiblehummingas1walk,andmyeyesarefixed,as1swingmyhead,notonyou,Ignacio,butonthewavesattheedgeofsight,wheretheycurveupintothesky.1stoptenmetersshortofyou,and1stand.&&&&&&&&Yougo1follow,tenmetersbehind.Whatdo1want?Nothing.&&&&&&&&Yes,1willpickupthesticks,and1willfollow-fivemetersbehind.&&&&&&&&Breakthem,andputthemonthefire.Notallofthem,justafew.&&&&&&&&Yes.&&&&&&&&Ignaciokeepsthefirehereburningallthetime.Sometimeshetakesthecoalsoffirefromittostartothers,buthere,underthebigpalmlog,hehasafirealways.Theraindoesnotstrikeithere.Alwaysthefire.Doyouknowhowhemadeitthefirsttime?Replytohim!&&&&&&&&&&&&&&&&&&&&&&&&No.&&&&&&&&No,Patrdo!&&&&&&&&`No,Patrao.&&&&&&&&Ignaciostoleitfromthegods,fromPoseidon.NowPoseidonisdead,lyingatthebottomofthewater.Whichisthetop.Wouldyouliketoseehim?&&&&&&&&Ifyouwishit,Patrdo.&&&&&&&&Itwillsoonbedark,andoyouhaveaspear?&&&&&&&&No,Patrdo.&&&&&&&&ThenIgnaciowillgetyouone.&&&&&&&&Ignaciotookahandfulofthesticksandthrusttheendsintothefire,blowingonthem.AfteramomentNicholasleanedoverandblew,too,untilallthestickswereblazing.&&&&&&&&第24页共21页&&&&&&&& Nowwemustfindyousomebamboo,andthereissomebackhere.Followme.&&&&&&&&Thelight,stillnearlyshadowless,wasdimmingnow,sothatitseemedtoNicholasthattheywalkedoninsubstantialsoil,thoughhecouldfeelitbeneathhisfeet.Ignaciostalkedahead,holdinguptheburningsticks&&&&&&&&untilthefireseemedabouttodie,thenpointingtheendsdown,allowingittolickupwardtowardhishandandcometolifeagain.Therewasagentlewindblowingouttowardthesea,carryingawaythesoundofthesurfandbandwhentheyhadbeenwalkingforseveralminutes,Nicholasheardinitafaint,dry,almostrhythmicrattle.&&&&&&&&Ignaciolookedbackathimandsaid,Themusic.Thearit?&&&&&&&&TheyfoundacanealittlethinnerthanNicholasswristandpiledtheburningsticksarounditsbase,thenaddedmore.Whenitfell,Ignacioburnedthroughtheupperend,too,makingapoleaboutaslongasNicholaswastall,andwiththeedgeofaseashellscrapedthelargerendtoapoint.Nowyouareafisherman,hesaid.Nicholassaid,Yes,Pardo,stillcarefulnottomeethiseyes.&&&&&&&&Youarehungry?&&&&&&&&Yes,Patrdo.&&&&&&&&Thenletmetellyousomething.WhateveryougetisIgnacios,youunderstand?Andwhathecatches,thatishis,too.eonnow,andIgnaciowillteachyoutofishordrownyou.&&&&&&&&IgnaciosownspearwasburiedinthesitwasmuchbiggerthantheonehehadmadeforNicholas.Withitheldacrosshischesthewentdowntothewater,wadinguntilitwaswaisthigh,thenswimming,notlookingtoseeifNicholaswasfollowing.Nicholasfoundthathecouldswimwiththespearbyputtingallhiseffortintothemotionofhislegs,holdingthespearinhislefthandandstrokingonlyoccasionallywithhisright.Youbreathe,hesaidsoftly,andwatchthespear,aridafterthathehadonlytoallowhisheadtoliftfromtimetotime.&&&&&&&&HehadthoughtIgnaciowouldbegintolookforfishassoonastheywerewelloutfromthebeach,buttheBraziliancontinuedtoswim,slowlybutsteadily,untilitseemedtoNicholasthattheymustbeakilometerormorefromland.Suddenly,asthoughthelightsinaroomhadrespondedtoaswitch,thedarkseaaroundthembecameanopalescentblue.Ignaciostopped,treadingwaterandusinghisspeartobuoyhimself.Here,hesaidGetthembetweenyourselfandthelight.Open-eyed,hebenthisfacetothewater,raiseditagaintobreathedeeply,anddove.Nicholasfollowedhisexample,floatingbelly-downwithopeneyes.Alltheworldofdancingglitteranddarkislandvanishedasthoughhehadplungedhisfaceintoadream.Far,farbelowhimJupiterdisplayeditsbroad,stripeddisk,marredwiththespreadingBrightSpotwhereman-madesiliconeenzymeshadstrippedthehydrogenfrommethaneforkindledfusion:acancerandaburninginfantsun.Betweenthatsunandhiseyeslayinvisibleahundredthousandkilometersofspace,andthetemperglashundredsofmetersofilluminatedwater,andinitthespreadbodyofIgnacio,darkagainstthelight,stillkickingdownward,hisspearapencillineofblacknessinhishand.InvoluntarilyNicholassheadcameup,returningtotheuniverseofsparklingwaves,awarenowthatwhathehadcallednightwasonlytheshadowcastbyDr.IslandwhenJupiterandtheBrightSpotslidbeneathher.Thatshadowline,indetectableinair,nowlaysharpacrossthewaterbehindhim.Hetookbreathandplunged.Almostatonceafishdartedsomewherebelow,andhisleftarmthrustthespearforward,butitwasfaroutofreach.Heswamafterit,thensawanother,larger,fishfartherdownanddoveforthat,passingIgnaciosurfacingforair.Thefishwastoodeep,andhislungsachingforair,heswamup,wantingtoletgoofhisspear,thenrealizingatthelastmomentthathecould,thatitwouldonlybobtothesurfaceifhereleasedit.Hisheadbrokewaterandhegasped,waterstruck&&&&&&&&hisfaceandheknewagain,suddenly,asthoughtheyhadceasedtoexistwhilehewasgone,thepulsebeatpoundingofthewaves.Ignaciowaswaitingforhim.Heshouted,ThistimeyouwillcomewithIgnacio,andhewillshowyouthedeadseagod.Thenwewillfish.Unabletospeak,Nicholasnodded.HewasallthenIgnaciodoveandNicholashadtofollow,kickingdownuntilthepressuresanginhisears.Thenthroughbluewaterhesaw,loomingattheedgeofthelight,ahugemassofmetalanchoredtothetemperglasshullaboveit,hanginglifelesslylikethestemofagreatvineseveredfromtheroot,acabletwiandonthebottom,sprawledbesidethemightyanchor,aleggedgodthatmighthavebeenadeadinsectsavethatitwasatleastsixmeterslong.Ignacioturnedandlookedbackat&&&&&&&&第25页共21页&&&&&&&& Nicholahedidnot,buthenodded,andwiththestrengthdrainingfromhisarms,surfacedagain.AfterIgnaciobroughtupthefirstfish,theytookturnsonthesurfaceguardingtheircatch,andwhiletheBrightSpotcreptbeneaththeshelvingrimofDr.Island,theyspearedtwomore,oneofthemquitelarge.ThenwhenNicholaswassoexhaustedhecouldscarcelylifthisarms,theymadetheirwaybacktoshore,andIgnacioshowedhimhowtogutthefishwithathornandtheedgeofashell,andreclosethemandpacktheminmudandleavestoberoastedbythefire.AfterIgnaciohadbeguntoeatthelargestfish,Nicholastimidlydrewoutthesmallest,andateforthefirsttimesincecomingtoDr.Island.OnlywhenhehadfinisheddidherememberDiane.Hedidnotdaretotakethelastfishtoher,buthelookedcovertlyatIgnacio,andbeganedgingawayfromthefire.TheBrazilianseemednottohavenoticedhim.Whenhewaswellintotheshadowshestood,backedafewsteps,then-slowly,ashisinstinctswarnedhim-walkedaway,notbeginningtotrotuntilthedistancebetweenthemwasnearlyahundredmeters.&&&&&&&&HefoundDianesittingapatheticandsilentatthemarginofthecoldpool,andhadsomedifficultypersuadinghertostand.Atlastheliftedher,hishandsunderherarmspressingagainstherthinribs.Onceonherfeetshestoodsteadilyenough,andfollowedhimwhenhetookherbythehand.Hetalkedtoher,knowingthatalthoughshegavenosignofhearingsheheardhim,andthattherightwordsmightwakehertoresponse.Wewentfishing-Ignacioshowedmehow.Andhesgotafire,Diane,hegotitfromakindofrobotthatwassupposedtobefixingoneofthecablesthatholdsDr.Island,Idontknowhow.Anyway,listen,wecaughtthreebigfish,andIateoneandIgnacioateagreatbigone,andIdontthinkhedmindifyouhadtheotherone,onlysay,`Yes,Patrdo,and`No,Patrdo,tohim-helikesthat,andhesonlyusedtomachines.Youdonthavetosmileathimoranything-justlookatthefire,thatswhatIdo,justlookatthefire.&&&&&&&&ToIgnacio,perhapswisely,heatfirstsaidnothingatall,leadingDianetotheplacewherehehadbeensittinghimselfafewminutesbeforeandplacingsomescrapsfromhisfishinherlap.Whenshedidnoteathefoundasliverofthetender,roastedfleshandthrustitintohermouth.Ignaciosaid,Ignaciobelievedthatonedead,andNicholasanswered,No,Patrdo.&&&&&&&&Thereisanotherfish.Giveittoher.&&&&&&&&Nicholasdid,rakingthegobofbakedmudfromthecoalstocrackwiththeheelofhishand,andpeelingthebrokenandsteamingfilletsfromtheskinandbonestogivetoherwhentheyafterthefishhadlaininhermouthforperhapshalfaminuteshebegantochewandswallow,andafterthethirdmouthfulshefedherself,thoughwithoutlookingateitherofthem.&&&&&&&&:Ignaciobelievedthatonedead,Ignaciosaidagain.&&&&&&&&No,Patrao,Nicholasanswered,andthenadded,Likeyoucansee,shesalive.&&&&&&&&Sheisaprettycreature,withthefirelightonherface-no?&&&&&&&&Yes,Patrao,verypretty.&&&&&&&&Buttoothin.Ignaciomovedaroundthefireuntil`hewassittingalmostbesideDiane,thenreachedforthefishNicholashadgivenher.Herhandsclosedonit,thoughshestilldidnotlookathim.&&&&&&&&Yousee,sheknowsusafterall,Ignaciosaid.Wesarenotghosts.&&&&&&&&Nicholaswhisperedurgently,Lethimhaveit.&&&&&&&&SlowlyDianesfingersrelaxed,butIgnaciodidnotatakethefish.Iwasonlyjoking,littleone,hesaid.4AndIthinknotsuchagoodjokeafterall.Thenwhenshedidnotreply,heturnedawayfromher,hiseyesreachingoutacrossthedark,tossingwaterforsomethingNicholascouldnotsee.&&&&&&&&Shelikesyou,Patrao,Nicholassaid.Thewordswerelikeswallowingfilth,buthethoughtofthebirdreadytotearthroughDianesskin,andMayasbloodsoakinginlittlerounddotsintothewhitecloth,andcontinued.Sheisonlyshy.Itisbetterthatway.&&&&&&&&You.Whatdoyouknow?Herheadmovedafractionofacentimeter.&&&&&&&&第26页共21页&&&&&&&& Oncehewasoutofsightofthefire,onepartofthebeachwasasgohewishedhehadtakenapieceofwoodfromthefiretostartoneofhisownandtriedtocoverhislegswithsandtokeepoffthecoolwind,butthesandfellawaywheneverhemoved,andhislegsandhislefthandmovedwithoutvolitiononhispart.Thesurf,lappingattherippledshore,said,Thatwaswelldone,Nicholas.Icanfeelyoumove,Nicholassaid.IdontthinkIevercouldbeforeexceptwhenIwashighup.Imyrollislessthanoneone-hundredthofadegree.Yes,Ican.Youwantedmetodothat,didnt-you?AboutIgnacio.DoyouknowwhattheHarloweffectis,Nicholas?Nicholasshookhishead.AboutahundredyearsagoDr.Harlowexperimentedwithmonkeyswhohadbeenraisedincompleteisolation-nomothers,noothermonkeysatall.Luckymonkeys.Whenthemonkeyswerematureheputtheminttheyfoughtwithanythatcamenearthem,andsometimestheykilledthem.Psychologistsaldidheeverthinkofturningthemlooseinthejungleinstead?No,Nicholas,thoughwehave...Arentyougoingtosayanything?Iguessnot.Dr.Harlowtried,yousee,togettheisolatemonkeystobreed-sexistheprimarysocialfunction-buttheywouldnt.Wheneveranothermonkeyofeithersexapproachedtheydisplayedaggressiveness,whichtheothermonkeysreturned.Hecuredthemfinallybyintroducingimmaturemonkeys-monkeychildren-inplaceofthemature,socializedones.Theseneededtheisolateadultssobadlythattheykeptonmakingapproachesnomatterhowoftenorhowviolentlythey&&&&&&&&wererejected,andintheendtheywereaccepted,andtheisolatessocialized.ItsinterestingtonotethatthefounderofChristianityseemstohavehadanintuitivegraspoftheprinciple-butitwasalmosttwothousandyearsbeforeitwasdemonstratedscientifically.Idontthinkitworkedhere,Nicholassaid.Itwasmorecomplicatedthanthat.Humanbeingsarecomplicatedmonkeys,Nicholas.ThatsaboutthefirsttimeIeverheardyoumakeajoke.Youlikenotbeinghuman,dontyou?Ofcourse.Wouldntyou?IalwaysthoughtIwould,butnowImnotsure.Yousaidthattohelpme,didntyou?Idontlikethat.AwavehigherthantheotherssplashedchillfoamoverNicholasslegs,andforamomenthewonderedifthiswereDr.Islandsreply.Halfaminutelateranotherwavewethim,andanother,andhemovedfartherupthebeachtoavoidthem.Thewindwasstronger,buthesleptdespiteit,andwasawakenedonlyforamomentbyaflashoflightfromthedirectionfrom,hetriedtoguesswhatmighthavecausedit,thoughtofDianeandIgnaciothrowingtheburningsticksintotheairtoseethearcsoffire,smiled-toosleepynowtobeangry-andsleptagain.MornNicholasranupanddownthebeach,rubbinghimselfwithhishands.Athinrain,orspume(itwashardtotellwhich),wasblowinginthewind,cloudingthelighttograyradiance.HewonderedifDianeandIgnaciowouldmindifhecamebacknowanddecidedtowait,thenthoughtoffishingsothathewouldhavesomethingtobring`buttheseawasverycoldandthewavessohightheytumbledhim,wrenchinghisbamboospearfromhishand.Ignaciofoundhimdrippingwithwater,sittingwithhisbacktoapalmtrunkandstaringouttowardtheliftingcurveofthesea.Hello,you,Ignaciosaid.Goodmorning,Patrdo.Ignaciosatdown.Whatisyourname?Youtoldme,Ithink,whenwefirstmet,butIhaveforgotten.Iamsorry.&&&&&&&&Nicholas:&&&&&&&&Yes.&&&&&&&&Patrao,Iamverycold.Woulditbepossibleforustogotoyourfire?&&&&&&&&MynameisIcallmethat.&&&&&&&&Nicholasnodded,frightened.&&&&&&&&第27页共21页&&&&&&&& Butwecannotgotomyfire,becausethefireisout.&&&&&&&&Cantyoumakeanotherone,Patrao?&&&&&&&&Youdonottrustme,doyou?Idonotblameyou.No,Icannotmakeanother-youmayusewhatIhad,ifyouwish,andmakeoneafterIhavegone.Icameonlytosaygood-bye.&&&&&&&&Youreleaving?notherfire,butIdontevenknowwhatitis.&&&&&&&&Dr.Islanddidnotanswer.Nicholasgotupandbegantowalkbacktowherethefirehadbeen,thinkingaboutDianeandwonhewashungryhimself.&&&&&&&&Hefoundherbesidethedeadfire.Herchesthadbeenburnedaway,andlyingcloseby,neartheholeinthesandwhereIgnaciomusthavekeptithidden,wasabulkynuclearwelder.ThepowerpackwastooheavyforNicholastolift,buthepickeduptheweldinggunonitsshortcordandtouchedthetrigger,producingatwo-meterplasmadischarge,whichheplayedalongthesanduntilDianesbodywasash.Bythetimehehadfinishedthewindwaswhippingthepalmsandsendingstingingrainintohiseyes,buthecollectedasupplyofwoodandbuiltanotherfire,biggerandbiggeruntilitroaredlikeaforgeinthewind.Hekilledher!heshoutedtothewaves.&&&&&&&&YES.Dr.Islandsvoicewasbigandwild.&&&&&&&&Yousaidhewasbetter.&&&&&&&&HEIs,howledthewind.YOUKILLEDTHEMONKEYTHATWANTEDTOPLAYWITHYOU,NICHOLAS-ASIBELIEVEDIGNACIOWOULDEVENTUALLYKILLYOU,WHOARESOEASILYHATED,SODIFFERENTFROMWHATITISTHOUGHTABOYSHOULDBE.BUTKILLINGTHEMONKEYHELPEDYOU,REMEMBERMADEYOUBETTER.IGNACIOWASFRIGHTENEDBYWOMEN;NOWHEKNOWSTHATTHEYAREREALLYVERYWEAK,ANDHEHASACTEDUPONCERTAINFANTASIESANDFINDSTHEMBITTER.&&&&&&&&Yourerocking,Nicholassaid.AmIdoingthat?&&&&&&&&YOURTHOUGHT.&&&&&&&&第28页共21页&&&&&&&&
分享给好友:
All Rights Reserved 图宝贝
本站声明:本站所转载之内容,无任何商业意图,如本网站转载稿件涉及版权、著作权等问题,请您来函与本站管理员取得联系,友情链接请加QQ,要求PR 或者 BR >=2(联系方式:QQ )}

我要回帖

更多关于 44drdrcom 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信