1 / 17
文档名称:

2020年华容道小游戏.doc

格式:doc   大小:139KB   页数:17页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

2020年华容道小游戏.doc

上传人:非学无以广才 2020/2/21 文件大小:139 KB

下载得到文件列表

2020年华容道小游戏.doc

文档介绍

文档介绍:华容道小游戏基于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