互动媒体制作实验报告-建桥学院-数字媒体艺术专业(完整版)

上传人:沈*** 文档编号:221732381 上传时间:2023-07-07 格式:DOC 页数:54 大小:3.08MB
收藏 版权申诉 举报 下载
互动媒体制作实验报告-建桥学院-数字媒体艺术专业(完整版)_第1页
第1页 / 共54页
互动媒体制作实验报告-建桥学院-数字媒体艺术专业(完整版)_第2页
第2页 / 共54页
互动媒体制作实验报告-建桥学院-数字媒体艺术专业(完整版)_第3页
第3页 / 共54页
资源描述:

《互动媒体制作实验报告-建桥学院-数字媒体艺术专业(完整版)》由会员分享,可在线阅读,更多相关《互动媒体制作实验报告-建桥学院-数字媒体艺术专业(完整版)(54页珍藏版)》请在装配图网上搜索。

1、互动媒体制作实验报告 建桥学院 数字媒体艺术专业(完整版)(文档可以直接使用,也可根据实际需要修改使用,可编辑 欢迎下载)上海建桥学院本科实验报告课程名称:互动媒体制作学 号:姓 名:专 业:数字媒体艺术班 级:指导教师:课内实验目录及成绩序号实验名称页码成绩1交互事件动画(星星亮满天)12文字回合类游戏制作43找茬类小游戏74碰撞类游戏制作11信息技术学院2021年 12 月 1 日上海建桥学院实验报告课程名称: 互动媒体制作 实验类型: 验证型 实验项目名称: 交互事件动画(星星亮满天) 实验地点: 多媒体机房 实验日期: 2021 年 3 月 7 日一、 实验目的和要求1、 熟悉的运用;

2、2、 巩固AS3.0的程序结构和基本语法;3、 能够创建和调用系统函数;4、 能够熟练运用程序基本结构;5、 制作满足相应指标要求的正确运行的小游戏;二、 实验内容和原理1、 使用显示对象、对象点击事件、三大元件等编写交互功能2、 程序的基本结构包括:顺序结构、选择结构、循环结构3、 事件函数:MouseEvent事件类4、 时间函数:Timer类三、 主要仪器设备或环境PC机;Flash cs5.5(或以上);Photoshop cs5(或以上);移动终端5套。四、 操作方法与实验步骤1、确定游戏的主题(名称、色彩配置、主题思想、使用方法等)名称:星星亮满天色彩配置:深邃的天空+颜色随机的星

3、星主题思想:在背景天空区域,左键单击星星出现,并且颜色随机使用方法:鼠标左键单击2、确定游戏的设计流程图3、游戏素材的采集、导入或制作 导入图片bg,并转成元件 导入图片星光,并制作成动画4、关键的操作步骤(含主要代码)及技巧星光转换成元件,并制作动画,达到星星从大到小,从小到大的变化。然后将此元件再次转换,并再次制作动画,共5帧,每帧星星颜色不一样。在bg上的天空上制作一个遮罩层mc ,并对mc添加一个鼠标监听。mc.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);function fl_MouseClickHandler

4、_2(event:MouseEvent):void var mystar:star=new star();mystar.x=mouseX;mystar.y=mouseY;/改大小/颜色mystar.stop();var randomNum:int=Math.floor(Math.random()*5+1);mystar.width=mystar.height=Math.random()*60+30;mystar.gotoAndStop(randomNum);addChild(mystar);trace(已单击鼠标); 五、 实验结果注:可用贴图的方式1、主要使用的AS3.0的知识点添加鼠标监听

5、、实例对象显示在鼠标点击的位置(mystar.x=mouseX; mystar.y=mouseY;)、数学函数(随机数、向下取整)、gotoAndStop2、小游戏的效果(至少给出3个,含制作过程及结果)六、 实验总结注:包括制作过程中出现的问题,实验心得体会及改进意见等在老师的带领下完成了此次小游戏,初次体验到Flash的神奇,特别是随机数的出现。在这种浓烈的兴趣下,我将更认真的学习Flash。上海建桥学院实验报告课程名称: 互动媒体制作 实验类型: 设计型 实验项目名称: 文字回合类游戏制作(面向过程及时间函数) 实验地点: 多媒体机房 实验日期: 2021 年 3 月 21 日一、 实验

