Catalog
abstract : . ............................................................................................................................................ 2 chapter 1 Introduction ............................................................................................................. - 3 -
1.1 Flash software description . ........................................................................................................ - 3 -
1.2 Flash point ................................................................................................................................. - 3 -
1.3 Flash game . ................................................................................................................................ - 4 -
1.4 Flash The direction of the game development ............................................................................... 4 chapter 2 The game design ....................................................................................................... 6
2.1 Game framework . ........................................................................................................................... 6
2.2 The game. ....................................................................................................................................... 6
2.3 Conversion between the scenarios ................................................................................................. 6 chapter 3 FlashThe realization of the function of the game . .......................................... 7
3.1 The main scene . .............................................................................................................................. 7
3.2 The first frame ................................................................................................................................ 8
3.3 The second frame ........................................................................................................................... 8
3.4 The third frame . .............................................................................................................................. 9 chapter 4 Summary . .................................................................................................................... 10
Abstract:
Flash game is a new form of the game, the game is simple, easy to operate, green, no
need to install the advantages of small size, file now gradually by the majority of users
love. Flash game called flash small game, because the game on flash is mainly applied
to some interesting, small game, to fully play its advantages based on vector map.
Flash game because of flash CS3 and ActionScript 3, rapid development in recent
years, many young people to join them, and play an important role in the whole flash
industry. Flash player accounted for 90% of all Internet users of the browser, so the
development of space is very large, with promising future.
Keywords: flash, game, vector
Chapter 1 Introduction
1.1 Flash Software description Flash was launched by Macromedia's interactive vector graphics and Web animation standards. Webpage designers use Flash to create beautiful and can change the size of the navigation interface and other strange effect. Flash is amemory chip, through specific program can modify the data. Flash is an authoring tool, designers and developers can use it to create presentations, applications and other content to allow user interaction. Flash can include simple animation, video content, complex presentations, applications, and anything in between.
Especially suitable for creating Flash content available through Internet, because its files are very small. Flash is through the extensive use of vector graphics do it.Compared with the bitmap graphics, vector graphics needs a lot of memory and storage space, because they are based on mathematical formulas instead of large data sets to represent. Bitmap graphics are bigger, because each pixel in the image needs a separate set of data to represent.
In Flash content creation, need to work in a Flash document file. Extended Flash document file name is.Fla.
The Flash document has four main parts:
1. The stage is display graphics, video, buttons and other content during playbackposition. Do the detailed introduction to the stage at the Flash foundation.
2. The time axis is used to tell the Flash to display graphics and other projects of the elements,
can also use the timeline specified stage hierarchical order of eachgraph. The higher layer is
located above the graphic is displayed in the lowerlayer graph.
The library panel is Flash to display a list of media elements in an Flash document location. ActionScript code can be used to add interactive content to media elements in the document.
For example, you can add code to the user to display a new image atthe click of a button,
you can also use ActionScript to add the logic to application.The logic enable the application
according to the user's operation and othercircumstances of different ways of working. Flash
includes two versions of the ActionScript, which can meet the different needs of creators. 3. 4.
1.2 The characteristics of Flash
1. Use vector graphics and streaming technology. And bitmap graphics, vector graphics can be
scaled arbitrarily without affecting the size of graphics; streaming technology makes animation
while playing while downloading, thereby alleviatingWebpage browsers anxiously waiting for
the mood.
2. Through the use of key frames and operator makes generated animation (.Swf)file is very
small, a few K bytes of animation files can realize many peopleHeartbeat animation effects,
used in Webpage design can not only makeWebpage more vivid, but little and dainty download
quickly, so that the animation can be played on the open Webpage short time.
3. The music, animation, sound effects, interactive way together, more and more people have
Flash as the preferred tool Webpage animation design, and can support MP3 music format,
which makes adding music animation files can maintain the cabinet 'figure'. 4. Strong animation editing functions that designers can design a high-qualityanimation, through the ACTION and FS COMMAND can achieve interactive, so that Flash has a greater degree of
design freedom, in addition, it is the most popular Webpage design tool Dreamweaver with a
tacit agreement, can be directly embedded in any position Webpage, very convenient.
1.3 Flash Game Flash game in the forms and traditional game, basically the same, but mainlyexist in the network, because of its small size, fast spread, screen appearance,so much to replace the traditional web net trends both at home and abroad, nowFlash online games for no reason has become a trend, as long as the browserinstalled ADOBE Flash player, you can play all the flash games, this is better than the traditional web net swims the progress of many information gathering,requirement analysis
For Flash games, compared to the same period capacity is the minimum, andoccupied a very short time, can play a relaxing entertainment, leisure physical and mental function, which has the advantages of small volume, good content,Nai Wan, entertaining, no age level, can modify the difficulty, good physical and mental health, the number of new features, gameplay rich.
1.4 The development direction of Flash games
Flash is known as "the most flexible front". Because of its unique and timesegment segmentation (TimeLine) and recombinant (nested MC) technology,combined with the ActionScitp object and process control. The design of interface design and animation in a flexible as possible, but has not yet formed a set ofinterface design theory in flash. At the same time it is also the most compactfront.
Flash has the characteristics of cross platform (this is like Java), so no matter what platform you are in, as long as you have the support of flash Player installation. You can ensure that they show the effect of the final agreement.Rather than as in previous Webpage design as IE and Mozilla or design a version of the NetSpace. As with the Java. Its portability strong. Especially in the small network of medium and small equipment (of course, a large network has been needless to say), recently has the mobile phone support function allows you toyour mobile phone design your favorite function. Of course, you need to havesupport for flash mobile phone. Of course, it also can be applied to Pocket PC.
Using the FLASH developed a number of cross platform network game, even aslarge MMOR, after the arrival of 3G era, we can play to a large network game on mobile phone soon, the existing FLASH network game: class SLG (three blood),sports (blood, class RPG (ball) mortal comprehension), desktop (Dezhou poker),TD (defend their homes) and so on.
FLASH game of the popular
FLASH is the development of Webpage rich media and interactivity technology,originally used to
develop interactive or animated web component, in recentyears has make a spurt of progress of development. According to the statistics ofAdobe, the PC desktop, Internet penetration rate reached a staggering 99%, andJAVA 85.1%. At present, FLASH is more vigorously to PDA and intelligent mobile phone terminal development.
FLASH contains a set of programmable script parser, called ActionScript, with the use of Java and Javascript like syntax, can control the FLASH animation, to achieve a variety of interactive function. AS3.0 also supports the Socket network function, which makes the development of large-scale interactive Webpage gamepossible. By virtue of the excellent performance of ActionScript2.0 and ActionScript3.0, FLASH technology becomes the technical basis of the vast majority of small game development. The FLASH parser, called Flash Player, a very small volume. It can not only support the popular IE browser, can alsosupport Firefox, Opera, Safari and a variety of browser, users download the installation is very convenient. One of the important reasons for this is Flash little game popular.
chapter 2 The game design
2.1 Game framework The game is divided into titles, the game interface and game interface. Titles animation playback finishes, entered the game selection screen, the game playerto choose to play the game.。
2.2 The game
1.Titles: the movie import and insert the key frames to make titles effects.
2.The main interface of the game: auto play main interface of the game after the end of the game in the titles, the main interface provides selection button to playthe game. Divided into two big bird,
duck.
picture0-1 The main interface of the game
2.3 Conversion between the scenarios
on (release) {
Mouse.show();
delete _root.onEnterFrame;
for(i=1;i
this["mc"+i].removeMovieClip();
_root.mc.swapDepths(1);
removeMovieClip(_root.mc);
gotoAndPlay
chapter 3 The realization of the function of the
Flash game
3.1 The main scene
for(i=1;i
_root["face"].duplicateMovieClip("face"+i,i+1000,face);}
var score = 0;/stop();
onClipEvent(load){
function reset(){
if(this._name=="face"){
this._visible=false;
}
else{
this._visible=true;
}
this.dead=0;
this.speed=random(4)+5;
this._x=600;
this._y=random(400);/}
this.reset();
}
onClipEvent(enterFrame){
this._x-=this.speed;
if(this._x
this.reset();
onClipEvent (load) {
startDrag(this, true);
Mouse.hide();
this.swapDepths(9999);
}
onClipEvent(mouseDown)
playsounds = new Sound(this);
playsounds.attachSound("Gun_s");
playsounds.start(0, 1);//
for(i=1;i
if(this.hitTest(_root["face"+i])&&_root["face"+i].dead==0)
{
_root.score += 10;
_root["face"+i].gotoAndPlay(2);}
}
3.2 The first frame
stop();
readytime = 0;
ready = 3;
timer = 0;
time = 0;
_root.onEnterFrame = function() {
readytime++;
ready = 3-int(readytime/5);
if (ready == 0) {
gotoAndStop(2);/
delete _root.onEnterFrame;
}};
3.3 The second frame
stop();
Mouse.hide();/
score = 0;
function firstPos() {
_root.bird._x = 50+random(450);
_root.bird._y = 370;
dirX = random(5)-random(6);}
_root.target.onMouseMove = function() {
this._x = _root._xmouse;
this._y = _root._ymouse;
updateAfterEvent();//
};
_root.target.onEnterFrame = function() {
time++;
_root.timer = 30-int(time/30);
if (_root.timer == 0) {
_root.gotoAndPlay(
}};
_root.target.onMouseDown = function()/
playsounds = new Sound(this);
playsounds.attachSound("Gun_s");
playsounds.start(0, 1);/
_root.tan._x = _root._xmouse;
_root.tan._y = _root._ymouse;
_root.tan.play();//
_root.onEnterFrame = function() {
if (_root.tan._currentframe == 10) {
hit = _root.tan.hitTest(_root.bird);
if (hit) { firstPos(); _root.score++; with (_root.diebird) { _x = _root.tan._x; _y = _root.tan._y; gotoAndPlay(2); }}}};};/ _root.bird.onEnterFrame = function() { if (_root.bird._y550) { firstPos(); } else { _root.bird._y -= (5+random(2)); _root.bird._x += dirX; }};
3.4 The third frame
stop();
_root.replay.onEnterFrame = function() {
if (_root.tan._currentframe == 10) {
hit2 = _root.replay.hitTest(_root.tan);
if (hit2) {
_root.gotoAndStop(1);
}
}
chapter 4 Summary
To make three small game I further understand that the Flash specific functions,using the conversion from the frame by frame elements, from the script code touse the function statement, from the mutual use of guiding layer and the layer mask, let me realize that making a game is not the kind of simple, this during theencounter a lot of not knowledge, and the difficulty of writing code, but by the teacher, the students, and help the book network, slowly to solve thesedifficulties.
In the production of the Flash game, involves many details are also manyrequirements have a clear idea of each animation elements will be loaded from the production to understand the script, tightness of the function requirements of the game. Every scene, every game to hit the production must have the basic operation of Flash, but the knowledge skills are emphasized in different area is different, I from the deep production for his work experience, this is mygraduation design the deepest experience.
Through the graduation design, to understand the basic operation of Flash, the three basic functions of Flash animation is the basis for all Flash applications, in fact I on Flash production code of professional knowledge do not understand, in the design of the code have many are the most simple and commonly used code,see the site design, Flash master in web design ideas, relates to the details in each, I find a lot of relevant information, perhaps do not good enough, but in the future I will work hard.
目录
摘 要: . ............................................................................................................................................. - 2 -
第1章 绪论 . .................................................................................................................................. - 3 -
1.1 Flash软件简介 ......................................................................................................................... - 3 -
1.2 Flash的特点 ............................................................................................................................. - 3 -
1.3 Flash游戏 ................................................................................................................................. - 4 -
1.4 Flash游戏的发展方向 ........................................................................................................... - 14 -
第2章 游戏设计思路 . .................................................................................................................. - 6 -
2.1 游戏的框架 . ........................................................................................................................... - 15 -
2.2 游戏的组成 . ........................................................................................................................... - 15 -
2.3 场景间的转换 . ....................................................................................................................... - 15 -
第3章 Flash 游戏的功能实现 ................................................................................................... - 17 -
3.1 主场景 . .......................................................................................................................................... 7
3.2 第一帧 . .......................................................................................................................................... 8
3.3 第二帧 . .......................................................................................................................................... 8
3.4 第三帧 . .......................................................................................................................................... 9
第4章 总结 . ................................................................................................................................ - 20 -
摘 要:
Flash 游戏是一种新兴起的游戏形式,以游戏简单,操作方便,绿色,无需安装,文件体积小等优点现在渐渐被广大网友喜爱。Flash 游戏又叫Flash 小游戏,因为Flash 游戏主要应用于一些趣味化的、小型的游戏之上,以完全发挥它基于矢量图的优势。Flash 游戏因为Flash cs3和actionscript 3.0的原因,在近年发展迅速,许多年青人投身其中,并在整个Flash 行业中发挥重要作用。Flash player占据了90%互联网用户的浏览器,所以发的发展空间还十分巨大,前途不可估量。
关键词: Flash ,游戏,矢量
第2章 绪论
2.1Flash 软件简介
Flash 是由macromedia 公司推出的交互式矢量图和 Web 动画的标准。网页设计者使用 Flash 创作出既漂亮又可改变尺寸的导航界面以及其他奇特的效果。Flash 也是存储芯片的一种,通过特定的程序可以修改里面的数据。
Flash 是一种创作工具,设计人员和开发人员可使用它来创建演示文稿、应用程序和其它允许用户交互的内容。Flash 可以包含简单的动画、视频内容、复杂演示文稿和应用程序以及介于它们之间的任何内容。
Flash 特别适用于创建通过Internet 提供的内容,因为它的文件非常小。Flash 是通过广泛使用矢量图形做到这一点的。与位图图形相比,矢量图形需要的内存和存储空间小很多,因为它们是以数学公式而不是大型数据集来表示的。位图图形之所以更大,是因为图像中的每个像素都需要一组单独的数据来表示。
在Flash 中创作内容时,需要在Flash 文档文件中工作。Flash 文档的文件扩展名为.fla 。 Flash 文档有四个主要部分:
5. 舞台是在回放过程中显示图形、视频、按钮等内容的位置。在Flash 基础中将对舞
台做详细介绍。
6. 时间轴用来通知Flash 显示图形和其它项目元素的时间,也可以使用时间轴指定舞
台上各图形的分层顺序。位于较高图层中的图形显示在较低图层中的图形的上方。
7. 库面板是Flash 显示Flash 文档中的媒体元素列表的位置。
8. ActionScript 代码可用来向文档中的媒体元素添加交互式内容。例如,可以添加代
码以便用户在单击某按钮时显示一幅新图像,还可以使用ActionScript 向应用程序
添加逻辑。逻辑使应用程序能够根据用户的操作和其它情况采取不同的工作方式。
Flash 包括两个版本的ActionScript ,可满足创作者的不同具体需要。
2.2 Flash的特点
5. 使用矢量图形和流式播放技术。与位图图形不同的是,矢量图形可以任意缩放尺寸
而不影响图形的质量;流式播放技术使得动画可以边播放边下载,从而缓解了网页
浏览者焦急等待的情绪。
6. 通过使用关键帧和图符使得所生成的动画(.swf)文件非常小,几K 字节的动画文件已
经可以实现许多令人心动的动画效果,用在网页设计上不仅可以使网页更加生动,
而且小巧玲珑下载迅速,使得动画可以在打开网页很短的时间里就得以播放。
7. 把音乐,动画,声效互方式融合在一起,越来越多的人已经把Flash 作为网页动画设
计的首选工具,而且可以支持MP3的音乐格式,这使得加入音乐的动画文件也能保
持小巧的‘身材’。
8. 强大的动画编辑功能使得设计者可以随心所欲地设计出高品质的动画,通过ACTION
和FS COMMAND可以实现交互性,使Flash 具有更大的设计自由度,另外,它与当
今最流行的网页设计工具Dreamweaver 配合默契,可以直接嵌入网页的任一位置,
非常方便。
2.3 Flash游戏
Flash 游戏在游戏形式上的表现与传统游戏基本无异,但主要生存于网络之上,因为它的体积小、传播快、画面美观,所以大有取代传统web 网游的趋势,现在国内外用Flash 制作无端网游已经成为一种趋势,只要浏览器安装了ADOBE 的Flash player,就可以玩所有的flash 游戏了,这比传统的web 网游进步许多信息资料收集,需求分析
对于Flash 游戏而言,容量同比来说是最小的,而且占用时间很短,可以起到放松娱乐,休闲身心的作用, 其具体有体积小、内容好、耐玩、娱乐性高、无年龄层次、能修改难度、有益身心健康、数量多、玩法丰富新颖等特色。
2.4 Flash游戏的发展方向
Flash 被称为是“最为灵活的前台”。由于其独特和时间片段分割(TimeLine )和重组(MC 嵌套)技术,结合ActionScitp 的对象和流程控制。使得在灵活的界面设计和动画设计中成为可能,但一直还未形成一套在flash 中的界面设计理论。同时它也是最为小巧的前台。
Flash 具有跨平台的特性(这点和Java 一样),所以无论你处于处于何种平台,只要你安装有支持的flash Player 。你就能保证它们的最终显示效果都一致。而不必像在以前的网页设计中那样为IE 和Mozilla 或NetSpace 各设计一个版本。同Java 一样。它的可移植性很强。特别是在小型网络中和小型设备中(当然大型网络已不用说),最近具有的手机支持功能可以让你为自已的手机设计你喜爱的功能。当然你必需要有支持flash 的手机。当然它还可以应用于Pocket PC上。
目前利用FLASH 开发出了许多夸平台的网络游戏, 甚至可以匹敌大型MMOR, 在3G 时代到来以后, 我们很快可以在手机上玩到大型网络游戏, 现有的FLASH 制作网络游戏有:SLG类(热血三国), 体育类(热血球球),RPG 类(凡人修真), 桌面(德州扑克),TD 类(保卫家园) 等等.
FLASH 小游戏的流行
FLASH 是开发的网页富媒体及强交互技术,最初用来研发交互式或动画网站组件,近几年获得了突飞猛进的发展。根据Adobe 公司的统计,其互联网PC 桌面普及率达到了惊人的99%,而JA V A 为85.1%。目前FLASH 更在大力向PDA 及智能手机终端发展。
FLASH 技术包含一套可编程脚本解析器,称为ActionScript ,使用与Java 及Javascript 类似语法,可以控制FLASH 动画,实现多种交互功能。AS3.0更支持了Socket 联网功能,使得开发大型交互式网页游戏成为可能。凭借ActionScript2.0及ActionScript3.0的出色表现,FLASH 技术成为了绝大多数小游戏开发的技术基础。 FLASH 的解析器,称为Flash Player,体积十分小巧。不仅可以支持流行的IE 浏览器,还可以支持Firefox, Opera, Safari 等多款浏览器,用户下载安装非常方便。这也是Flash 小游戏流行的重要原因之一。
第2章 游戏设计思路
2.1 游戏的框架
游戏分为片头,游戏选择主界面和游戏界面。片头动画播放完后,进入游戏选择画面,由玩家自主选择试玩的游戏。如游戏框架所示。
2.2 游戏的组成
1. 片头:利用影片导入和插入关键帧来制作片头特效。
2. 游戏主界面:在片头结束之后自动播放游戏主界面,游戏主界面提供需要试玩的游戏的选择按钮。分为打鸟,大鸭子两种。如picture0-1游戏主界面所示。
图 2-1 游戏主界面
1. 游戏一:打鸟。游戏开始后,会有鸟从右侧飞出,玩家控制准心点击飞行的鸟,将其击
落。此游戏没有时间限制,分数也没有上限,直至玩家自行退出,属于无聊发泄
型游戏。
2. 游戏二:打鸭子。游戏开始后,进入3秒倒计时,倒计时结束,在水中游的鸭子就会起
飞,这时玩家可以控制准心打击飞起的鸭子,击落1只得一分。游戏开始后会进
入30秒计时,时间到则游戏结束。
2.3 场景间的转换
1. 主要用到gotoAndPlay 动作。
on (release) {
Mouse.show();//把玩游戏时隐藏的鼠标再显示出来
delete _root.onEnterFrame;
for(i=1;i
this["mc"+i].removeMovieClip();//删除在游戏里创建的MC
_root.mc.swapDepths(1);//交换深度,深度设为正的才能删除
removeMovieClip(_root.mc);//删除游戏里创建的MC
gotoAndPlay("过场",1);//跳转到过场1的第一帧
}
第三章Flash 游戏的功能实现
3.1 主场景
1) 在主场景第一帧添加代码:
for(i=1;i
_root["face"].duplicateMovieClip("face"+i,i+1000,face);//复制face 元件
}
var score = 0;//定义分数从0开始
stop();
2) 将小鸟元件拖入主场景,并添加代码:
onClipEvent(load){
function reset(){
if(this._name=="face"){
this._visible=false;
}
else{
this._visible=true;
}
this.dead=0;
this.speed=random(4)+5;//小鸟飞行速度
this._x=600;
this._y=random(400);//定义小鸟随机飞行坐标
}
this.reset();
}
onClipEvent(enterFrame){
this._x-=this.speed;
if(this._x
this.reset();//小鸟超出屏幕范围后重置
}}
3) 将准心元件拖入主场景,并添加代码:
onClipEvent (load) {
startDrag(this, true);
Mouse.hide();
this.swapDepths(9999);//在场景上生成MC ,隐藏鼠标,并定义MC 深度
}
onClipEvent(mouseDown)//鼠标按下动作{
playsounds = new Sound(this);
playsounds.attachSound("Gun_s");
playsounds.start(0, 1);//播放枪声
for(i=1;i
if(this.hitTest(_root["face"+i])&&_root["face"+i].dead==0)
{
_root.score += 10;//打中小鸟加分
_root["face"+i].gotoAndPlay(2);//继续生成小鸟
}}}
3.2 第一帧
3.3 第二帧
stop(); readytime = 0; ready = 3; timer = 0; time = 0; _root.onEnterFrame = function() { readytime++; ready = 3-int(readytime/5); //游戏开始后进行一个倒计时 if (ready == 0) { gotoAndStop(2);//倒计时结束,跳转到第二帧,游戏开始 delete _root.onEnterFrame; }}; stop(); Mouse.hide();//隐藏鼠标 score = 0;//计分器从0开始 function firstPos() { _root.bird._x = 50+random(450); _root.bird._y = 370; dirX = random(5)-random(6);//小鸟飞飞 } _root.target.onMouseMove = function() { this._x = _root._xmouse; this._y = _root._ymouse; updateAfterEvent();//瞄准镜跟随鼠标 }; _root.target.onEnterFrame = function() { time++; _root.timer = 30-int(time/30); if (_root.timer == 0) { _root.gotoAndPlay("打鸭子",3);//倒计时 }}; _root.target.onMouseDown = function()//鼠标按下动作 { playsounds = new Sound(this);
playsounds.attachSound("Gun_s");
playsounds.start(0, 1);//播放枪声
_root.tan._x = _root._xmouse;
3.4 第三帧
_root.tan._y = _root._ymouse; _root.tan.play();//子弹跟随鼠标 _root.onEnterFrame = function() { if (_root.tan._currentframe == 10) { hit = _root.tan.hitTest(_root.bird); if (hit) { firstPos(); _root.score++; with (_root.diebird) { _x = _root.tan._x; _y = _root.tan._y; gotoAndPlay(2); }}}};};//发射子弹 _root.bird.onEnterFrame = function() { if (_root.bird._y550) { firstPos(); } else { _root.bird._y -= (5+random(2)); _root.bird._x += dirX; }}; stop(); _root.replay.onEnterFrame = function() { if (_root.tan._currentframe == 10) { hit2 = _root.replay.hitTest(_root.tan); if (hit2) { _root.gotoAndStop(1); } } }//点击replay 重新开始游戏
第四章 总结
对三个小游戏的制作中我进一步了解到了Flash 具体功能,从逐帧动画的元件的转换利用,从脚本代码的编写到函数语句的运用,从引导层与遮罩层的相互利用,让我认识到制作一个游戏并不是那样的简单,这期间遇到了很多不会的知识,和难以编写的代码,但通过老师,同学,以及书本网络的帮助,慢慢的解决了这些难点。
在此次Flash 游戏的制作中,涉及方面很多注意的细节也很多要求有较清晰的思路将每个动画元件的加载,从制作中了解了脚本游戏对于函数要求的严密性。每一个场景,每一个游戏打的制作都必须具备Flash 基本操作,但是在不同的方面所侧重的知识技能技巧是不同的,我从对于自己作品的制作中深有体会,这也是我对毕业设计的最深体会。
通过这次的毕业设计,了解到 Flash 的基本操作, Flash 动画的三大基本功能是一切Flash 动画应用的基础,其实我对Flash 制作代码方面的专业知识不太懂,在设计上所用到代码有很多都是最简单常用的代码,在网上看Flash 大师的站点构思,设计想法,在每个涉及到细节,我都找了许多相关资料,也许做的不够好,但今后我会努力。
Catalog
abstract : . ............................................................................................................................................ 2 chapter 1 Introduction ............................................................................................................. - 3 -
1.1 Flash software description . ........................................................................................................ - 3 -
1.2 Flash point ................................................................................................................................. - 3 -
1.3 Flash game . ................................................................................................................................ - 4 -
1.4 Flash The direction of the game development ............................................................................... 4 chapter 2 The game design ....................................................................................................... 6
2.1 Game framework . ........................................................................................................................... 6
2.2 The game. ....................................................................................................................................... 6
2.3 Conversion between the scenarios ................................................................................................. 6 chapter 3 FlashThe realization of the function of the game . .......................................... 7
3.1 The main scene . .............................................................................................................................. 7
3.2 The first frame ................................................................................................................................ 8
3.3 The second frame ........................................................................................................................... 8
3.4 The third frame . .............................................................................................................................. 9 chapter 4 Summary . .................................................................................................................... 10
Abstract:
Flash game is a new form of the game, the game is simple, easy to operate, green, no
need to install the advantages of small size, file now gradually by the majority of users
love. Flash game called flash small game, because the game on flash is mainly applied
to some interesting, small game, to fully play its advantages based on vector map.
Flash game because of flash CS3 and ActionScript 3, rapid development in recent
years, many young people to join them, and play an important role in the whole flash
industry. Flash player accounted for 90% of all Internet users of the browser, so the
development of space is very large, with promising future.
Keywords: flash, game, vector
Chapter 1 Introduction
1.1 Flash Software description Flash was launched by Macromedia's interactive vector graphics and Web animation standards. Webpage designers use Flash to create beautiful and can change the size of the navigation interface and other strange effect. Flash is amemory chip, through specific program can modify the data. Flash is an authoring tool, designers and developers can use it to create presentations, applications and other content to allow user interaction. Flash can include simple animation, video content, complex presentations, applications, and anything in between.
Especially suitable for creating Flash content available through Internet, because its files are very small. Flash is through the extensive use of vector graphics do it.Compared with the bitmap graphics, vector graphics needs a lot of memory and storage space, because they are based on mathematical formulas instead of large data sets to represent. Bitmap graphics are bigger, because each pixel in the image needs a separate set of data to represent.
In Flash content creation, need to work in a Flash document file. Extended Flash document file name is.Fla.
The Flash document has four main parts:
1. The stage is display graphics, video, buttons and other content during playbackposition. Do the detailed introduction to the stage at the Flash foundation.
2. The time axis is used to tell the Flash to display graphics and other projects of the elements,
can also use the timeline specified stage hierarchical order of eachgraph. The higher layer is
located above the graphic is displayed in the lowerlayer graph.
The library panel is Flash to display a list of media elements in an Flash document location. ActionScript code can be used to add interactive content to media elements in the document.
For example, you can add code to the user to display a new image atthe click of a button,
you can also use ActionScript to add the logic to application.The logic enable the application
according to the user's operation and othercircumstances of different ways of working. Flash
includes two versions of the ActionScript, which can meet the different needs of creators. 3. 4.
1.2 The characteristics of Flash
1. Use vector graphics and streaming technology. And bitmap graphics, vector graphics can be
scaled arbitrarily without affecting the size of graphics; streaming technology makes animation
while playing while downloading, thereby alleviatingWebpage browsers anxiously waiting for
the mood.
2. Through the use of key frames and operator makes generated animation (.Swf)file is very
small, a few K bytes of animation files can realize many peopleHeartbeat animation effects,
used in Webpage design can not only makeWebpage more vivid, but little and dainty download
quickly, so that the animation can be played on the open Webpage short time.
3. The music, animation, sound effects, interactive way together, more and more people have
Flash as the preferred tool Webpage animation design, and can support MP3 music format,
which makes adding music animation files can maintain the cabinet 'figure'. 4. Strong animation editing functions that designers can design a high-qualityanimation, through the ACTION and FS COMMAND can achieve interactive, so that Flash has a greater degree of
design freedom, in addition, it is the most popular Webpage design tool Dreamweaver with a
tacit agreement, can be directly embedded in any position Webpage, very convenient.
1.3 Flash Game Flash game in the forms and traditional game, basically the same, but mainlyexist in the network, because of its small size, fast spread, screen appearance,so much to replace the traditional web net trends both at home and abroad, nowFlash online games for no reason has become a trend, as long as the browserinstalled ADOBE Flash player, you can play all the flash games, this is better than the traditional web net swims the progress of many information gathering,requirement analysis
For Flash games, compared to the same period capacity is the minimum, andoccupied a very short time, can play a relaxing entertainment, leisure physical and mental function, which has the advantages of small volume, good content,Nai Wan, entertaining, no age level, can modify the difficulty, good physical and mental health, the number of new features, gameplay rich.
1.4 The development direction of Flash games
Flash is known as "the most flexible front". Because of its unique and timesegment segmentation (TimeLine) and recombinant (nested MC) technology,combined with the ActionScitp object and process control. The design of interface design and animation in a flexible as possible, but has not yet formed a set ofinterface design theory in flash. At the same time it is also the most compactfront.
Flash has the characteristics of cross platform (this is like Java), so no matter what platform you are in, as long as you have the support of flash Player installation. You can ensure that they show the effect of the final agreement.Rather than as in previous Webpage design as IE and Mozilla or design a version of the NetSpace. As with the Java. Its portability strong. Especially in the small network of medium and small equipment (of course, a large network has been needless to say), recently has the mobile phone support function allows you toyour mobile phone design your favorite function. Of course, you need to havesupport for flash mobile phone. Of course, it also can be applied to Pocket PC.
Using the FLASH developed a number of cross platform network game, even aslarge MMOR, after the arrival of 3G era, we can play to a large network game on mobile phone soon, the existing FLASH network game: class SLG (three blood),sports (blood, class RPG (ball) mortal comprehension), desktop (Dezhou poker),TD (defend their homes) and so on.
FLASH game of the popular
FLASH is the development of Webpage rich media and interactivity technology,originally used to
develop interactive or animated web component, in recentyears has make a spurt of progress of development. According to the statistics ofAdobe, the PC desktop, Internet penetration rate reached a staggering 99%, andJAVA 85.1%. At present, FLASH is more vigorously to PDA and intelligent mobile phone terminal development.
FLASH contains a set of programmable script parser, called ActionScript, with the use of Java and Javascript like syntax, can control the FLASH animation, to achieve a variety of interactive function. AS3.0 also supports the Socket network function, which makes the development of large-scale interactive Webpage gamepossible. By virtue of the excellent performance of ActionScript2.0 and ActionScript3.0, FLASH technology becomes the technical basis of the vast majority of small game development. The FLASH parser, called Flash Player, a very small volume. It can not only support the popular IE browser, can alsosupport Firefox, Opera, Safari and a variety of browser, users download the installation is very convenient. One of the important reasons for this is Flash little game popular.
chapter 2 The game design
2.1 Game framework The game is divided into titles, the game interface and game interface. Titles animation playback finishes, entered the game selection screen, the game playerto choose to play the game.。
2.2 The game
1.Titles: the movie import and insert the key frames to make titles effects.
2.The main interface of the game: auto play main interface of the game after the end of the game in the titles, the main interface provides selection button to playthe game. Divided into two big bird,
duck.
picture0-1 The main interface of the game
2.3 Conversion between the scenarios
on (release) {
Mouse.show();
delete _root.onEnterFrame;
for(i=1;i
this["mc"+i].removeMovieClip();
_root.mc.swapDepths(1);
removeMovieClip(_root.mc);
gotoAndPlay
chapter 3 The realization of the function of the
Flash game
3.1 The main scene
for(i=1;i
_root["face"].duplicateMovieClip("face"+i,i+1000,face);}
var score = 0;/stop();
onClipEvent(load){
function reset(){
if(this._name=="face"){
this._visible=false;
}
else{
this._visible=true;
}
this.dead=0;
this.speed=random(4)+5;
this._x=600;
this._y=random(400);/}
this.reset();
}
onClipEvent(enterFrame){
this._x-=this.speed;
if(this._x
this.reset();
onClipEvent (load) {
startDrag(this, true);
Mouse.hide();
this.swapDepths(9999);
}
onClipEvent(mouseDown)
playsounds = new Sound(this);
playsounds.attachSound("Gun_s");
playsounds.start(0, 1);//
for(i=1;i
if(this.hitTest(_root["face"+i])&&_root["face"+i].dead==0)
{
_root.score += 10;
_root["face"+i].gotoAndPlay(2);}
}
3.2 The first frame
stop();
readytime = 0;
ready = 3;
timer = 0;
time = 0;
_root.onEnterFrame = function() {
readytime++;
ready = 3-int(readytime/5);
if (ready == 0) {
gotoAndStop(2);/
delete _root.onEnterFrame;
}};
3.3 The second frame
stop();
Mouse.hide();/
score = 0;
function firstPos() {
_root.bird._x = 50+random(450);
_root.bird._y = 370;
dirX = random(5)-random(6);}
_root.target.onMouseMove = function() {
this._x = _root._xmouse;
this._y = _root._ymouse;
updateAfterEvent();//
};
_root.target.onEnterFrame = function() {
time++;
_root.timer = 30-int(time/30);
if (_root.timer == 0) {
_root.gotoAndPlay(
}};
_root.target.onMouseDown = function()/
playsounds = new Sound(this);
playsounds.attachSound("Gun_s");
playsounds.start(0, 1);/
_root.tan._x = _root._xmouse;
_root.tan._y = _root._ymouse;
_root.tan.play();//
_root.onEnterFrame = function() {
if (_root.tan._currentframe == 10) {
hit = _root.tan.hitTest(_root.bird);
if (hit) { firstPos(); _root.score++; with (_root.diebird) { _x = _root.tan._x; _y = _root.tan._y; gotoAndPlay(2); }}}};};/ _root.bird.onEnterFrame = function() { if (_root.bird._y550) { firstPos(); } else { _root.bird._y -= (5+random(2)); _root.bird._x += dirX; }};
3.4 The third frame
stop();
_root.replay.onEnterFrame = function() {
if (_root.tan._currentframe == 10) {
hit2 = _root.replay.hitTest(_root.tan);
if (hit2) {
_root.gotoAndStop(1);
}
}
chapter 4 Summary
To make three small game I further understand that the Flash specific functions,using the conversion from the frame by frame elements, from the script code touse the function statement, from the mutual use of guiding layer and the layer mask, let me realize that making a game is not the kind of simple, this during theencounter a lot of not knowledge, and the difficulty of writing code, but by the teacher, the students, and help the book network, slowly to solve thesedifficulties.
In the production of the Flash game, involves many details are also manyrequirements have a clear idea of each animation elements will be loaded from the production to understand the script, tightness of the function requirements of the game. Every scene, every game to hit the production must have the basic operation of Flash, but the knowledge skills are emphasized in different area is different, I from the deep production for his work experience, this is mygraduation design the deepest experience.
Through the graduation design, to understand the basic operation of Flash, the three basic functions of Flash animation is the basis for all Flash applications, in fact I on Flash production code of professional knowledge do not understand, in the design of the code have many are the most simple and commonly used code,see the site design, Flash master in web design ideas, relates to the details in each, I find a lot of relevant information, perhaps do not good enough, but in the future I will work hard.
目录
摘 要: . ............................................................................................................................................. - 2 -
第1章 绪论 . .................................................................................................................................. - 3 -
1.1 Flash软件简介 ......................................................................................................................... - 3 -
1.2 Flash的特点 ............................................................................................................................. - 3 -
1.3 Flash游戏 ................................................................................................................................. - 4 -
1.4 Flash游戏的发展方向 ........................................................................................................... - 14 -
第2章 游戏设计思路 . .................................................................................................................. - 6 -
2.1 游戏的框架 . ........................................................................................................................... - 15 -
2.2 游戏的组成 . ........................................................................................................................... - 15 -
2.3 场景间的转换 . ....................................................................................................................... - 15 -
第3章 Flash 游戏的功能实现 ................................................................................................... - 17 -
3.1 主场景 . .......................................................................................................................................... 7
3.2 第一帧 . .......................................................................................................................................... 8
3.3 第二帧 . .......................................................................................................................................... 8
3.4 第三帧 . .......................................................................................................................................... 9
第4章 总结 . ................................................................................................................................ - 20 -
摘 要:
Flash 游戏是一种新兴起的游戏形式,以游戏简单,操作方便,绿色,无需安装,文件体积小等优点现在渐渐被广大网友喜爱。Flash 游戏又叫Flash 小游戏,因为Flash 游戏主要应用于一些趣味化的、小型的游戏之上,以完全发挥它基于矢量图的优势。Flash 游戏因为Flash cs3和actionscript 3.0的原因,在近年发展迅速,许多年青人投身其中,并在整个Flash 行业中发挥重要作用。Flash player占据了90%互联网用户的浏览器,所以发的发展空间还十分巨大,前途不可估量。
关键词: Flash ,游戏,矢量
第2章 绪论
2.1Flash 软件简介
Flash 是由macromedia 公司推出的交互式矢量图和 Web 动画的标准。网页设计者使用 Flash 创作出既漂亮又可改变尺寸的导航界面以及其他奇特的效果。Flash 也是存储芯片的一种,通过特定的程序可以修改里面的数据。
Flash 是一种创作工具,设计人员和开发人员可使用它来创建演示文稿、应用程序和其它允许用户交互的内容。Flash 可以包含简单的动画、视频内容、复杂演示文稿和应用程序以及介于它们之间的任何内容。
Flash 特别适用于创建通过Internet 提供的内容,因为它的文件非常小。Flash 是通过广泛使用矢量图形做到这一点的。与位图图形相比,矢量图形需要的内存和存储空间小很多,因为它们是以数学公式而不是大型数据集来表示的。位图图形之所以更大,是因为图像中的每个像素都需要一组单独的数据来表示。
在Flash 中创作内容时,需要在Flash 文档文件中工作。Flash 文档的文件扩展名为.fla 。 Flash 文档有四个主要部分:
5. 舞台是在回放过程中显示图形、视频、按钮等内容的位置。在Flash 基础中将对舞
台做详细介绍。
6. 时间轴用来通知Flash 显示图形和其它项目元素的时间,也可以使用时间轴指定舞
台上各图形的分层顺序。位于较高图层中的图形显示在较低图层中的图形的上方。
7. 库面板是Flash 显示Flash 文档中的媒体元素列表的位置。
8. ActionScript 代码可用来向文档中的媒体元素添加交互式内容。例如,可以添加代
码以便用户在单击某按钮时显示一幅新图像,还可以使用ActionScript 向应用程序
添加逻辑。逻辑使应用程序能够根据用户的操作和其它情况采取不同的工作方式。
Flash 包括两个版本的ActionScript ,可满足创作者的不同具体需要。
2.2 Flash的特点
5. 使用矢量图形和流式播放技术。与位图图形不同的是,矢量图形可以任意缩放尺寸
而不影响图形的质量;流式播放技术使得动画可以边播放边下载,从而缓解了网页
浏览者焦急等待的情绪。
6. 通过使用关键帧和图符使得所生成的动画(.swf)文件非常小,几K 字节的动画文件已
经可以实现许多令人心动的动画效果,用在网页设计上不仅可以使网页更加生动,
而且小巧玲珑下载迅速,使得动画可以在打开网页很短的时间里就得以播放。
7. 把音乐,动画,声效互方式融合在一起,越来越多的人已经把Flash 作为网页动画设
计的首选工具,而且可以支持MP3的音乐格式,这使得加入音乐的动画文件也能保
持小巧的‘身材’。
8. 强大的动画编辑功能使得设计者可以随心所欲地设计出高品质的动画,通过ACTION
和FS COMMAND可以实现交互性,使Flash 具有更大的设计自由度,另外,它与当
今最流行的网页设计工具Dreamweaver 配合默契,可以直接嵌入网页的任一位置,
非常方便。
2.3 Flash游戏
Flash 游戏在游戏形式上的表现与传统游戏基本无异,但主要生存于网络之上,因为它的体积小、传播快、画面美观,所以大有取代传统web 网游的趋势,现在国内外用Flash 制作无端网游已经成为一种趋势,只要浏览器安装了ADOBE 的Flash player,就可以玩所有的flash 游戏了,这比传统的web 网游进步许多信息资料收集,需求分析
对于Flash 游戏而言,容量同比来说是最小的,而且占用时间很短,可以起到放松娱乐,休闲身心的作用, 其具体有体积小、内容好、耐玩、娱乐性高、无年龄层次、能修改难度、有益身心健康、数量多、玩法丰富新颖等特色。
2.4 Flash游戏的发展方向
Flash 被称为是“最为灵活的前台”。由于其独特和时间片段分割(TimeLine )和重组(MC 嵌套)技术,结合ActionScitp 的对象和流程控制。使得在灵活的界面设计和动画设计中成为可能,但一直还未形成一套在flash 中的界面设计理论。同时它也是最为小巧的前台。
Flash 具有跨平台的特性(这点和Java 一样),所以无论你处于处于何种平台,只要你安装有支持的flash Player 。你就能保证它们的最终显示效果都一致。而不必像在以前的网页设计中那样为IE 和Mozilla 或NetSpace 各设计一个版本。同Java 一样。它的可移植性很强。特别是在小型网络中和小型设备中(当然大型网络已不用说),最近具有的手机支持功能可以让你为自已的手机设计你喜爱的功能。当然你必需要有支持flash 的手机。当然它还可以应用于Pocket PC上。
目前利用FLASH 开发出了许多夸平台的网络游戏, 甚至可以匹敌大型MMOR, 在3G 时代到来以后, 我们很快可以在手机上玩到大型网络游戏, 现有的FLASH 制作网络游戏有:SLG类(热血三国), 体育类(热血球球),RPG 类(凡人修真), 桌面(德州扑克),TD 类(保卫家园) 等等.
FLASH 小游戏的流行
FLASH 是开发的网页富媒体及强交互技术,最初用来研发交互式或动画网站组件,近几年获得了突飞猛进的发展。根据Adobe 公司的统计,其互联网PC 桌面普及率达到了惊人的99%,而JA V A 为85.1%。目前FLASH 更在大力向PDA 及智能手机终端发展。
FLASH 技术包含一套可编程脚本解析器,称为ActionScript ,使用与Java 及Javascript 类似语法,可以控制FLASH 动画,实现多种交互功能。AS3.0更支持了Socket 联网功能,使得开发大型交互式网页游戏成为可能。凭借ActionScript2.0及ActionScript3.0的出色表现,FLASH 技术成为了绝大多数小游戏开发的技术基础。 FLASH 的解析器,称为Flash Player,体积十分小巧。不仅可以支持流行的IE 浏览器,还可以支持Firefox, Opera, Safari 等多款浏览器,用户下载安装非常方便。这也是Flash 小游戏流行的重要原因之一。
第2章 游戏设计思路
2.1 游戏的框架
游戏分为片头,游戏选择主界面和游戏界面。片头动画播放完后,进入游戏选择画面,由玩家自主选择试玩的游戏。如游戏框架所示。
2.2 游戏的组成
1. 片头:利用影片导入和插入关键帧来制作片头特效。
2. 游戏主界面:在片头结束之后自动播放游戏主界面,游戏主界面提供需要试玩的游戏的选择按钮。分为打鸟,大鸭子两种。如picture0-1游戏主界面所示。
图 2-1 游戏主界面
1. 游戏一:打鸟。游戏开始后,会有鸟从右侧飞出,玩家控制准心点击飞行的鸟,将其击
落。此游戏没有时间限制,分数也没有上限,直至玩家自行退出,属于无聊发泄
型游戏。
2. 游戏二:打鸭子。游戏开始后,进入3秒倒计时,倒计时结束,在水中游的鸭子就会起
飞,这时玩家可以控制准心打击飞起的鸭子,击落1只得一分。游戏开始后会进
入30秒计时,时间到则游戏结束。
2.3 场景间的转换
1. 主要用到gotoAndPlay 动作。
on (release) {
Mouse.show();//把玩游戏时隐藏的鼠标再显示出来
delete _root.onEnterFrame;
for(i=1;i
this["mc"+i].removeMovieClip();//删除在游戏里创建的MC
_root.mc.swapDepths(1);//交换深度,深度设为正的才能删除
removeMovieClip(_root.mc);//删除游戏里创建的MC
gotoAndPlay("过场",1);//跳转到过场1的第一帧
}
第三章Flash 游戏的功能实现
3.1 主场景
1) 在主场景第一帧添加代码:
for(i=1;i
_root["face"].duplicateMovieClip("face"+i,i+1000,face);//复制face 元件
}
var score = 0;//定义分数从0开始
stop();
2) 将小鸟元件拖入主场景,并添加代码:
onClipEvent(load){
function reset(){
if(this._name=="face"){
this._visible=false;
}
else{
this._visible=true;
}
this.dead=0;
this.speed=random(4)+5;//小鸟飞行速度
this._x=600;
this._y=random(400);//定义小鸟随机飞行坐标
}
this.reset();
}
onClipEvent(enterFrame){
this._x-=this.speed;
if(this._x
this.reset();//小鸟超出屏幕范围后重置
}}
3) 将准心元件拖入主场景,并添加代码:
onClipEvent (load) {
startDrag(this, true);
Mouse.hide();
this.swapDepths(9999);//在场景上生成MC ,隐藏鼠标,并定义MC 深度
}
onClipEvent(mouseDown)//鼠标按下动作{
playsounds = new Sound(this);
playsounds.attachSound("Gun_s");
playsounds.start(0, 1);//播放枪声
for(i=1;i
if(this.hitTest(_root["face"+i])&&_root["face"+i].dead==0)
{
_root.score += 10;//打中小鸟加分
_root["face"+i].gotoAndPlay(2);//继续生成小鸟
}}}
3.2 第一帧
3.3 第二帧
stop(); readytime = 0; ready = 3; timer = 0; time = 0; _root.onEnterFrame = function() { readytime++; ready = 3-int(readytime/5); //游戏开始后进行一个倒计时 if (ready == 0) { gotoAndStop(2);//倒计时结束,跳转到第二帧,游戏开始 delete _root.onEnterFrame; }}; stop(); Mouse.hide();//隐藏鼠标 score = 0;//计分器从0开始 function firstPos() { _root.bird._x = 50+random(450); _root.bird._y = 370; dirX = random(5)-random(6);//小鸟飞飞 } _root.target.onMouseMove = function() { this._x = _root._xmouse; this._y = _root._ymouse; updateAfterEvent();//瞄准镜跟随鼠标 }; _root.target.onEnterFrame = function() { time++; _root.timer = 30-int(time/30); if (_root.timer == 0) { _root.gotoAndPlay("打鸭子",3);//倒计时 }}; _root.target.onMouseDown = function()//鼠标按下动作 { playsounds = new Sound(this);
playsounds.attachSound("Gun_s");
playsounds.start(0, 1);//播放枪声
_root.tan._x = _root._xmouse;
3.4 第三帧
_root.tan._y = _root._ymouse; _root.tan.play();//子弹跟随鼠标 _root.onEnterFrame = function() { if (_root.tan._currentframe == 10) { hit = _root.tan.hitTest(_root.bird); if (hit) { firstPos(); _root.score++; with (_root.diebird) { _x = _root.tan._x; _y = _root.tan._y; gotoAndPlay(2); }}}};};//发射子弹 _root.bird.onEnterFrame = function() { if (_root.bird._y550) { firstPos(); } else { _root.bird._y -= (5+random(2)); _root.bird._x += dirX; }}; stop(); _root.replay.onEnterFrame = function() { if (_root.tan._currentframe == 10) { hit2 = _root.replay.hitTest(_root.tan); if (hit2) { _root.gotoAndStop(1); } } }//点击replay 重新开始游戏
第四章 总结
对三个小游戏的制作中我进一步了解到了Flash 具体功能,从逐帧动画的元件的转换利用,从脚本代码的编写到函数语句的运用,从引导层与遮罩层的相互利用,让我认识到制作一个游戏并不是那样的简单,这期间遇到了很多不会的知识,和难以编写的代码,但通过老师,同学,以及书本网络的帮助,慢慢的解决了这些难点。
在此次Flash 游戏的制作中,涉及方面很多注意的细节也很多要求有较清晰的思路将每个动画元件的加载,从制作中了解了脚本游戏对于函数要求的严密性。每一个场景,每一个游戏打的制作都必须具备Flash 基本操作,但是在不同的方面所侧重的知识技能技巧是不同的,我从对于自己作品的制作中深有体会,这也是我对毕业设计的最深体会。
通过这次的毕业设计,了解到 Flash 的基本操作, Flash 动画的三大基本功能是一切Flash 动画应用的基础,其实我对Flash 制作代码方面的专业知识不太懂,在设计上所用到代码有很多都是最简单常用的代码,在网上看Flash 大师的站点构思,设计想法,在每个涉及到细节,我都找了许多相关资料,也许做的不够好,但今后我会努力。