下载此文档

2020年华容道小游戏.doc


文档分类:生活休闲 | 页数:约17页 举报非法文档有奖
1/17
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/17 下载此文档
文档列表 文档介绍
华容道小游戏基于GUI界面的华容道小游戏(横刀立马)效果图如下:实现5x4方格界面,初始化为华容道经典横刀立马局势(如下图)。人物用数字来表示,0代表空方格,1代表曹操,2代表黄忠,3代表张飞,4代表马超,5代表赵云,6代表关羽,7代表小兵。曹操占4个方格,黄忠、张飞、马超、赵云、关羽分别占2个方格,小兵占1个方格。游戏用鼠标玩,点击人物的任一方格后,该人物被选中,随后点击空方格,如果能够移动,则选中的人物移动到方格处。游戏的目标是曹操从最下面一行的中间走出,就算成功。游戏能够显示已完成步数。functionvarargout=untitled(varargin)%UNTITLEDMATLABcodefor%UNTITLED,byitself,createsanewUNTITLEDorraisestheexisting%singleton*.%%H=UNTITLEDreturnsthehandletoanewUNTITLEDorthehandleto%theexistingsingleton*.%%UNTITLED('CALLBACK',hObject,eventData,handles,...)callsthelocal%functionnamedCALLBACKinwiththegiveninputarguments.%%UNTITLED('Property','Value',...)createsanewUNTITLEDorraisesthe%existingsingleton*.Startingfromtheleft,propertyvaluepairsare%%unrecognizedpropertynameorinvalidvaluemakespropertyapplication%.%%*SeeGUIOptionsonGUIDE'"GUIallowsonlyone%instancetorun(singleton)".%%Seealso:GUIDE,GUIDATA,GUIHANDLES%Edittheabovetexttomodifytheresponsetohelpuntitled%LastModifiedbyGUIDE18-Jul-23:26:39%Begininitializationcode-DONOTEDITgui_Singleton=1;gui_State=struct('gui_Name',mfilename,...'gui_Singleton',gui_Singleton,...'',@,...'',@,...'',[],...'gui_Callback',[]);ifnargin&&ischar(varargin{1})=str2func(varargin{1});endifnargout[varargout{1:nargout}]=(gui_State,varargin{:});(gui_State,varargin{:});end%Endinitializationcode-DONOTEDIT%---Executesjustbeforeuntitledismadevisible.(hObject,eventdata,handles,varargin)%Thisfunctionhasnooutputargs,.%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%mandlineargumentstountitled(seeVARARGIN)%mandlineoutputforuntitled=hObject;%Updatehandlesstructureguidata(hObject,handles);%UIWAITmakesuntitledwaitforuserresponse(seeUIRESUME)%uiwait();%---=(hObject,eventdata,handles)%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%man

2020年华容道小游戏 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息