6、目的和要求1、 巩固面向对象编程的相关概念;2、 构造函数的创建和使用;3、 事件处理机制及Event类的创建、使用(事件侦听器);4、 能够熟练运用鼠标事件;5、 制作满足要求的动画效果;二、 实验内容和原理1、 使用事件驱动编写AS3.0应用程序(物体移动等的动画效果)2、 鼠标事件:CLICK、MOUSE_MOVE、MOUSE_OVER、MOUSE_OUT、MOUSE_WHEEL等3、 键盘事件:KeyboardEvent.KEY_DOWN(UP)等4、 时间函数:TimerEvent.TIMER、TimerEvent.TIMER _COMPLETE三、 主要仪器设备或环境PC机;Fla

7、sh cs5.5(或以上);Photoshop cs5(或以上);移动终端5套。四、 操作方法与实验步骤1、确定作品的主题(名称、色彩配置、主题思想、使用方法等)名称:勇者斗恶龙主题思想:为了描写战斗,对勇者与恶龙设置特性,如名字,攻击力,防御力以及速度,运行游戏,出现打斗文字。使用方法:结果显示在输入框里2、主题作品的设计运行游戏后,勇者与恶龙轮流发动攻击,最后得出胜负。3、素材的导入或制作没有素材的导入4、关键的操作步骤(含主要代码)及技巧var hero:Object = new Object();var monster:Object = new Object();hero.name =

8、 勇者;hero.HP = 500;hero.ATT = 90;hero.DEF = 88;hero.AGI = 60;hero.skill1 = 普通攻击;hero.skill2 = 飞刃闪;hero.skill3 = 极光剑;monster.name = 恶龙;monster.HP = 1000;monster.ATT = 120;monster.DEF = 100;monster.AGI = 22;monster.skill1 = 攻击;monster.skill2 = 龙尾击;monster.skill3 = 毁灭光线;var timer:Timer = new Timer(1000)

9、;timer.addEventListener(TimerEvent.TIMER, round)timer.start();function whoAttacks(a:Object,b:Object):Arrayfunction round(e:TimerEvent):voidvar damage:Number;var skillIndex:uint;var roundFight:Array = whoAttacks(hero,monster);var attacker:Object = roundFight0;var defender:Object = roundFight1;if(dama

10、ge = 0)damage = 0;elsedamage = Math.ceil(damage);defender.HP -= damage;if(damage attacker.ATT / 3)skillIndex = 1;else if(damage attacker.ATT *2/ 3)skillIndex = 2;elseskillIndex = 3;trace(attacker.name + 向 + defender.name + 发动了+attackerskill+skillIndex + ,+ defender.name + 损失了 + damage + 点HP!);if(def

11、ender.HP = 0)trace(defender.name + 终于支持不住,倒下了!n+ attacker.name + 取得了胜利!);timer.removeEventListener(TimerEvent.TIMER, round);trace(nGame Over);return;trace(hero.name + HP: + hero.HP + t+ monster.name + HP: + monster.HP);五、 实验结果注:可用贴图的方式1、主要使用的知识点使用事件驱动编写AS3.0应用程序(物体移动等的动画效果)鼠标事件:CLICK、MOUSE_MOVE、MOUS

12、E_OVER、MOUSE_OUT、MOUSE_WHEEL等键盘事件:KeyboardEvent.KEY_DOWN(UP)等时间函数:TimerEvent.TIMER、TimerEvent.TIMER _COMPLETE2、作品的效果图(至少给出3个,含制作过程及结果)六、 实验总结注:包括制作过程中出现的问题,实验心得体会及改进意见等大体上了解到我们平常玩的回合游戏的制作过程,很有趣,我很喜欢这个。不过我想要是加上图片和效果的话,难度会提升很多。上海建桥学院实验报告课程名称: 互动媒体制作 实验类型: 设计型 实验项目名称: 找茬类事件点击类小游戏 实验地点: 多媒体机房 实验日期: 2021

13、 年 4 月 15 日一、 实验目的和要求1、 巩固AS3.0中核心类及显示对象的相关概念;2、 学会MovieClip类、Sprite类的创建及使用;3、 学会AS3.0中创建动画的几种方式;4、 能够熟练运用显示对象的属性;5、 能够熟练运用timer类创建动画(效果);6、 制作满足相应要求的交互动画;二、 实验内容和原理1、 确定内容健康的主题2、 相关素材的准备3、 制作交互动画的流程图(分镜头脚本)4、 运用Timer类控制显示对象的属性来制作交互动画三、 主要仪器设备或环境PC机;Flash cs5(或以上);Photoshop cs5(或以上);移动终端5套;数码照相机1台;数

