Professional Documents
Culture Documents
1
// Please fill out these comments with the appropriate information.
// Name:Edward Blackwood
// Date: 8.7.14
/*
Perlenspiel is a scheme by Professor Moriarty (bmoriarty@wpi.edu).
Perlenspiel is Copyright 2009-14 Worcester Polytechnic Institute.
This file is part of Perlenspiel.
You may have received a copy of the GNU Lesser General Public License
along with Perlenspiel. If not, see <http://www.gnu.org/licenses/>.
*/
// The following comment lines are for JSLint. Don't remove them!
function GameStart()
{
//head
PS.color ( 16 , 5 , PS.COLOR_YELLOW ) ;
PS.color ( 16 , 6, PS.COLOR_YELLOW ) ;
PS.color ( 17 , 4, PS.COLOR_BLACK ) ;
PS.color ( 17 , 5, PS.COLOR_YELLOW ) ;
PS.color ( 17 , 6, PS.COLOR_YELLOW ) ;
PS.color ( 18 , 4, PS.COLOR_BLACK ) ;
PS.color ( 18 , 5, PS.COLOR_YELLOW ) ;
PS.color ( 19 , 5, PS.COLOR_YELLOW ) ;
PS.color ( 18 , 6, PS.COLOR_YELLOW ) ;
PS.color ( 19 , 6, PS.COLOR_YELLOW ) ;
PS.color ( 17 , 7, PS.COLOR_YELLOW ) ;
PS.color ( 18 , 7, PS.COLOR_YELLOW ) ;
PS.color ( 16 , 8, PS.COLOR_YELLOW ) ;
PS.color ( 17 , 8, PS.COLOR_YELLOW ) ;
//body
PS.color ( 15 , 8, PS.COLOR_YELLOW ) ;
PS.color ( 18 , 8, PS.COLOR_YELLOW ) ;
PS.color ( 19 , 8, PS.COLOR_YELLOW ) ;
PS.color ( 20 , 8, PS.COLOR_YELLOW ) ;
PS.color ( 14 , 8, PS.COLOR_YELLOW ) ;
PS.color ( 21 , 8, PS.COLOR_YELLOW ) ;
PS.color ( 14 , 9, PS.COLOR_YELLOW ) ;
PS.color ( 16 , 9, PS.COLOR_YELLOW ) ;
PS.color ( 17 , 9, PS.COLOR_YELLOW ) ;
PS.color ( 18 , 9, PS.COLOR_YELLOW ) ;
PS.color ( 19 , 9, PS.COLOR_YELLOW ) ;
PS.color ( 21 , 9, PS.COLOR_YELLOW ) ;
PS.color ( 14 , 10, PS.COLOR_YELLOW ) ;
PS.color ( 16 , 10, PS.COLOR_YELLOW ) ;
PS.color ( 17 , 10, PS.COLOR_YELLOW ) ;
PS.color ( 18 , 10, PS.COLOR_YELLOW ) ;
PS.color ( 19 , 10, PS.COLOR_YELLOW ) ;
PS.color ( 21 , 10, PS.COLOR_YELLOW ) ;
PS.color ( 14 , 11, PS.COLOR_YELLOW ) ;
PS.color ( 16 , 11, PS.COLOR_YELLOW ) ;
PS.color ( 17 , 11, PS.COLOR_YELLOW ) ;
PS.color ( 18 , 11, PS.COLOR_YELLOW ) ;
PS.color ( 19 , 11, PS.COLOR_YELLOW ) ;
PS.color ( 21 , 11, PS.COLOR_YELLOW ) ;
PS.color ( 14 , 12, PS.COLOR_YELLOW ) ;
PS.color ( 5, 11 , PS.COLOR_BLACK ) ;
PS.color ( 6, 11 , PS.COLOR_BLACK ) ;
PS.color ( 7, 11 , PS.COLOR_BLACK ) ;
PS.color ( 9, 11 , PS.COLOR_BLACK ) ;
PS.color ( 4, 12 , PS.COLOR_BLACK ) ;
PS.color ( 5, 12 , PS.COLOR_BLACK ) ;
PS.color ( 6, 12 , PS.COLOR_BLACK ) ;
PS.color ( 7, 12 , PS.COLOR_BLACK ) ;
PS.color ( 5, 7 , PS.COLOR_BLACK ) ;
PS.color ( 6, 7 , PS.COLOR_BLACK ) ;
//festive hat
PS.color ( 3 , 4 , PS.COLOR_RED );
PS.color ( 4 , 4 , PS.COLOR_RED );
PS.color ( 5 , 4 , PS.COLOR_RED );
PS.color ( 6 , 4 , PS.COLOR_RED );
PS.color ( 7 , 4 , PS.COLOR_RED );
PS.color ( 8 , 4 , PS.COLOR_RED );
PS.color ( 6 , 3 , PS.COLOR_RED );
PS.color ( 5 , 3 , PS.COLOR_RED );
//belt
PS.color ( 4 , 14 , PS.COLOR_RED );
PS.color ( 5 , 14 , PS.COLOR_RED );
PS.color ( 6 , 14 , PS.COLOR_RED );
PS.color ( 7 , 14 , PS.COLOR_RED );
//Reset Button
PS.glyph( 0, 31, "R");
PS.glyphColor(0, 31, PS.COLOR_BLACK);
PS.glyph(0, 13, "B");
PS.glyphColor(0, 13, PS.COLOR_BLACK);
}
function GameReset()
{
PS.init();
// All of the functions below MUST exist, or the engine will complain!
if(checkColor || checkSection)
{
if(x== 0 && y==13 || x== 25 && y==25 || x==25 && y==26 || x==24 && y==26)
{
PS.color(25, 25, PS.COLOR_WHITE);
PS.color(25, 26, PS.COLOR_WHITE);
}
if(x == 0 && y == 31)
{
GameReset();
}
}
PS.audioPlay("fx_click");
PS.debug("Selection " + x + ", " + y + " \n"); //Make sure to Uncomment Before turn in.
};
// Add code here for when the mouse button/touch is released over a bead
};
// Add code here for when the mouse cursor/touch enters a bead
};
// Add code here for when the mouse cursor/touch exits a bead
};
// PS.exitGrid ( options )
// Called when the mouse cursor/touch exits the grid perimeter
// It doesn't have to do anything
// [options] = an object with optional parameters; see documentation for details
// Add code here for when the mouse cursor/touch moves off the grid
};
PS.debug( "DOWN: key = " + key + ", shift = " + shift + "\n" );
"use strict";