我的毕设——基于Node.js的社区游戏系统的设计与实现

这是我的毕业设计,是一个网页游戏,游戏地址是:http://sandy.cnodejs.net/

这里是我的论文下载路径:

https://files.cnblogs.com/sandywong/%E9%BB%84%E8%81%AA%E6%AF%95%E4%B8%9A%E8%AE%BA%E6%96%87.pdf

游戏代码: https://github.com/sandywong/comic_match

git: git://github.com/sandywong/comic_match.git

游戏首页

游戏大厅

游戏进行时

下面是论文摘要(末尾有论文的下载链接):

摘  要 

Node.js是新兴的JavaScript虚拟机,基于V8引擎实现的事件驱动IO,性能很好,受众热捧。Node.js有很多鲜明的特性,包括使用JavaScript语言、异步IO非阻塞、单线程、事件驱动等。随着NoSQL的兴起,MongoDB也是备受关注。它是功能很丰富,是一个广受好评的最像关系数据库的非关系数据库。本项目是一个基于MongoDB和Node.js的社区在线游戏,是个类似名叫Bonbons桌游的多人在线游戏,让用户选择中央牌池的牌和手牌,图案相同即配对成功,第一个完成所有配对的用户胜利。本项目包括用户管理、游戏大厅、游戏房间三大功能模块。用户管理模块是本项目最基础的一个模块,几乎每一个页面,每一个步骤,都会调用这个模块的接口,这个模块包括用户登录退出和用户信息存储两个小模块。游戏大厅模块是一个相对简单的模块,主要起着衔接的作用,也就是把用户从介绍首页引导到游戏房间的过渡模块,它包括消息同步和引导进入房间两个部分。游戏房间模块是整个游戏最重要的部分,是本项目的灵魂所在,它包含了整个游戏过程的逻辑与实现。该模块同样包含消息同步的部分,还包含会话控制部分以及游戏逻辑部分(各种消息或事件的处理和响应)。

 

关键词:Node.js;MongoDB;游戏

 

Abstract

 

    The Node.js powerful new event-driven asynchronous IO JavaScript virtual machine, based on the V8 engine, achieving high performance is focused by a lot of people. Node.js have many distinctive features, including the use of JavaScript language, asynchronous non-blocking IO, single-threaded, event-driven, etc. With the development of the NoSQL, MongoDB also gets many attentions. It is multi-functional and a non-relational database that most like a relational database. It is a very powerful database. This project is a multiplayer online game based on MongoDB and Node.js, similar with a game called Bonbons. Users choose a card from the central pool and a card in his/her pocket to match the picture on the back of the two cards. The first one to complete to match all the cards in the pocket wins. The functional modules in this project include user management, game hall and games room. The user management module is the most basic module of the project. Its interfaces are used in almost every page and every step. This module includes user login, logout and information storage. The game hall module is a relatively simple module and plays the role of a bridge between the index and game rooms. It guides users to game rooms. It has two main parts includes the message synchronization and guide into the room. The game room module is the most important part of the entire game and is the soul of this project. It holds all the logic and the realization of the game. It also contains the message synchronization part, also includes a session control part and the game logic part (handling and reaction of all kinds of messages or event).

 

Keyword: Node.js, MongoDB, game

 

 

目  录

 

摘  ... I

Abstract II

第一章     ... 1

1.1     Node.js简介... 1

1.1.1    Node.js的介绍... 1

1.1.2    Node.js的发展情况... 1

1.2     MongoDB简介... 1

1.2.1    NoSQL的兴起... 1

1.2.2    MongoDB介绍... 2

1.3     本章总结... 2

第二章     项目关键技术介绍... 3

2.1     Node.js. 3

2.1.1    Node.js高并发的性能... 3

2.1.2    Node.js的语言特性... 6

2.1.3    Node.js的异步IO非阻塞特性... 7

2.1.4    Node.js的单线程特性... 8

2.1.5    Node.js的事件驱动特性... 8

2.1.6    Express框架... 9

2.1.7    Node App Engine提供支持... 9

2.2     MongoDB. 11

2.2.1    MongoDB特点... 11

2.2.2    MongoDB储存格式... 11

2.2.3    MongoDB对数据库设计的影响... 12

2.2.4    MongoDB与Node.js的组合... 12

2.2.5    MongoSkin的便利... 13

2.3     本章总结... 13

第三章     项目的需求分析... 14

3.1     游戏总体介绍... 14

3.1.1    游戏简介... 14

3.1.2    游戏规则... 14

3.2     游戏流程介绍... 14

3.3     游戏需求细化... 15

3.3.1    游戏页面... 15

3.3.2    游戏首页... 15

3.3.3    游戏大厅... 15

3.3.4    游戏房间... 15

3.3.5    游戏需求汇总... 16

3.4     本章总结... 16

 

第四章     项目的设计与实现... 17

4.1     项目目录组织... 17

4.2     项目功能模块... 17

4.2.1    项目功能模块介绍... 17

4.2.2    项目模块划分... 18

4.3     用户管理模块设计... 18

4.3.1    模块的总体设计... 18

4.3.2    新浪微博的接入... 19

4.3.3    用户信息的数据库设计... 19

4.4     游戏大厅模块设计... 21

4.4.1    模块的总体设计... 21

4.4.2    消息同步的设计... 21

4.4.3    进入房间的设计... 23

4.5     游戏房间模块设计... 24

4.5.1    模块的总体设计... 24

4.5.2    消息同步的设计... 24

4.5.3    会话部分的设计... 25

4.5.4    游戏逻辑部分的设计... 26

4.6     本章总结... 28

第五章     系统运行及改进探讨... 29

5.1     成果展示... 29

5.1.1    游戏完成情况概述... 29

5.1.2    游戏运行截图... 29

5.2     项目改进的方向... 30

5.2.1    系统架构设计的改进... 30

5.2.2    消息同步实现的改进... 31

5.2.3    游戏的扩展... 31

5.3     本章总结... 31

 

结束语... 32

参考文献... 33

... 34

 

 

 

posted @ 2012-07-31 00:46  free_swallow  阅读(2845)  评论(1编辑  收藏  举报