14、码摄像机1台;数位板1个。四、 操作方法与实验步骤1、确定主题、设计流程图主题:找茬游戏设计流程图:2、游戏整体流程拆分游戏开始初始化:开始按钮定义、开始界面的设置、初始化数值游戏主题部分:添加三个文本框,一个计分数,一个倒计时,一个统计剩余几个错找到几个错。添加Timer时间监听,用来倒计时。对cuowumian、cuo1、cuo2、cuo3.、cuo4.、cuo5添加鼠标事件监听,MouseEvent.CLICK。游戏结束部分:移除游戏主体页面上所有东西,移除监听。根据找出的错的个数判断是否通关,并显示在名为tf的文本框里。添加一个Restart按钮,实现重玩的功能。3、三大游戏流程部分功

15、能实现游戏开始初始化、开始界面的设置;myStartView =new StartView();addChild(myStartView);myStartView.x = stage.stageWidth / 2;myStartView.y = stage.stageHeight / 2;游戏正式界面设置function gameStart()scoreField=new TextField();scoreFn();addChild(scoreField);myGameView=new GameView();addChild(myGameView);myGameView.x = stage.s

16、tageWidth / 2;myGameView.y = stage.stageHeight / 2;allTimer = 10;timer = new Timer(1000,20);timer.addEventListener(TimerEvent.TIMER,timerFn);timer.start();timeField=new TextField();timeField.autoSize = center;timeField.text = 你还有 + allTimer + 秒;timeField.x = 400;addChild(timeField);游戏结束function endG

17、ame()removeChild(myGameView);removeChild(scoreField);removeChild(timeField);tf=new TextField();tf.width = 300;if (score=5)tf.text = 恭喜你通关了;elsetf.text = 很遗憾,请大侠重新来过;var format:TextFormat = new TextFormat();format.font = _sans;format.color = 0xFF0000;format.size = 50;format.underline = true;tf.x=(sta

18、ge.stageWidth-tf.width )/2;tf.y=(stage.stageHeight-tf.height )/2;tf.autoSize = center;tf.defaultTextFormat = format;addChild(tf);myEndBt=new Button();addChild(myEndBt);myEndBt.label = Restart;myEndBt.x=(stage.stageWidth-myEndBt.width )/2;myEndBt.y = 300;myEndBt.addEventListener(MouseEvent.CLICK,rest

19、artFn);4、游戏主体部分操作步骤(含主要代码)及技巧var allScore:int = 5;var myStartBt:Button;var myStartView:StartView;var myGameView:GameView;var myEndBt:Button;var timer:Timer;var score:int;var scoreField:TextField;var tf:TextField;var allTimer:int;var timeField:TextField;init();/游戏开始初始化function init()/开始按钮定义myStartBt=

20、new Button ();addChild(myStartBt);myStartBt.x=(stage.stageWidth-myStartBt.width )/2;myStartBt.y = 300;myStartBt.label = Start;myStartBt.addEventListener(MouseEvent.CLICK,myStartBtFn);/开始界面的设置;myStartView =new StartView();addChild(myStartView);myStartView.x = stage.stageWidth / 2;myStartView.y = stag

21、e.stageHeight / 2;/数值初始化score = 0;function myStartBtFn(e:MouseEvent )removeChild(myStartBt);removeChild(myStartView);myStartBt.removeEventListener(MouseEvent.CLICK,myStartBtFn );gameStart();/游戏正式界面设置function gameStart()scoreField=new TextField();scoreFn();addChild(scoreField);myGameView=new GameView

22、();addChild(myGameView);myGameView.x = stage.stageWidth / 2;myGameView.y = stage.stageHeight / 2;allTimer = 10;timer = new Timer(1000,20);timer.addEventListener(TimerEvent.TIMER,timerFn);timer.start();timeField=new TextField();timeField.autoSize = center;timeField.text = 你还有 + allTimer + 秒;timeField

23、.x = 400;addChild(timeField);function timerFn(e:TimerEvent)allTimer-;timeField.text = 你还有 + allTimer + 秒;if (allTimerstage.stageWidth |this.xstage.stageHeight |this.ystage.stageWidth |this.xstage.stageHeight |this.y0) clear() public function fl_SetKeyPressed(event:KeyboardEvent):voidswitch (event.ke

24、yCode)case 38 :upPressed = true;break;case Keyboard.DOWN :downPressed = true;break;case Keyboard.LEFT :leftPressed = true;break;case Keyboard.RIGHT :rightPressed = true;break;public function fl_UnsetKeyPressed(event:KeyboardEvent):voidswitch (event.keyCode)case Keyboard.UP :upPressed = false;break;c

