matlab_snake/snek_editor_help.m

90 lines
6.7 KiB
Matlab

function snek_editor_help()
scrsz = get(0,'ScreenSize');
helpwin = figure('ToolBar','none','Name','SNEK Editor Help',...
'NumberTitle','off','MenuBar','none',...
'Resize','off','Visible','off','Color',[170 255 211]/255,...
'Position',[scrsz(3)/8,scrsz(4)/8,min(scrsz(3:4)/1.2),min(scrsz(3:4)/1.5)]);
tgroup = uitabgroup('Parent', helpwin);
tab1 = uitab('Parent', tgroup, 'Title', 'Introduction');
tab1_text = uicontrol('Style','text','Units','Normalized','Position',[0 0 1 1],'FontSize',10,'Parent',tab1);
tab2 = uitab('Parent', tgroup, 'Title', 'Map Packs');
tab2_text = uicontrol('Style','text','Units','Normalized','Position',[0 0 1 1],'FontSize',10,'Parent',tab2);
tab3 = uitab('Parent', tgroup, 'Title', 'Backups and Rolling Back');
tab3_text = uicontrol('Style','text','Units','Normalized','Position',[0 0 1 1],'FontSize',10,'Parent',tab3);
tab4 = uitab('Parent', tgroup, 'Title', 'Map Listings');
tab4_text = uicontrol('Style','text','Units','Normalized','Position',[0 0 1 1],'FontSize',10,'Parent',tab4);
tab5 = uitab('Parent', tgroup, 'Title', 'Map Editing');
tab5_text = uicontrol('Style','text','Units','Normalized','Position',[0 0 1 1],'FontSize',10,'Parent',tab5);
tab6 = uitab('Parent', tgroup, 'Title', 'Player Editing');
tab6_text = uicontrol('Style','text','Units','Normalized','Position',[0 0 1 1],'FontSize',10,'Parent',tab6);
intro_text = { 'This editor and help is created by EN YI','',...
'Hello! Welcome to the SNEK map editor!',...
'This editor allows you to create maps for the snake game for MATLAB created by me.',...
'You can use the tabs to navigate to the section you want help on.','',...
'By having the editor, you also have the source code yourself.',...
'So, you may modify the code to your heart delights',...
'Just remember to credit me for the original code','',...
'Please report any problems with the editor to me',...
'Please also state the method to replicate the error',...
'Any suggestions/improvements are also welcomed, unless otherwise stated ','',...
'You can contact me by emailing to randomsity1@gmail.com',...
'Happy editing!','','',...
'Credits: ',...
'Mathworks for creating MATLAB',...
'and Google for most of my MATLAB problems'};
map_pack_text = { 'By default, you should have a file called "mazemap.mat".',...
'That is the default file the snake game will load.','',...
'When first opened, the editor will look empty as no file is loaded.',...
'Press the "Change Map Pack" on the top to load a map pack.',...
'When a pack is loaded, two extra files is created.',...
'backup_<filename> and old_<filemap>',...
'Make sure you have the files in the same directory as the editor','',...
'You may also press on the "New Map Pack" on the top to create a new pack pack',...
'A list will show you names of other mat files so you don''t replace them when creating a new file',...
'Enter the new file name and press okay.',...
'On the top right corner is the pack name. You can rename this anytime.',...
'The new name will be used the next time you save.'};
map_file_text = { 'There is two files when you load a file:',...
'backup_<filename> and old_<filemap>',...
'Both will allow you to roll back changes you made to your map pack','',...
'backup_<filename> will revert changes to the last time you saved',...
'You can do so by pressing the "Reset changes" button at the bootom left corner','',...
'old_<filemap> will revert changes to the moment you opened the editor',...
'You have to load this yourself with the "Change Map Pack" button','',...
'Keep these in mind when trying to reset any changes'};
map_list_text = { 'Below the pack name shows all the maps contained within the pack.','',...
'Click on one of the map name to display the map','',...
'Press on the UP and DOWN buttons to sort the order of the map up and down respectively','',...
'Press on the "New" button to add a new map at the end of the list','',...
'Press on the "Delete" button to delete the selected map','',...
'Press on the "Save" button to save ALL changes in the map pack','',...
'You may edit the map name, which is below the "Save button"','',...
'Changes are applied once you click out of the box'};
map_edit_text = { 'The current map is displayed next to the map list',...
'You can change the map name, width, and height in their respective boxes','',...
'Left click to add a tile. Right Click to remove a tile','',...
'Middle click to add a "nospawn" tile, where fruits cannot spawn in',...
'They look slightly less black','',...
'You can drag along the map to continuously add/remove tile',...
'You cannot draw tiles over the snake','',...
'You can also resize the map, by edit its width and height',...
'Note that any tiles outside of the map wil be removed when resizing.','',...
'Below the width and height boxes shows the coordinates of the mouse on the map.'};
player_edit_text = {'The speed slider changes the speed of the snake in this map, from 1 to 25','',...
'Click on the "Redefine player position" button to edit the snake starting position',...
'This works just like adding tiles, but you must make sure the snake is continuous.',...
'The red tiles indicate the snake''s head','',...
'Click on the "Redefine player position" button again to stop edit the player position','',...
'The "Red","Green","Blue" sliders adjust the colour of the snake''s body','',...
'Click on the "Reset Colour" to restore the snake to its default colour','',...
'Click on the "Reset Speed" to reset the speed of the snake',''};
set(tab1_text,'String',intro_text);
set(tab2_text,'String',map_pack_text);
set(tab3_text,'String',map_file_text);
set(tab4_text,'String',map_list_text);
set(tab5_text,'String',map_edit_text);
set(tab6_text,'String',player_edit_text);
set(helpwin,'Visible','on');
end