function wormGame(t)
% Create a steerable (via mouse clicks) worm; t seconds between moves.
% The game ends when the head of the worm touches a wall.
% A proximity alert will sound when the worm head gets close to a wall.
% There is a sound effect at the end of the game.

% The worm is on a grid.
grid = 40;               % Grid size (width and height)
len = 20;                % Worm length in segments

% Set up the clickable figure
makeClickableFig(grid)
global click  % Global variable; variable click is accessible in another 
              % function that has the same global declaration.
              % click is vector of length 2 representing a position
              % (click(1),click(2))

% Sound effect parameters
minSoundDist= 10;
maxSoundDist= 1;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% DO NOT modify the code above %%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Sound data

% Example function calls.  Modify these calls if you have modified the
% subfunction headers below.
[gameSound,rate]= getAlertSoundData();
[endSound,rate] = getGameOverSoundData();







%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [gameSound, rate]= getAlertSoundData()
% gameSound the is the sound data as a 1-d array of values, each of type 
%   double in [-1,1].  This data is for the proximity alert.
% rate is the sampling rate.

% Implement this function.  OK to modify function header and comments.
gameSound=[]; rate=[];  % stubs (dummy assignments)


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [endSound,rate] = getGameOverSoundData()
% endSound the is the sound data as a 1-d array of values, each of type 
%   double in [-1,1].  This data is for the end of the game.
% rate is the sampling rate.

% Implement this function.  OK to modify function header and comments.
endSound=[]; rate=[];  % stubs (dummy assignments)

