外文翻译 - 学习开发游戏中Java继承的概念_第1页
外文翻译 - 学习开发游戏中Java继承的概念_第2页
外文翻译 - 学习开发游戏中Java继承的概念_第3页
外文翻译 - 学习开发游戏中Java继承的概念_第4页
外文翻译 - 学习开发游戏中Java继承的概念_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

外文原文LearningtheConceptofJavaInheritanceinaGameJinghuaZhangElviraR.CaldwellEmanuelSmithDepartmentofComputerScienceWinston-SalemStateUniversityWinston-Salem,NCzhangji,;AbstractThispaperpresentsagame-likemoduletitledJavaNinjathatisdesignedtohelpstudentsunderstandtheconceptofInheritance,whichisoneofthemostimportantconceptsofObject-OrientedProgramming(OOP).ThismodulehasbeenusedandevaluatedintheCSC1311ComputerProgrammingIIclassduringspring2013atWinston-SalemStateUniversity.Thepre-test,post-testandsurveywereusedintheevaluationprocess.Theresultswerepromisingandthefeedbackfromstudentswasverypositive.Ourexperiencesshowthatthismodulehasapositiveimpactonlearningtheconceptsofinheritance.KeywordsOOP;Inheritance;Game-likemodule;Computerprogramming;I.INTRODUCTIONResearchshowsthatthefearofprogrammingisoneofthereasonswhystudentsdonotwanttomajorincomputerscience.Consideringthedeclinesmanyschoolshaveseenincomputerscienceenrollment,improvingstudentinclinationtowardsprogrammingcouldproduceabeneficialshift1.Manyinnovativeapproacheshavebeenproposedtoenhancestudentlearningincomputingcourses,suchasusingLEGOrobotics2andgames3-6,9-10,12-13.TheGame2LearnprojectatUNCCharlottehasbeenverysuccessfulinleveraginggamesinimprovingintroductorycomputingcourses7-8.Theeffortrequiredbyinstructorstointegrategamesintothecurriculumisusuallyquiteminimalasshowninthecasestudy11.Severalgame-likeinstructionalmoduleshavebeendevelopedandusedintheclassroomasasupplementaltooltoreinforceprogrammingconceptsourstudentsstrugglewithmost10,12,13.Studentfeedbackwasverypositiveandtheimpactonstudentlearningwasverypromising.Ourpreviousworkmotivedustocovermoreprogrammingconceptsinthegameplay.Manystudentshavehardtimesmasteringtheconceptofinheritance.Wedecidedtodevelopagame-likemoduletitledJavaNinjatoenhancethelearningofinheritanceinJava.Themodulecoversthesuperclassandsubclass,methodoverridingandthecorrectwaytousetheminprogramming.Thegamewillbestraightforwardenoughthatnon-gamersunderstandtheprocess.Themoduleprovidesrelevantfeedbackthroughoutthegamebasedontheplayersactions.Studentswilltakeatestbeforeandafterexposuretothegamemoduleinordertoquantifytheimpactofthemoduleonlearningandusingthetargetedconcepts.Allgamerelatedcodewouldbereadilyavailableforfutureresearchwiththehopethatmethodsutilizedmayberefinedandextendedwithfutureworks.Themoduleisintendedtobefunandentertainingyetholdssomeinstructionalvalue.Themodulecanbeusedasasupplementaltoolforreinforcingtheconceptsofinheritance.Thispaperdescribesthedesignandimplementationofthisgame-likeinstructionalmoduleinsectionII.SectionIIIpresentstheevaluationresults.TheconclusionandfutureworkareincludedinsectionIV.I.GAMEDESIGNANDIMPLEMENTATIONTheJavaNinjawasdevelopedinGameMakerStudio,agamedevelopmentenvironmentthatallowsdeveloperstocreategamesfasterthroughdrag-and-dropfeaturesandGMLscriptinglanguage.ThisgamemodulewasdevelopedbythegamedevelopmentgroupinthedepartmentofcomputerscienceatWSSU.Thegroupconsistsofthreeprogrammersandtwoartists.Ittookaboutfourmonthstocreatetheprototypeforthegame.A.PremiseInamysteriousland,aninjavillageholdsthepowerofthemagicCrystal,apowerfulgemthatgivestheplayertheabilitytocreatespecializedninjas.Theninjascanusethispowertoprotecttheland.However,arivalsamuraiclanwantstousethatpowertoconquertheland.Therefore,onedaythesamuraiclanlaunchesamassiveattackagainsttheninjavillage.TheninjasmuststopthemfromtakingtheCrystal.Theplayerneedstofighttheenemiesandobtainthepowerbook.ThepowerbooksareusedtocreatesubclassessuchaWaterNinjaoraFireNinja.Alltypesofninjaswillworktogethertodefeatthesamurai,obtainthemagicCrystalandprotectthevillage.Fig.1showsoneofthegamescenes.B.GuidedTutorialThegamemodulestartedwithashortstep-bysteptutorialtohelptheplayerlearnthecontrolsforthegameandinheritancerelatedconcepts.Thetutorialmakesplayersespeciallynongamerscomfortablewiththegameplay.Theplayerobtainsallthetrainingneededtosucceedinthegame.Theplayerwillreviewandlearntheinheritancerelatedconceptsthroughinteractivelearning.Theplayerwillbeguidedthroughthetutorialandlearnhowtocreatesubclasses,understandandusethepublicmembersdefinedinthesuperclassandmethodoverriding.Noheavycodingwasrequired;mosttaskscanbeachievedthroughdraganddroporbyprovidingtherequiredkeywords.UMLisusedtoshowtherelationshipsbetweenthesubclassandsuperclass.Anoptionisprovidedtohide/showtheUMLoftheclasses.ThetrainedninjawillmoveforwardthroughthegreentunneltothebattlefieldtoprotectthevillageasshowninFig.2.TheplayerneedstogothroughseveralspellgatesafterthetrainingasshowninFig.3.EachspellgatewilltestontheconceptslearnedinthegameasshowninFig.4.Thegatewillopeniftheplayeranswersthequestioncorrectly.Iftheansweriswrong,relevantfeedbackwillbeprovidedtohelptheplayertocorrectit.C.CreatingsubclassesThissectionfocusesonhowtocreateasubclassfromasuperclass.FireNinjaandWaterNinjawillbecreatedtoaddressdifferentsituations.TheybotharederivedfromthebaseclassNinja.Fig.5showsanexampleofhowtocreatetheFireNinja.TheWaterNinjacanbecreatedinthesameway.Fig.6showsinstancesoftheFireNinjaandtheWaterNinja.TherelationshipbetweenthesubclassFireNinja/WaterNinjaandsuperclassNinjacanbeseenintheUMLdiagraminFig.7.D.Inheritingnon-privatemembersAsubclasscaninheritthepublicandprotectedmembersofthesuperclass.BoththeFireNinjaandWaterNinjacanusethetwopublicmethods(follow()andstand()definedinthesuperclassNinja.Thestudentplayerswillneedtoknowtousethefollow()methoddefinedintheNinjaclasswhentheFireNinjaortheWaterNinjaisfollowingtheplayer.E.MethodOverridingInthissection,methodoverridingispresented.BoththeFireNinjaandWaterNinjaaregoingtocreatetheirownversionoftheattack()method.Theattack()methoddefinedintheFireNinjawillhavethepowertosetafire.Howevertheattack()methoddefinedintheWaterNinjawillbeabletoputoutafire.InthesituationshowninFig.8,theonlywaytocleartheroadistoreceivehelpfromtheFireNinja.TheWaterNinjacanusethewaterattacktosavethesituationshowninFig.9.TheUMLpresentedinFig.7showsthatboththeFireNinjaandWaterNinjahavetheirownversionoftheattack()method.F.ReinforcingtheconceptswithmoregameplayTheaboveinheritanceconceptsarereinforcedindifferentgameplaysandindifferentforms.Forexample,eachgatetheplayerneedstopassisadifferentclassandeachisinheritedfromanabstractgateclass.II.EVALUATIONThismodulewasusedintheCSC1311ComputerProgrammingIIclassduringSpring2013.Studentswerelecturedontheconceptofinheritancebythesameinstructor.Forimpactevaluation,studentstookapre-testafewdaysbeforeplayingthegamemoduleandwereadministeredaposttestafewdaysafterthegameplay.Thesamequizwasusedasthepre-testandpost-test.Thetestquestionsweredirectlyfromthetextbook.Additionallyasurveywasgiventoprovidequalitativeresultstosupportthequantitativeanalysis.Thesamegroupofstudentstookthepre-testandpost-test.Thetestgroupwasfairlysmallwithfourteenparticipantsandmostofthestudentswereminorities.ThetestquestionsarelistedinTableI.A.Pre-Testvs.Post-TestThepre-testandpost-testquestionswereexactlythesame.Thetestincludedfivequestionsandeachwasworthtwentypoints.Fourteenstudentstookboththepre-testandpost-test.Onthepre-test,only50%ofstudentsmanagedtoachievegradesof60orabove.Thepre-testresultsindicatedthatourstudentsneededhelpontheconceptofinheritance.Wearegladtoreportthatthepost-testresultdidindicatesomeimprovementsofstudentsperformance.Thepercentageofstudentswhoreachedthepassinggrademark(60)is71%.Theaveragescoreforthepost-testwasabout25%higherthanthepre-testaverage.Fig.10showsthepre-testandpost-testquestion-by-questioncomparison.TheY-axisshowsthenumberofstudentswhoansweredeachquestioncorrectly.AspresentedinFig.10,morestudentsansweredquestions#2,#3,and#4correctlyinthepost-testcomparedtothepre-test.Itseemsthatthemoduledidnothaveanyimpactonthestudentsperformanceonquestions#1and#5.Thecorrectrateforquestion#1onthepre-testissomewhathigh,thereforeitisreasonabletoseenofurtherimprovementinthepost-test.However,forquestion#5,wedidnotacquiretheexpectedimprovement.Eventhoughtheconceptsofthemethodoverridinghavebeencoveredandimplementedtwiceinthegame(attack()methodintheWaterNinjaandFireNinja),thespecificconceptthatfunctionswithdifferentparametertypesdonotoverridetheirparentfunctionswasnotcovered.Wewillintegratethisfeatureinourfuturegamemodule.Wewerepleasedwiththeimprovementsstudentsmadeonquestions#2,#3and#4.Theimprovementsonthesequestionsindicatedthatstudentsbetterunderstoodsubclassesandtherelationshipbetweensuperclassesandsubclasses.B.StudentFeedbackAsurveywasconductedtocollectfeedback/commentsfromthestudents.Tenstudentscompletedthesurveyonline.Theoverallstudentfeedbackwaspositivewiththemajorityofquestionsreceivingveryhighratings.Thesurveyconsistedofninemultiple-choicequestionsandoneopen-endedquestion.Thesurveyusedalikertscale;StronglyAgree,Agree,Neutral,DisagreeandStronglyDisagree.TableIIsummarizesthesurveyresults.Wearepleasedthatallthestudentsenjoyedplayingthegameandwantedtoseemoreconceptscoveredusingthislearningstyle.Accordingtothesurvey,moststudentsfeltthisgame-likeinstructionalmodulehelpedthemunderstandtheconceptsrelatedtoinheritancebetter.Additionalcommentsmadebystudentsontheopen-endedquestionswereverypositive.Wearedelightedthatallthestudentsenjoyedplayingthegameandlearningfromagamemodule.Somestudentsbecameexcitedaboutcomputerscienceandevenwanttojointhegamedevelopmentgrouptolearnmore.III.CONCLUSIONSANDFUTUREWORKSTheresultsofthisinnovationwerepromisingwithmoststudentsshowingsignificantimprovement.Thepercentageofstudentswhoreachedthepassinggrade(60)markintheposttestwas21%higherthanthepre-test.Basedonthequestionby-questioncomparison,thenumberofstudentswhoansweredthequestionscorrectlyincreasedinthepost-test.Allstudentsratedthegamemodulepositivelyonthefollowing:EnjoyabletoplayProviderelevantfeedbackWouldliketoseemoreconceptscoveredthiswayWouldrecommendtoothersBasedonsuchpositiveresponses,studentsobviouslyareinterestedinfurtherdevelopmentofsuchlearningmodules.Integratinginteractivelearningintothecomputersciencecurriculumappearstobeabeneficialendeavorforstudents.Thisgame-likelearningmodulewillberefinedbasedonthefeedbacksfromstudentsandreviewcommentsmadebytheprojectadvisoryboardmembers.Itwillbeexpandedtocovermoreobjectorientedprogrammingconceptssuchaspolymorphism.TherefinedmodulewillbeusedintheupcomingsemestersasalearningcomponentinComputerProgrammingIIclasses.TheJavaNinjawillbemadeavailableontheprojectwebsiteforinstructorsandstudentsatotherinstitutions.ManythanksgotothegamedevelopmentgroupatWSSUfortheircontributionstothispaper.中文翻译学习开发游戏中Java继承的概念摘要本文介绍了一种游戏般的模块名为Java的忍者,旨在帮助学生理解继承,这是面向对象编程(OOP)的最重要的概念之一的概念。该模块已被使用,在温斯顿-塞勒姆州立大学2013年春季期间,评估在CSC1311计算机程序设计类。前测,后测和调查评价process.The结果被用来为前途,从学生的反馈是非常积极的。我们的经验表明,这种模块对学习继承的概念产生了积极影响。关键词:面向对象;继承;游戏般的模块;计算机编程;引言研究表明,编程的恐惧就是为什么学生不希望主修计算机科学的原因之一。考虑到很多学校已经看到了计算机科学入学的跌势,提高学生对编程的倾向可能会产生一个有益的转变。已经提出了许多创新的方法,以提高学生学习计算的课程,比如用乐高机器人和游戏。在北卡罗来纳大学夏洛特Game2Learn项目已经非常成功地利用游戏中提高计算入门课程。由导师所需要的努力,游戏融入课程通常很轻微,因为显示在案例研究。一些类似游戏的教学模块已经开发并在课堂上作为辅助工具来强化编程概念的学生奋斗与大多数。学生的反馈是非常积极的,对学生学习的影响是非常有前途的。我们以前的工作motived我们覆盖了更多的游戏编程概念。许多学生有困难的时候掌握继承的概念。我们决定开发一个类似游戏的模块名为Java的忍者,以提高继承了Java的学习。该模块覆盖了超类和子类,方法重载,并使用他们在编程的正确方法。本场比赛将是足够直截了当,非游戏玩家理解的过程。该模块提供整个相关反馈基于玩家的动作游戏。学生将需要测试曝光到游戏模块之前和之后,以量化模块的学习和使用对象的概念的影响。所有游戏相关的代码将是现成的,希望使用的方法可以完善和扩大与将来的工作将来的研究。该模块是为了好玩和有趣又保持一定的指导价值。该模块可以作为一个补充工具用于增强继承的概念。本文介绍了这个游戏,就像在第二节教学模块的设计和实现。第三节介绍了评价结果。结论和未来的工作都包括在第四节。一、游戏设计与实现Java的忍者是在游戏制作工作室,游戏开发环境,使开发人员能够更快地创建游戏,通过拖动和拖放功能和GML脚本语言开发的。这个游戏模块是由计算机科学WSSU部门的游戏开发小组开发。该小组由三个程序员和两位艺术家。花了约四个月来创建原型来进行游戏。A.前提在一片神秘的土地,一个忍者村持有的魔晶,一个强大的宝石,让玩家建立专门的忍者能力的力量。忍者可以使用这项权力,以保护土地。然而,对手武士战队要使用该权力征服的土地。所以,有一天,武士家族推出针对忍者村大举进攻。忍者必须采取的水晶阻止他们。玩家需要对抗的敌人,并获得功率的书。电源书用于创建子类这样的WaterNinja或FireNinja。所有类型的忍者将携手打败日本武士,获得魔晶,保护村庄。B.指导教程游戏模块开始用短一步一步的教程,以帮助玩家学习控制的游戏和继承相关的概念。本教程使球员,尤其是nongamers舒适的游戏体验。玩家获得的所有的游戏。玩家成功所需的培训将通过互动学习回顾和学习继承相关的概念。玩家将通过本教程的指导和学习如何创建子类,理解和使用的超类方法重载定义的公共成员。没有沉重的编码是必需的;大多数的任务可以通过拖放或者通过提供所需要的关键字来实现。UML是用来显示子类和父类之间的关系。提供隐藏/选项显示类的UML。玩家需要如图培训后要经过几个咒语门。各拼栅极将测试对在游戏中了解到。如果玩家正确回答问题的大门将打开。如果答案是错的,相关的反馈将被用来帮助玩家解决it.C.创建子类本节将重点介绍如何从超类创建一个子类。FireNinja和WaterNinja将被创建,以满足不同的情况。他们俩都来源于基类忍者。该WaterNinja可以以同样的方式被创建。D.继承非私有成员子类可以继承父类的public和protected成员。无论是FireNinja和WaterNinja可以使用两个公共方法(遵循()和待机()在超类中定义的忍者。学生玩家需要知道使用如下()方法中的忍者类中定义的FireNinja或WaterNinja是继player.E时。方法重载在本节中,压倒一切的方法提出。无论是FireNinja和WaterNinja要创建他们自己的版本的攻击()方法。在FireNinja定义的攻击()方法,就必须设置一个fire.However在WaterNinja定义的攻击()方法就可以扑灭火灾的能力。在图中所示的情况。问路的唯一途径是从FireNinja得到帮助。例如,每个门玩家需要通过为不同

温馨提示

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

评论

0/150

提交评论