25、ase Keyboard.DOWN :downPressed = false;break;case Keyboard.LEFT :leftPressed = false;break;case Keyboard.RIGHT :rightPressed = false;break; public function clear()this.removeEventListener(Event.ENTER_FRAME, fl_MoveInDirectionOfKey);stage.removeEventListener(KeyboardEvent.KEY_DOWN, fl_SetKeyPressed);

26、stage.removeEventListener(KeyboardEvent.KEY_UP, fl_UnsetKeyPressed); public function changeBig()this.scaleX*=1.5;this.scaleY*=1.5;timer=new Timer(1000,3);timer.addEventListener(TimerEvent.TIMER,timerFn);timer.start(); public function timerFn(e:TimerEvent) changeSmall(); public function changeSmall()

27、this.scaleX/=1.5;this.scaleY/=1.5;timer.stop();timer.removeEventListener(TimerEvent.TIMER,timerFn); 随机自动出来的篮球代码:package public class Qiu extends MovieClip var QiuDirection:int =Math.floor(Math.random()*4)var xyDirection:int=0var speedXvar speedYvar temp:int=Math.floor(Math.random()*2)var num:Number=

28、1;public function Qiu() this.addEventListener(Event.ADDED_TO_STAGE,ADFn)this.addEventListener(Event.ENTER_FRAME,timeFn)xyDirection=(temp =0) ? 1:-1public function ADFn(e:Event)this.removeEventListener(Event.ADDED_TO_STAGE,ADFn)switch(QiuDirection)case 0:this.x=Math.random()*stage.stageWidththis.y=0t

29、his.speedX=Math.random()*4*xyDirectionthis.speedY=Math.random()*4breakcase 1:this.x=0this.y=Math.random()*stage.stageHeightthis.speedX=Math.random()*4this.speedY=Math.random()*4*xyDirectionbreakcase 2:this.x=Math.random()*stage.stageWidththis.y=stage.stageHeightthis.speedX=Math.random()*4*xyDirectio

30、nthis.speedY=Math.random()*(-4)breakcase 3:this.x=stage.stageWidththis.y=Math.random()*stage.stageHeightthis.speedX=Math.random()*(-4)this.speedY=Math.random()*4*xyDirectionbreakpublic function timeFn(e:Event)/*trace(this.parentgoal)*/if(this.hitTestObject(this.parentgoal)myClearAll();elsethis.x+=th

31、is.speedX*numthis.y+=this.speedY*numif(this.xstage.stageWidth |this.ystage.stageHeight)clear()public function myClearAll()this.parentclearALL()public function clear()this.removeEventListener(Event.ENTER_FRAME,timeFn)道具的代码:package public class Dao extends Qiu public function Dao() / constructor code/

32、override表示重写父类方法override public function myClearAll() this.parentgoal.changeBig()clear();/继承于Qiu,所以有clear()五、 实验结果注:可用贴图的方式1、素材外部调用的实现2、游戏主体部分功能实现(给出关键部分功能代码,含制作过程及结果)package public class Goal extends MovieClipvar upPressed:Boolean = false;var downPressed:Boolean = false;var leftPressed:Boolean = fa

33、lse;var rightPressed:Boolean = false;var timer:Timer;public function Goal()this.addEventListener(Event.ADDED_TO_STAGE,ADFn);public function ADFn(e:Event)this.removeEventListener(Event.ADDED_TO_STAGE,ADFn);this.addEventListener(Event.ENTER_FRAME, fl_MoveInDirectionOfKey);stage.addEventListener(Keyboa

34、rdEvent.KEY_DOWN, fl_SetKeyPressed);stage.addEventListener(KeyboardEvent.KEY_UP, fl_UnsetKeyPressed);public function fl_MoveInDirectionOfKey(event:Event)if (upPressed)this.y -= 5;if (downPressed)this.y += 5;if (leftPressed)this.x -= 5;if (rightPressed)this.x += 5;if(this.xstage.stageWidth |this.xsta

35、ge.stageHeight |this.y0) clear() public function fl_SetKeyPressed(event:KeyboardEvent):voidswitch (event.keyCode)case 38 :upPressed = true;break;case Keyboard.DOWN :downPressed = true;break;case Keyboard.LEFT :leftPressed = true;break;case Keyboard.RIGHT :rightPressed = true;break;public function fl_UnsetKeyPressed(event:KeyboardEvent):voidswitch (event.keyCode)case Keyboard.UP :upPressed = false;break;case Keyboard.DOWN :downPressed = false;break;case Keyboard.LEFT :leftPress

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!