From: Joe Wreschnig Date: Tue, 30 Apr 2013 09:53:31 +0000 (+0200) Subject: Initial import of LD26 released version. X-Git-Url: https://git.yukkurigames.com/?a=commitdiff_plain;h=9f2a8e31beb1059c19c1fa5c683e18f13f962e12;p=123456789.git Initial import of LD26 released version. --- 9f2a8e31beb1059c19c1fa5c683e18f13f962e12 diff --git a/LGPL-3 b/LGPL-3 new file mode 100644 index 0000000..65c5ca8 --- /dev/null +++ b/LGPL-3 @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/audio/fx_click.mp3 b/audio/fx_click.mp3 new file mode 100644 index 0000000..48851b3 Binary files /dev/null and b/audio/fx_click.mp3 differ diff --git a/audio/fx_click.ogg b/audio/fx_click.ogg new file mode 100644 index 0000000..879f863 Binary files /dev/null and b/audio/fx_click.ogg differ diff --git a/audio/fx_click.wav b/audio/fx_click.wav new file mode 100644 index 0000000..bb187ee Binary files /dev/null and b/audio/fx_click.wav differ diff --git a/audio/perc_hihat_closed.mp3 b/audio/perc_hihat_closed.mp3 new file mode 100644 index 0000000..045a627 Binary files /dev/null and b/audio/perc_hihat_closed.mp3 differ diff --git a/audio/perc_hihat_closed.ogg b/audio/perc_hihat_closed.ogg new file mode 100644 index 0000000..8f5b6ee Binary files /dev/null and b/audio/perc_hihat_closed.ogg differ diff --git a/audio/perc_hihat_closed.wav b/audio/perc_hihat_closed.wav new file mode 100644 index 0000000..46cecc8 Binary files /dev/null and b/audio/perc_hihat_closed.wav differ diff --git a/audio/xylo_a4.mp3 b/audio/xylo_a4.mp3 new file mode 100644 index 0000000..085b64c Binary files /dev/null and b/audio/xylo_a4.mp3 differ diff --git a/audio/xylo_a4.ogg b/audio/xylo_a4.ogg new file mode 100644 index 0000000..175bf48 Binary files /dev/null and b/audio/xylo_a4.ogg differ diff --git a/audio/xylo_a4.wav b/audio/xylo_a4.wav new file mode 100644 index 0000000..41ae97b Binary files /dev/null and b/audio/xylo_a4.wav differ diff --git a/audio/xylo_a5.mp3 b/audio/xylo_a5.mp3 new file mode 100644 index 0000000..479d20e Binary files /dev/null and b/audio/xylo_a5.mp3 differ diff --git a/audio/xylo_a5.ogg b/audio/xylo_a5.ogg new file mode 100644 index 0000000..86315a4 Binary files /dev/null and b/audio/xylo_a5.ogg differ diff --git a/audio/xylo_a5.wav b/audio/xylo_a5.wav new file mode 100644 index 0000000..dd2b0d0 Binary files /dev/null and b/audio/xylo_a5.wav differ diff --git a/audio/xylo_a6.mp3 b/audio/xylo_a6.mp3 new file mode 100644 index 0000000..8afe2a9 Binary files /dev/null and b/audio/xylo_a6.mp3 differ diff --git a/audio/xylo_a6.ogg b/audio/xylo_a6.ogg new file mode 100644 index 0000000..b398342 Binary files /dev/null and b/audio/xylo_a6.ogg differ diff --git a/audio/xylo_a6.wav b/audio/xylo_a6.wav new file mode 100644 index 0000000..8ba34d5 Binary files /dev/null and b/audio/xylo_a6.wav differ diff --git a/audio/xylo_a7.mp3 b/audio/xylo_a7.mp3 new file mode 100644 index 0000000..99c7587 Binary files /dev/null and b/audio/xylo_a7.mp3 differ diff --git a/audio/xylo_a7.ogg b/audio/xylo_a7.ogg new file mode 100644 index 0000000..1000418 Binary files /dev/null and b/audio/xylo_a7.ogg differ diff --git a/audio/xylo_a7.wav b/audio/xylo_a7.wav new file mode 100644 index 0000000..f32388f Binary files /dev/null and b/audio/xylo_a7.wav differ diff --git a/audio/xylo_ab4.mp3 b/audio/xylo_ab4.mp3 new file mode 100644 index 0000000..198e2a2 Binary files /dev/null and b/audio/xylo_ab4.mp3 differ diff --git a/audio/xylo_ab4.ogg b/audio/xylo_ab4.ogg new file mode 100644 index 0000000..bce9948 Binary files /dev/null and b/audio/xylo_ab4.ogg differ diff --git a/audio/xylo_ab4.wav b/audio/xylo_ab4.wav new file mode 100644 index 0000000..37f42a3 Binary files /dev/null and b/audio/xylo_ab4.wav differ diff --git a/audio/xylo_ab5.mp3 b/audio/xylo_ab5.mp3 new file mode 100644 index 0000000..f6b4c1e Binary files /dev/null and b/audio/xylo_ab5.mp3 differ diff --git a/audio/xylo_ab5.ogg b/audio/xylo_ab5.ogg new file mode 100644 index 0000000..b90d710 Binary files /dev/null and b/audio/xylo_ab5.ogg differ diff --git a/audio/xylo_ab5.wav b/audio/xylo_ab5.wav new file mode 100644 index 0000000..bee1a93 Binary files /dev/null and b/audio/xylo_ab5.wav differ diff --git a/audio/xylo_ab6.mp3 b/audio/xylo_ab6.mp3 new file mode 100644 index 0000000..7e80a04 Binary files /dev/null and b/audio/xylo_ab6.mp3 differ diff --git a/audio/xylo_ab6.ogg b/audio/xylo_ab6.ogg new file mode 100644 index 0000000..3885dc8 Binary files /dev/null and b/audio/xylo_ab6.ogg differ diff --git a/audio/xylo_ab6.wav b/audio/xylo_ab6.wav new file mode 100644 index 0000000..287608b Binary files /dev/null and b/audio/xylo_ab6.wav differ diff --git a/audio/xylo_ab7.mp3 b/audio/xylo_ab7.mp3 new file mode 100644 index 0000000..c655d9e Binary files /dev/null and b/audio/xylo_ab7.mp3 differ diff --git a/audio/xylo_ab7.ogg b/audio/xylo_ab7.ogg new file mode 100644 index 0000000..d800d55 Binary files /dev/null and b/audio/xylo_ab7.ogg differ diff --git a/audio/xylo_ab7.wav b/audio/xylo_ab7.wav new file mode 100644 index 0000000..8f8d956 Binary files /dev/null and b/audio/xylo_ab7.wav differ diff --git a/audio/xylo_b4.mp3 b/audio/xylo_b4.mp3 new file mode 100644 index 0000000..bc959ab Binary files /dev/null and b/audio/xylo_b4.mp3 differ diff --git a/audio/xylo_b4.ogg b/audio/xylo_b4.ogg new file mode 100644 index 0000000..1ad3d52 Binary files /dev/null and b/audio/xylo_b4.ogg differ diff --git a/audio/xylo_b4.wav b/audio/xylo_b4.wav new file mode 100644 index 0000000..b6e499a Binary files /dev/null and b/audio/xylo_b4.wav differ diff --git a/audio/xylo_b5.mp3 b/audio/xylo_b5.mp3 new file mode 100644 index 0000000..12e896f Binary files /dev/null and b/audio/xylo_b5.mp3 differ diff --git a/audio/xylo_b5.ogg b/audio/xylo_b5.ogg new file mode 100644 index 0000000..63c847e Binary files /dev/null and b/audio/xylo_b5.ogg differ diff --git a/audio/xylo_b5.wav b/audio/xylo_b5.wav new file mode 100644 index 0000000..ac1ce38 Binary files /dev/null and b/audio/xylo_b5.wav differ diff --git a/audio/xylo_b6.mp3 b/audio/xylo_b6.mp3 new file mode 100644 index 0000000..19d5661 Binary files /dev/null and b/audio/xylo_b6.mp3 differ diff --git a/audio/xylo_b6.ogg b/audio/xylo_b6.ogg new file mode 100644 index 0000000..2491ab6 Binary files /dev/null and b/audio/xylo_b6.ogg differ diff --git a/audio/xylo_b6.wav b/audio/xylo_b6.wav new file mode 100644 index 0000000..b9589c9 Binary files /dev/null and b/audio/xylo_b6.wav differ diff --git a/audio/xylo_b7.mp3 b/audio/xylo_b7.mp3 new file mode 100644 index 0000000..3d871d6 Binary files /dev/null and b/audio/xylo_b7.mp3 differ diff --git a/audio/xylo_b7.ogg b/audio/xylo_b7.ogg new file mode 100644 index 0000000..7795810 Binary files /dev/null and b/audio/xylo_b7.ogg differ diff --git a/audio/xylo_b7.wav b/audio/xylo_b7.wav new file mode 100644 index 0000000..e7212af Binary files /dev/null and b/audio/xylo_b7.wav differ diff --git a/audio/xylo_bb4.mp3 b/audio/xylo_bb4.mp3 new file mode 100644 index 0000000..f6216ff Binary files /dev/null and b/audio/xylo_bb4.mp3 differ diff --git a/audio/xylo_bb4.ogg b/audio/xylo_bb4.ogg new file mode 100644 index 0000000..2d7ee7f Binary files /dev/null and b/audio/xylo_bb4.ogg differ diff --git a/audio/xylo_bb4.wav b/audio/xylo_bb4.wav new file mode 100644 index 0000000..6b181f0 Binary files /dev/null and b/audio/xylo_bb4.wav differ diff --git a/audio/xylo_bb5.mp3 b/audio/xylo_bb5.mp3 new file mode 100644 index 0000000..714a941 Binary files /dev/null and b/audio/xylo_bb5.mp3 differ diff --git a/audio/xylo_bb5.ogg b/audio/xylo_bb5.ogg new file mode 100644 index 0000000..4d1160c Binary files /dev/null and b/audio/xylo_bb5.ogg differ diff --git a/audio/xylo_bb5.wav b/audio/xylo_bb5.wav new file mode 100644 index 0000000..e8b363c Binary files /dev/null and b/audio/xylo_bb5.wav differ diff --git a/audio/xylo_bb6.mp3 b/audio/xylo_bb6.mp3 new file mode 100644 index 0000000..eb06976 Binary files /dev/null and b/audio/xylo_bb6.mp3 differ diff --git a/audio/xylo_bb6.ogg b/audio/xylo_bb6.ogg new file mode 100644 index 0000000..0d7dad9 Binary files /dev/null and b/audio/xylo_bb6.ogg differ diff --git a/audio/xylo_bb6.wav b/audio/xylo_bb6.wav new file mode 100644 index 0000000..801d667 Binary files /dev/null and b/audio/xylo_bb6.wav differ diff --git a/audio/xylo_bb7.mp3 b/audio/xylo_bb7.mp3 new file mode 100644 index 0000000..1a76124 Binary files /dev/null and b/audio/xylo_bb7.mp3 differ diff --git a/audio/xylo_bb7.ogg b/audio/xylo_bb7.ogg new file mode 100644 index 0000000..dc2c2f7 Binary files /dev/null and b/audio/xylo_bb7.ogg differ diff --git a/audio/xylo_bb7.wav b/audio/xylo_bb7.wav new file mode 100644 index 0000000..0ca4584 Binary files /dev/null and b/audio/xylo_bb7.wav differ diff --git a/audio/xylo_c5.mp3 b/audio/xylo_c5.mp3 new file mode 100644 index 0000000..241c3df Binary files /dev/null and b/audio/xylo_c5.mp3 differ diff --git a/audio/xylo_c5.ogg b/audio/xylo_c5.ogg new file mode 100644 index 0000000..0675083 Binary files /dev/null and b/audio/xylo_c5.ogg differ diff --git a/audio/xylo_c5.wav b/audio/xylo_c5.wav new file mode 100644 index 0000000..f37e1be Binary files /dev/null and b/audio/xylo_c5.wav differ diff --git a/audio/xylo_c6.mp3 b/audio/xylo_c6.mp3 new file mode 100644 index 0000000..6385256 Binary files /dev/null and b/audio/xylo_c6.mp3 differ diff --git a/audio/xylo_c6.ogg b/audio/xylo_c6.ogg new file mode 100644 index 0000000..27a1dda Binary files /dev/null and b/audio/xylo_c6.ogg differ diff --git a/audio/xylo_c6.wav b/audio/xylo_c6.wav new file mode 100644 index 0000000..5495416 Binary files /dev/null and b/audio/xylo_c6.wav differ diff --git a/audio/xylo_c7.mp3 b/audio/xylo_c7.mp3 new file mode 100644 index 0000000..bfba977 Binary files /dev/null and b/audio/xylo_c7.mp3 differ diff --git a/audio/xylo_c7.ogg b/audio/xylo_c7.ogg new file mode 100644 index 0000000..9b4fa01 Binary files /dev/null and b/audio/xylo_c7.ogg differ diff --git a/audio/xylo_c7.wav b/audio/xylo_c7.wav new file mode 100644 index 0000000..fe6daee Binary files /dev/null and b/audio/xylo_c7.wav differ diff --git a/audio/xylo_c8.mp3 b/audio/xylo_c8.mp3 new file mode 100644 index 0000000..51cf923 Binary files /dev/null and b/audio/xylo_c8.mp3 differ diff --git a/audio/xylo_c8.ogg b/audio/xylo_c8.ogg new file mode 100644 index 0000000..3f3975f Binary files /dev/null and b/audio/xylo_c8.ogg differ diff --git a/audio/xylo_c8.wav b/audio/xylo_c8.wav new file mode 100644 index 0000000..83ff989 Binary files /dev/null and b/audio/xylo_c8.wav differ diff --git a/audio/xylo_d5.mp3 b/audio/xylo_d5.mp3 new file mode 100644 index 0000000..1e38891 Binary files /dev/null and b/audio/xylo_d5.mp3 differ diff --git a/audio/xylo_d5.ogg b/audio/xylo_d5.ogg new file mode 100644 index 0000000..73d4c3e Binary files /dev/null and b/audio/xylo_d5.ogg differ diff --git a/audio/xylo_d5.wav b/audio/xylo_d5.wav new file mode 100644 index 0000000..be6e644 Binary files /dev/null and b/audio/xylo_d5.wav differ diff --git a/audio/xylo_d6.mp3 b/audio/xylo_d6.mp3 new file mode 100644 index 0000000..e0411f4 Binary files /dev/null and b/audio/xylo_d6.mp3 differ diff --git a/audio/xylo_d6.ogg b/audio/xylo_d6.ogg new file mode 100644 index 0000000..1420ae9 Binary files /dev/null and b/audio/xylo_d6.ogg differ diff --git a/audio/xylo_d6.wav b/audio/xylo_d6.wav new file mode 100644 index 0000000..3931690 Binary files /dev/null and b/audio/xylo_d6.wav differ diff --git a/audio/xylo_d7.mp3 b/audio/xylo_d7.mp3 new file mode 100644 index 0000000..2371d4e Binary files /dev/null and b/audio/xylo_d7.mp3 differ diff --git a/audio/xylo_d7.ogg b/audio/xylo_d7.ogg new file mode 100644 index 0000000..68b5148 Binary files /dev/null and b/audio/xylo_d7.ogg differ diff --git a/audio/xylo_d7.wav b/audio/xylo_d7.wav new file mode 100644 index 0000000..8d22c0e Binary files /dev/null and b/audio/xylo_d7.wav differ diff --git a/audio/xylo_db5.mp3 b/audio/xylo_db5.mp3 new file mode 100644 index 0000000..e7dfbc8 Binary files /dev/null and b/audio/xylo_db5.mp3 differ diff --git a/audio/xylo_db5.ogg b/audio/xylo_db5.ogg new file mode 100644 index 0000000..577da65 Binary files /dev/null and b/audio/xylo_db5.ogg differ diff --git a/audio/xylo_db5.wav b/audio/xylo_db5.wav new file mode 100644 index 0000000..7a170b9 Binary files /dev/null and b/audio/xylo_db5.wav differ diff --git a/audio/xylo_db6.mp3 b/audio/xylo_db6.mp3 new file mode 100644 index 0000000..ba39482 Binary files /dev/null and b/audio/xylo_db6.mp3 differ diff --git a/audio/xylo_db6.ogg b/audio/xylo_db6.ogg new file mode 100644 index 0000000..5a01001 Binary files /dev/null and b/audio/xylo_db6.ogg differ diff --git a/audio/xylo_db6.wav b/audio/xylo_db6.wav new file mode 100644 index 0000000..e1a9650 Binary files /dev/null and b/audio/xylo_db6.wav differ diff --git a/audio/xylo_db7.mp3 b/audio/xylo_db7.mp3 new file mode 100644 index 0000000..b77d4ac Binary files /dev/null and b/audio/xylo_db7.mp3 differ diff --git a/audio/xylo_db7.ogg b/audio/xylo_db7.ogg new file mode 100644 index 0000000..9295549 Binary files /dev/null and b/audio/xylo_db7.ogg differ diff --git a/audio/xylo_db7.wav b/audio/xylo_db7.wav new file mode 100644 index 0000000..a4dbffb Binary files /dev/null and b/audio/xylo_db7.wav differ diff --git a/audio/xylo_e5.mp3 b/audio/xylo_e5.mp3 new file mode 100644 index 0000000..cd1ac3f Binary files /dev/null and b/audio/xylo_e5.mp3 differ diff --git a/audio/xylo_e5.ogg b/audio/xylo_e5.ogg new file mode 100644 index 0000000..c3cab16 Binary files /dev/null and b/audio/xylo_e5.ogg differ diff --git a/audio/xylo_e5.wav b/audio/xylo_e5.wav new file mode 100644 index 0000000..f9f7094 Binary files /dev/null and b/audio/xylo_e5.wav differ diff --git a/audio/xylo_e6.mp3 b/audio/xylo_e6.mp3 new file mode 100644 index 0000000..5d05b2d Binary files /dev/null and b/audio/xylo_e6.mp3 differ diff --git a/audio/xylo_e6.ogg b/audio/xylo_e6.ogg new file mode 100644 index 0000000..48adfe8 Binary files /dev/null and b/audio/xylo_e6.ogg differ diff --git a/audio/xylo_e6.wav b/audio/xylo_e6.wav new file mode 100644 index 0000000..766a09f Binary files /dev/null and b/audio/xylo_e6.wav differ diff --git a/audio/xylo_e7.mp3 b/audio/xylo_e7.mp3 new file mode 100644 index 0000000..04fa12a Binary files /dev/null and b/audio/xylo_e7.mp3 differ diff --git a/audio/xylo_e7.ogg b/audio/xylo_e7.ogg new file mode 100644 index 0000000..47ff0b8 Binary files /dev/null and b/audio/xylo_e7.ogg differ diff --git a/audio/xylo_e7.wav b/audio/xylo_e7.wav new file mode 100644 index 0000000..42ac0d7 Binary files /dev/null and b/audio/xylo_e7.wav differ diff --git a/audio/xylo_eb5.mp3 b/audio/xylo_eb5.mp3 new file mode 100644 index 0000000..e27dd55 Binary files /dev/null and b/audio/xylo_eb5.mp3 differ diff --git a/audio/xylo_eb5.ogg b/audio/xylo_eb5.ogg new file mode 100644 index 0000000..1c7ca30 Binary files /dev/null and b/audio/xylo_eb5.ogg differ diff --git a/audio/xylo_eb5.wav b/audio/xylo_eb5.wav new file mode 100644 index 0000000..4c3f2d1 Binary files /dev/null and b/audio/xylo_eb5.wav differ diff --git a/audio/xylo_eb6.mp3 b/audio/xylo_eb6.mp3 new file mode 100644 index 0000000..2e83b11 Binary files /dev/null and b/audio/xylo_eb6.mp3 differ diff --git a/audio/xylo_eb6.ogg b/audio/xylo_eb6.ogg new file mode 100644 index 0000000..18ef3a5 Binary files /dev/null and b/audio/xylo_eb6.ogg differ diff --git a/audio/xylo_eb6.wav b/audio/xylo_eb6.wav new file mode 100644 index 0000000..d88fd6e Binary files /dev/null and b/audio/xylo_eb6.wav differ diff --git a/audio/xylo_eb7.mp3 b/audio/xylo_eb7.mp3 new file mode 100644 index 0000000..18cf438 Binary files /dev/null and b/audio/xylo_eb7.mp3 differ diff --git a/audio/xylo_eb7.ogg b/audio/xylo_eb7.ogg new file mode 100644 index 0000000..ef99c92 Binary files /dev/null and b/audio/xylo_eb7.ogg differ diff --git a/audio/xylo_eb7.wav b/audio/xylo_eb7.wav new file mode 100644 index 0000000..964d8ce Binary files /dev/null and b/audio/xylo_eb7.wav differ diff --git a/audio/xylo_f4.mp3 b/audio/xylo_f4.mp3 new file mode 100644 index 0000000..2ca51eb Binary files /dev/null and b/audio/xylo_f4.mp3 differ diff --git a/audio/xylo_f4.ogg b/audio/xylo_f4.ogg new file mode 100644 index 0000000..e8660da Binary files /dev/null and b/audio/xylo_f4.ogg differ diff --git a/audio/xylo_f4.wav b/audio/xylo_f4.wav new file mode 100644 index 0000000..d2c4c46 Binary files /dev/null and b/audio/xylo_f4.wav differ diff --git a/audio/xylo_f5.mp3 b/audio/xylo_f5.mp3 new file mode 100644 index 0000000..a40cde2 Binary files /dev/null and b/audio/xylo_f5.mp3 differ diff --git a/audio/xylo_f5.ogg b/audio/xylo_f5.ogg new file mode 100644 index 0000000..18acbc6 Binary files /dev/null and b/audio/xylo_f5.ogg differ diff --git a/audio/xylo_f5.wav b/audio/xylo_f5.wav new file mode 100644 index 0000000..f583c24 Binary files /dev/null and b/audio/xylo_f5.wav differ diff --git a/audio/xylo_f6.mp3 b/audio/xylo_f6.mp3 new file mode 100644 index 0000000..5a4facd Binary files /dev/null and b/audio/xylo_f6.mp3 differ diff --git a/audio/xylo_f6.ogg b/audio/xylo_f6.ogg new file mode 100644 index 0000000..139a071 Binary files /dev/null and b/audio/xylo_f6.ogg differ diff --git a/audio/xylo_f6.wav b/audio/xylo_f6.wav new file mode 100644 index 0000000..f63dfc1 Binary files /dev/null and b/audio/xylo_f6.wav differ diff --git a/audio/xylo_f7.mp3 b/audio/xylo_f7.mp3 new file mode 100644 index 0000000..5e7a51b Binary files /dev/null and b/audio/xylo_f7.mp3 differ diff --git a/audio/xylo_f7.ogg b/audio/xylo_f7.ogg new file mode 100644 index 0000000..73f48ae Binary files /dev/null and b/audio/xylo_f7.ogg differ diff --git a/audio/xylo_f7.wav b/audio/xylo_f7.wav new file mode 100644 index 0000000..fce2f73 Binary files /dev/null and b/audio/xylo_f7.wav differ diff --git a/audio/xylo_g4.mp3 b/audio/xylo_g4.mp3 new file mode 100644 index 0000000..b3ca46c Binary files /dev/null and b/audio/xylo_g4.mp3 differ diff --git a/audio/xylo_g4.ogg b/audio/xylo_g4.ogg new file mode 100644 index 0000000..e1f308e Binary files /dev/null and b/audio/xylo_g4.ogg differ diff --git a/audio/xylo_g4.wav b/audio/xylo_g4.wav new file mode 100644 index 0000000..5134f8b Binary files /dev/null and b/audio/xylo_g4.wav differ diff --git a/audio/xylo_g5.mp3 b/audio/xylo_g5.mp3 new file mode 100644 index 0000000..417fc7b Binary files /dev/null and b/audio/xylo_g5.mp3 differ diff --git a/audio/xylo_g5.ogg b/audio/xylo_g5.ogg new file mode 100644 index 0000000..c4dd3d3 Binary files /dev/null and b/audio/xylo_g5.ogg differ diff --git a/audio/xylo_g5.wav b/audio/xylo_g5.wav new file mode 100644 index 0000000..5d9b622 Binary files /dev/null and b/audio/xylo_g5.wav differ diff --git a/audio/xylo_g6.mp3 b/audio/xylo_g6.mp3 new file mode 100644 index 0000000..a5dfe59 Binary files /dev/null and b/audio/xylo_g6.mp3 differ diff --git a/audio/xylo_g6.ogg b/audio/xylo_g6.ogg new file mode 100644 index 0000000..f79933f Binary files /dev/null and b/audio/xylo_g6.ogg differ diff --git a/audio/xylo_g6.wav b/audio/xylo_g6.wav new file mode 100644 index 0000000..0d8100f Binary files /dev/null and b/audio/xylo_g6.wav differ diff --git a/audio/xylo_g7.mp3 b/audio/xylo_g7.mp3 new file mode 100644 index 0000000..fb74d6c Binary files /dev/null and b/audio/xylo_g7.mp3 differ diff --git a/audio/xylo_g7.ogg b/audio/xylo_g7.ogg new file mode 100644 index 0000000..d868ecf Binary files /dev/null and b/audio/xylo_g7.ogg differ diff --git a/audio/xylo_g7.wav b/audio/xylo_g7.wav new file mode 100644 index 0000000..9edc6b1 Binary files /dev/null and b/audio/xylo_g7.wav differ diff --git a/audio/xylo_gb4.mp3 b/audio/xylo_gb4.mp3 new file mode 100644 index 0000000..18e81fc Binary files /dev/null and b/audio/xylo_gb4.mp3 differ diff --git a/audio/xylo_gb4.ogg b/audio/xylo_gb4.ogg new file mode 100644 index 0000000..ea0a31d Binary files /dev/null and b/audio/xylo_gb4.ogg differ diff --git a/audio/xylo_gb4.wav b/audio/xylo_gb4.wav new file mode 100644 index 0000000..dc5afd2 Binary files /dev/null and b/audio/xylo_gb4.wav differ diff --git a/audio/xylo_gb5.mp3 b/audio/xylo_gb5.mp3 new file mode 100644 index 0000000..312a554 Binary files /dev/null and b/audio/xylo_gb5.mp3 differ diff --git a/audio/xylo_gb5.ogg b/audio/xylo_gb5.ogg new file mode 100644 index 0000000..2a8902e Binary files /dev/null and b/audio/xylo_gb5.ogg differ diff --git a/audio/xylo_gb5.wav b/audio/xylo_gb5.wav new file mode 100644 index 0000000..fb9f6c2 Binary files /dev/null and b/audio/xylo_gb5.wav differ diff --git a/audio/xylo_gb6.mp3 b/audio/xylo_gb6.mp3 new file mode 100644 index 0000000..a26513c Binary files /dev/null and b/audio/xylo_gb6.mp3 differ diff --git a/audio/xylo_gb6.ogg b/audio/xylo_gb6.ogg new file mode 100644 index 0000000..d56f150 Binary files /dev/null and b/audio/xylo_gb6.ogg differ diff --git a/audio/xylo_gb6.wav b/audio/xylo_gb6.wav new file mode 100644 index 0000000..dbe0dd6 Binary files /dev/null and b/audio/xylo_gb6.wav differ diff --git a/audio/xylo_gb7.mp3 b/audio/xylo_gb7.mp3 new file mode 100644 index 0000000..a6a5c93 Binary files /dev/null and b/audio/xylo_gb7.mp3 differ diff --git a/audio/xylo_gb7.ogg b/audio/xylo_gb7.ogg new file mode 100644 index 0000000..75dd6c9 Binary files /dev/null and b/audio/xylo_gb7.ogg differ diff --git a/audio/xylo_gb7.wav b/audio/xylo_gb7.wav new file mode 100644 index 0000000..658f81f Binary files /dev/null and b/audio/xylo_gb7.wav differ diff --git a/game.js b/game.js new file mode 100644 index 0000000..27a89ab --- /dev/null +++ b/game.js @@ -0,0 +1,604 @@ +"use strict"; + +/* By Joe Wreschnig + Placed in the public domain. + + This code is designed for use with Perlenspiel, by Brian Moriarty, + which is released under the terms of the GNU LGPL version 3 or + later. +*/ + +var LEVEL_SELECT = 0; +var LEVEL_IN = 1; +var LEVEL_LOST = 2; +var LEVEL_WON = 3; +var GAME_WON = 4; + +var bead_change = []; +var sounds = []; + +var LEVEL_IDX = [ + [7, 8, 9], + [4, 5, 6], + [1, 2, 3] +]; + +var LEVEL_POS = [ + null, + [0, 2], [1, 2], [2, 2], + [0, 1], [1, 1], [2, 1], + [0, 0], [1, 0], [2, 0] +]; + +var state = LEVEL_SELECT; + +var max_level = 1; +var current_level = 1; +var count = 0; + +function QueueChange(bead, sound) { + if (sound == null) + sound = []; + bead_change.push(bead) + sounds.push(sound); +} + +function Shuffle(a) { + for (var i = a.length - 1; i >= 1; --i) { + var j = PS.Random(i) - 1; + var tmp = a[j]; + a[j] = a[i]; + a[i] = tmp; + } + return a; +} + +function Choose(a) { + return a[PS.Random(a.length) - 1]; +} + +function CheckExact(pos) { + for (var n = 1; n <= 9; ++n) { + var x = LEVEL_POS[n][0]; + var y = LEVEL_POS[n][1]; + var on = PS.BeadColor(x, y) != PS.COLOR_WHITE; + var should = pos.indexOf(n) >= 0; + if ((on && !should) || (!on && should)) { + return false; + } + } + return true; +}; + +function FollowMeStart(x, y) { + count = 0; + PS.BeadColor(PS.Random(3) - 1, PS.Random(3) - 1, PS.COLOR_BLACK); +}; + +function FollowMePress(x, y) { + if (PS.BeadColor(x, y) == PS.COLOR_BLACK) { + PS.BeadColor(x, y, PS.COLOR_WHITE); + count++; + if (count >= 4) { + Win(); + } else { + PS.BeadColor(PS.Random(3) - 1, PS.Random(3) - 1, PS.COLOR_BLACK); + PS.AudioPlay(PS.Xylophone(count == 3 ? 14 : 13), 0.5); + } + } else { + Mistake(); + count = 0; + } +}; + +function EnumerateStart() { +}; + +function EnumeratePress(x, y) { + for (var n = 1; n < LEVEL_IDX[y][x]; ++n) { + if (PS.BeadColor(LEVEL_POS[n][0], LEVEL_POS[n][1]) != PS.COLOR_BLACK) { + Mistake(); + return; + } + } + if (PS.BeadColor(x, y) == PS.COLOR_BLACK) { + Mistake(); + } else { + PS.BeadColor(x, y, PS.COLOR_BLACK); + if (LEVEL_IDX[y][x] == 9) + Win(); + else if (LEVEL_IDX[y][x] == 3) + PS.AudioPlay(PS.Xylophone(15), 0.5); + else if (LEVEL_IDX[y][x] == 6) + PS.AudioPlay(PS.Xylophone(16), 0.5); + else if (LEVEL_IDX[y][x] > 6) + PS.AudioPlay(PS.Xylophone(15), 0.5); + else if (LEVEL_IDX[y][x] > 3) + PS.AudioPlay(PS.Xylophone(14), 0.5); + else + PS.AudioPlay(PS.Xylophone(13), 0.5); + } +}; + +var repeatorder = []; +function RepeatStart() { + PS.Clock(45); + repeatorder = Shuffle([1, 2, 3, 4, 5, 6, 7, 8, 9]).slice(0, 6); + for (var n = 0; n < repeatorder.length; ++n) { + QueueChange([[PS.COLOR_BLACK, repeatorder[n]]], + [PS.Xylophone(2 + n)]); + } +}; + +function RepeatPress(x, y) { + var n = repeatorder.shift(); + if (LEVEL_IDX[y][x] == n) { + PS.BeadColor(x, y, PS.COLOR_GREEN); + if (repeatorder.length == 0) { + Win(); + } else { + PS.AudioPlay(PS.Xylophone(9 + repeatorder.length), 0.5); + PS.AudioPlay(PS.Xylophone(9 + repeatorder.length), 0.5); + } + } else { + Mistake(); + } +}; + +var missing_valid = []; +function TickMissingStart() { + PS.Clock(45); + var d = {}; + missing_valid = []; + repeatorder = Shuffle([1, 2, 3, 4, 5, 6, 7, 8, 9]).slice(0, 6); + repeatorder = Shuffle(repeatorder.concat(repeatorder)); + for (var n = 0; n < repeatorder.length; ++n) { + if (d[repeatorder[n]]) { + QueueChange([[PS.COLOR_WHITE, repeatorder[n]]], + [PS.Xylophone(15 - n)]); + } else { + d[repeatorder[n]] = true; + QueueChange([[PS.COLOR_RED, repeatorder[n]]], + [PS.Xylophone(13 + n)]); + } + } + for (var n = 1; n <= 9; ++n) + if (repeatorder.indexOf(n) < 0) + missing_valid.push(n); + count = 0; +}; + +function TickMissingPress(x, y) { + if (missing_valid.indexOf(LEVEL_IDX[y][x]) < 0) { + Mistake(); + } else { + PS.BeadColor(x, y, PS.COLOR_BLACK); + if (CheckExact(missing_valid)) { + Win(); + } else { + count++; + PS.AudioPlay(PS.Xylophone(count == 2 ? 14 : 13), 0.5); + } + } +}; + +var third_row; + +function ThreeRowGenerate() { + third_row = Shuffle(Choose([ + [1, 2, 3], [4, 5, 6], [7, 8, 9], + [1, 4, 7], [2, 5, 8], [3, 6, 9], + [1, 5, 9], [3, 5, 7]])); + QueueChange([[PS.COLOR_BLACK, third_row[0]]], [PS.Xylophone(13)]); + QueueChange([[PS.COLOR_BLACK, third_row[1]]], [PS.Xylophone(13)]); +} + +function ThreeRowStart() { + count = 0; + PS.Clock(45); + ThreeRowGenerate(); +}; + +function ThreeRowPress(x, y) { + if (LEVEL_IDX[y][x] == third_row[2]) { + count++; + PS.BeadColor(x, y, PS.COLOR_BLACK); + PS.Clock(PS.Clock()); + if (count >= 3) { + Win(); + } else { + PS.AudioPlay(PS.Xylophone(14), 0.5); + QueueChange([[PS.COLOR_GREEN, third_row[2]], + [PS.COLOR_GREEN, third_row[1]], + [PS.COLOR_GREEN, third_row[0]]], + [PS.Xylophone(34)]); + QueueChange([[PS.COLOR_WHITE, third_row[2]], + [PS.COLOR_WHITE, third_row[1]], + [PS.COLOR_WHITE, third_row[0]]]); + ThreeRowGenerate(); + } + } else { + count = 0; + Mistake(); + } +}; + +var sudoku_row; +function SudokuRowGenerate() { + sudoku_row = Shuffle(Choose([[1, 8, 6], [4, 8, 3], [4, 2, 9], [7, 2, 6]])); + QueueChange([[PS.COLOR_RED, sudoku_row[0]]], + [PS.Xylophone(3)]); + QueueChange([[PS.COLOR_RED, sudoku_row[1]]], + [PS.Xylophone(2)]); +}; + +function SudokuStart() { + count = 0; + PS.Clock(45); + SudokuRowGenerate(); +} + +function SudokuPress(x, y) { + if (LEVEL_IDX[y][x] == sudoku_row[2]) { + count++; + PS.BeadColor(x, y, PS.COLOR_BLACK); + if (count >= 3) { + Win(); + } else { + PS.AudioPlay(PS.Xylophone(13), 0.5); + QueueChange([[PS.COLOR_GREEN, sudoku_row[2]], + [PS.COLOR_GREEN, sudoku_row[1]], + [PS.COLOR_GREEN, sudoku_row[0]]], + [PS.Xylophone(14)]); + QueueChange([[PS.COLOR_WHITE, sudoku_row[2]], + [PS.COLOR_WHITE, sudoku_row[1]], + [PS.COLOR_WHITE, sudoku_row[0]]]); + SudokuRowGenerate(); + } + } else { + count = 0; + Mistake(); + } +}; + +function DigitsStart() { + PS.Clock(40); + QueueChange([[PS.COLOR_BLACK, 1]], ["perc_hihat_closed"]); + QueueChange([[PS.COLOR_WHITE, 1], + [PS.COLOR_BLACK, 4]], ["perc_hihat_closed"]); + QueueChange([[PS.COLOR_WHITE, 4], + [PS.COLOR_BLACK, 7]], ["perc_hihat_closed"]); + QueueChange([[PS.COLOR_WHITE, 7]]); + QueueChange([]); + QueueChange([[PS.COLOR_BLACK, 2], + [PS.COLOR_BLACK, 5], + [PS.COLOR_BLACK, 8]], + [PS.Xylophone(13)]); + QueueChange([[PS.COLOR_GREEN, 2], + [PS.COLOR_GREEN, 5], + [PS.COLOR_GREEN, 8]], + [PS.Xylophone(14)]); + QueueChange([[PS.COLOR_WHITE, 2], + [PS.COLOR_WHITE, 5], + [PS.COLOR_WHITE, 8]]); + count = 4; +}; + +function DigitsPress(x, y) { + if (PS.BeadColor(x, y) == PS.COLOR_WHITE) { + PS.BeadColor(x, y, PS.COLOR_BLACK); + } else { + PS.BeadColor(x, y, PS.COLOR_WHITE); + } + + if (count == 4 && ApproveIfExact([7, 9, 4, 5, 6, 3])) + count = 7; + if (count == 7 && (CheckExact([7, 8, 9, 6, 3]) + || CheckExact([7, 8, 9, 6, 2]))) { + Win(); + return; + } + + if (PS.BeadColor(x, y) == PS.COLOR_WHITE) { + PS.AudioPlay(PS.Xylophone(10), 0.5); + } else { + PS.AudioPlay(PS.Xylophone(13), 0.3); + } + +}; + +function ShapesStart() { + PS.Clock(40); + QueueChange([[PS.COLOR_BLACK, 1]], [PS.Xylophone(13)]); + QueueChange([[PS.COLOR_GREEN, 1]], [PS.Xylophone(14)]); + QueueChange([[PS.COLOR_BLACK, 1]]); + QueueChange([[PS.COLOR_BLACK, 4]], [PS.Xylophone(13)]); + QueueChange([[PS.COLOR_BLACK, 7]], [PS.Xylophone(13)]); + + QueueChange([[PS.COLOR_GREEN, 1], + [PS.COLOR_GREEN, 4], + [PS.COLOR_GREEN, 7]], + [PS.Xylophone(14)]); + QueueChange([[PS.COLOR_BLACK, 1], + [PS.COLOR_BLACK, 4], + [PS.COLOR_BLACK, 7]]); + count = 3; +}; + +function ShapesPress(x, y) { + if (PS.BeadColor(x, y) == PS.COLOR_WHITE) { + PS.BeadColor(x, y, PS.COLOR_BLACK); + } else { + PS.BeadColor(x, y, PS.COLOR_WHITE); + } + + if (count == 3 && (ApproveIfExact([1, 4, 7, 2, 5, 3], PS.COLOR_BLACK) + || ApproveIfExact([1, 4, 7, 8, 5, 3], PS.COLOR_BLACK))) { + count = 4; + if (PS.BeadColor(x, y) == PS.COLOR_WHITE) + PS.AudioPlay(PS.Xylophone(10), 0.3); + else + PS.AudioPlay(PS.Xylophone(13), 0.5); + } else if (count == 4 && CheckExact([1, 2, 3, 4, 5, 6, 7, 8, 9])) + Win(); + else { + if (PS.BeadColor(x, y) == PS.COLOR_WHITE) + PS.AudioPlay(PS.Xylophone(10), 0.3); + else + PS.AudioPlay(PS.Xylophone(13), 0.5); + } +}; + +function DieStart() { + PS.Clock(40); + QueueChange([[PS.COLOR_BLACK, 5]], [PS.Xylophone(13)]); + QueueChange([[PS.COLOR_GREEN, 5]], [PS.Xylophone(14)]); + QueueChange([[PS.COLOR_WHITE, 5]]); + QueueChange([[PS.COLOR_BLACK, 1]], [PS.Xylophone(13)]); + QueueChange([[PS.COLOR_BLACK, 9]], [PS.Xylophone(13)]); + QueueChange([[PS.COLOR_GREEN, 1], + [PS.COLOR_GREEN, 9]], [PS.Xylophone(14)]); + QueueChange([[PS.COLOR_WHITE, 1], + [PS.COLOR_WHITE, 9]]); + count = 3; +}; + +function ApproveIfExact(a, color) { + if (color == null) + color = PS.COLOR_WHITE; + if (CheckExact(a)) { + var green = []; + var white = []; + for (var n = 0; n < a.length; ++n) { + green.push([PS.COLOR_GREEN, a[n]]); + white.push([color, a[n]]); + } + QueueChange(green, [PS.Xylophone(14)]); + QueueChange(white); + PS.Clock(PS.Clock()); + if (PS.StatusText() != "…") + PS.StatusText("…"); + return true; + } else { + return false; + } +}; + +function DiePress(x, y) { + if (PS.BeadColor(x, y) == PS.COLOR_WHITE) { + PS.BeadColor(x, y, PS.COLOR_BLACK); + } else { + PS.BeadColor(x, y, PS.COLOR_WHITE); + } + switch (count) { + case 3: + if (ApproveIfExact([1, 5, 9]) || ApproveIfExact([7, 5, 3])) + count = 4; + break; + case 4: + if (ApproveIfExact([1, 3, 7, 9])) + count = 5; + break; + case 5: + if (ApproveIfExact([1, 3, 5, 7, 9])) + count = 6; + break; + case 6: + if (CheckExact([1, 2, 3, 7, 8, 9]) + || CheckExact([1, 4, 7, 3, 6, 9])) { + Win(); + return; + } + } + + if (PS.BeadColor(x, y) == PS.COLOR_WHITE) { + PS.AudioPlay(PS.Xylophone(14), 0.5); + } else { + PS.AudioPlay(PS.Xylophone(13), 0.3); + } +}; + +var LEVELS = [ + null, + [FollowMeStart, FollowMePress], + [ThreeRowStart, ThreeRowPress], + [EnumerateStart, EnumeratePress], + [RepeatStart, RepeatPress], + [TickMissingStart, TickMissingPress], + [SudokuStart, SudokuPress], + [ShapesStart, ShapesPress], + [DieStart, DiePress], + [DigitsStart, DigitsPress], +]; + +function Reset(color) { + if (max_level < 10 && PS.StatusText() != "?") + PS.StatusText("?"); + if (max_level == 10 && PS.StatusText() != ".") + PS.StatusText("."); + + PS.Clock(0); + bead_change = []; + PS.BeadColor(PS.ALL, PS.ALL, color); +} + +function Win() { + Reset(PS.COLOR_GREEN); + state = LEVEL_WON; + current_level += 1; + if (max_level < current_level) { + max_level = current_level; + if (max_level == 10) { + setTimeout(function() { + PS.AudioPlay(PS.Xylophone(25), 0.5) + }, 0); + setTimeout(function() { + PS.AudioPlay(PS.Xylophone(30), 0.5) + }, 500); + setTimeout(function() { + PS.AudioPlay(PS.Xylophone(30), 0.5) + }, 600); + setTimeout(function() { + PS.AudioPlay(PS.Xylophone(31), 0.5) + }, 1000); + setTimeout(function() { + PS.AudioPlay(PS.Xylophone(37), 0.5) + }, 1300); + } else { + PS.AudioPlay(PS.Xylophone(34), 0.5); + PS.AudioPlay(PS.Xylophone(38), 0.5); + PS.AudioPlay(PS.Xylophone(39), 0.5); + } + } else { + PS.AudioPlay(PS.Xylophone(34), 0.5); + PS.AudioPlay(PS.Xylophone(38), 0.5); + PS.AudioPlay(PS.Xylophone(39), 0.5); + } +}; + +function Mistake() { + Reset(PS.COLOR_RED); + PS.AudioPlay(PS.Xylophone(2), 0.5); + PS.AudioPlay(PS.Xylophone(8), 0.5); + PS.AudioPlay(PS.Xylophone(22), 0.5); + PS.StatusText("X"); + state = LEVEL_LOST; +}; + +PS.Init = function (options) { + var path = window.location.href; + PS.AudioPath(path.substr(0, path.lastIndexOf("/")) + "/audio/"); + PS.GridSize(3, 3); + LevelSelect(); + PS.StatusText("?"); + for (var i = 1; i < 39; ++i) + PS.AudioLoad(PS.Xylophone(i)); + PS.AudioLoad("perc_hihat_closed"); +}; + +function StartLevel(level) { + if (level > max_level) + return; + PS.AudioPlay(PS.Xylophone(1), 0.5); + Reset(PS.COLOR_WHITE); + current_level = level; + LEVELS[current_level][0](); + state = LEVEL_IN; +}; + +function LevelSelect() { + Reset(PS.COLOR_WHITE); + for (var n = 1; n <= 9; ++n) { + var x = LEVEL_POS[n][0]; + var y = LEVEL_POS[n][1]; + if (n == max_level) + PS.BeadColor(x, y, PS.COLOR_VIOLET); + else if (n < max_level) + PS.BeadColor(x, y, PS.COLOR_BLUE); + } + if (max_level == 10) + PS.BeadColor(PS.ALL, PS.ALL, PS.COLOR_BLUE); + state = LEVEL_SELECT; +}; + +PS.Click = function (x, y, data, options) { + if (PS.Clock() > 0 && bead_change.length) + return; + switch (state) { + case LEVEL_SELECT: + StartLevel(LEVEL_IDX[y][x]); + break; + case LEVEL_IN: + LEVELS[current_level][1](x, y); + break; + case LEVEL_WON: + LevelSelect(); + break; + case LEVEL_LOST: + StartLevel(current_level); + break; + case GAME_WON: + break; + } +}; + +PS.Release = function (x, y, data, options) { +}; + +PS.Enter = function (x, y, data, options) { + if (state == LEVEL_SELECT && PS.BeadColor(x, y) != PS.COLOR_WHITE) { + PS.AudioPlay( "fx_click" , 0.5); + } +}; + +PS.Leave = function (x, y, data, options) { +}; + +PS.KeyDown = function (key, shift, ctrl, options) { + if (ctrl && key == 32) { + Win(); + LevelSelect(); + } + switch (key) { + case PS.KEYPAD_1: case 49: PS.Click(0, 2); break; + case PS.KEYPAD_2: case 50: PS.Click(1, 2); break; + case PS.KEYPAD_3: case 51: PS.Click(2, 2); break; + case PS.KEYPAD_4: case 52: PS.Click(0, 1); break; + case PS.KEYPAD_5: case 53: PS.Click(1, 1); break; + case PS.KEYPAD_6: case 54: PS.Click(2, 1); break; + case PS.KEYPAD_7: case 55: PS.Click(0, 0); break; + case PS.KEYPAD_8: case 56: PS.Click(1, 0); break; + case PS.KEYPAD_9: case 57: PS.Click(2, 0); break; + case PS.KEY_ESCAPE: LevelSelect(); break; + } +}; + +PS.KeyUp = function (key, shift, ctrl, options) { +}; + +PS.Wheel = function (dir, options) { +}; + +PS.Tick = function (options) { + var beads = bead_change.shift(); + if (beads) { + if (PS.StatusText() != "…") + PS.StatusText("…"); + for (var n = 0; n < beads.length; ++n) { + var bead = beads[n]; + var x = LEVEL_POS[bead[1]][0]; + var y = LEVEL_POS[bead[1]][1]; + PS.BeadColor(x, y, bead[0]); + } + } + + var sound = sounds.shift(); + if (sound) { + for (var n = 0; n < sound.length; ++n) { + PS.AudioPlay(sound[n], 0.5); + } + } + + if (bead_change.length == 0 && PS.StatusText() != "?") + PS.StatusText("?"); +}; diff --git a/index.html b/index.html new file mode 100644 index 0000000..eec45bb --- /dev/null +++ b/index.html @@ -0,0 +1,19 @@ + + + + 123456789 - a game for Ludum Dare 26 + + + + + + + + + + + + + diff --git a/ps2.3.css b/ps2.3.css new file mode 100644 index 0000000..09a82d2 --- /dev/null +++ b/ps2.3.css @@ -0,0 +1,64 @@ +/* +Perlenspiel is a scheme by Professor Moriarty (bmoriarty@wpi.edu). +Perlenspiel is Copyright © 2009-12 Worcester Polytechnic Institute. +This file is part of Perlenspiel. + +Perlenspiel is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published +by the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Perlenspiel is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You may have received a copy of the GNU Lesser General Public License +along with Perlenspiel. If not, see . +*/ + +body +{ + color: #000000; + background-color: #FFFFFF; + width: 512px; + margin: 0 auto; + font-family: Arial, Helvetica, sans-serif; +} + +#main +{ + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -o-user-select: none; + user-select: none; +} + +#sts +{ + width: 480px; + font-size: 18pt; + text-align: center; + border: 0; + margin-top: 32px; + margin-bottom: 16px; +} + +#dbg +{ + display: none; +} + +#mon +{ + text-align: left; +} + +#ftr +{ + color: #000000; + width: 480px; + font-size: 9pt; + text-align: center; +} diff --git a/ps2.3.js b/ps2.3.js new file mode 100644 index 0000000..c787059 --- /dev/null +++ b/ps2.3.js @@ -0,0 +1 @@ +(function(){var a,b,c,d;a=0;b=["ms","moz","webkit","o"];for(c=0;c<(b.length&&!window.requestAnimationFrame);c+=1){d=b[c];window.requestAnimationFrame=window[d+"RequestAnimationFrame"];window.cancelAnimationFrame=window[d+"CancelAnimationFrame"]||window[d+"CancelRequestAnimationFrame"];}if(!window.requestAnimationFrame){window.requestAnimationFrame=function(f,h){var g,i,j;g=new Date().getTime();i=Math.max(0,16-(g-a));j=window.setTimeout(function(){f(g+i);},i);a=g+i;return j;};}if(!window.cancelAnimationFrame){window.cancelAnimationFrame=function(e){window.clearTimeout(e);};}}());var PS={ERROR:"ERROR",DEFAULT:"DEFAULT",CURRENT:"CURRENT",ALL:"ALL",EMPTY:"EMPTY",CVS_W:480,MAIN_ID:"mn",STS_ID:"sts",CVS_ID:"cvs",FTR_ID:"ftr",DBG_ID:"dbg",MON_ID:"mon",G_MAX:32,D_G_W:8,D_G_H:8,D_B_RGB:0,D_B_R:0,D_B_G:0,D_B_B:0,D_BG_RGB:16777215,D_BG_R:255,D_BG_G:255,D_BG_B:255,D_BDR_RGB:8421504,D_BDR_R:128,D_BDR_G:128,D_BDR_B:128,D_BDR_W:1,D_GL_RGB:16777215,D_GL_R:255,D_GL_G:255,D_GL_B:255,D_FL_RGB:16777215,D_FL_R:255,D_FL_G:255,D_FL_B:255,D_ALPHA:100,D_FPS:17,RSHIFT:256*256,GSHIFT:256,FL_STEP:10,FL_INTERVAL:5,KEY_RATE:6,APP:"Perlenspiel",D_ST_RGB:0,D_ST_R:0,D_ST_G:0,D_ST_B:0,D_AUDIO_PATH:"http://users.wpi.edu/~bmoriarty/ps/audio/",MAX_VOL:1,D_VOL:0.5,D_LOOP:false,AudioCurrentPath:"",AUDIO_MAX_CH:32,CH_EMPTY:0,CH_LOADING:1,CH_READY:2,CH_PLAYING:3,CH_PAUSED:4,AudioChannels:[],ChannelsUsed:0,AudioContext:null,COLOR_BLACK:0,COLOR_WHITE:16777215,COLOR_GRAY_LIGHT:12632256,COLOR_GRAY:8421504,COLOR_GRAY_DARK:4210752,COLOR_RED:16711680,COLOR_ORANGE:16744448,COLOR_YELLOW:16776960,COLOR_GREEN:65280,COLOR_BLUE:255,COLOR_INDIGO:4194559,COLOR_VIOLET:8388863,COLOR_MAGENTA:16711935,COLOR_CYAN:65535,KEY_TAB:9,KEY_ESCAPE:27,KEY_PAGE_UP:1001,KEY_PAGE_DOWN:1002,KEY_END:1003,KEY_HOME:1004,ARROW_LEFT:1005,ARROW_UP:1006,ARROW_RIGHT:1007,ARROW_DOWN:1008,KEY_INSERT:1009,KEY_DELETE:1010,KEYPAD_0:96,KEYPAD_1:97,KEYPAD_2:98,KEYPAD_3:99,KEYPAD_4:100,KEYPAD_5:101,KEYPAD_6:102,KEYPAD_7:103,KEYPAD_8:104,KEYPAD_9:105,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,FORWARD:1,BACKWARD:-1,Grid:null,DebugWindow:null,ImageCanvas:null,BlitCanvas:null,BlitContext:null,LoaderList:[],LoaderCnt:0,MouseX:-1,MouseY:-1,LastX:-1,LastY:-1,Pressed:[],Holding:[],KeyDelay:0,HoldShift:false,HoldCtrl:false,OverCanvas:false,DebugFocus:false,FlashDelay:0,UserDelay:0,UserClock:0,FooterColor:0,FooterDelay:300,D_ST_STEP_UP:5,D_ST_STEP_DOWN:5,Status:"",StatusHue:0,StatusRed:0,StatusGreen:0,StatusBlue:0,STS_FPS:12,STS_REG:5,D_STS_UP:60,D_STS_DOWN:60,D_STS_DELAY:120,StatusUp:true,StatusUpRate:60,StatusUpDelay:5,StatusUpStep:0,StatusUpPhase:0,StatusDown:false,StatusDownRate:0,StatusDownDelay:5,StatusDownStep:0,StatusDownPhase:0,StatusDelayRate:120,StatusDelay:0,Init:null,Click:null,Release:null,Enter:null,Leave:null,KeyDown:null,KeyUp:null,Wheel:null,Tick:null,MAJ:2,MIN:3,REV:9};PS.TypeOf=function(b){var a;a=typeof b;if(a==="object"){if(b){if(b instanceof Array){a="array";}}else{a="null";}}return a;};PS.Context=function(){var b,a;a=null;b=document.getElementById(PS.CVS_ID);if(b&&b.getContext){a=b.getContext("2d");}return a;};PS.ValidRGB=function(a,b){if(typeof a!=="number"){PS.Oops(b+"rgb parameter not a number");return -1;}a=Math.floor(a);if(a<0){PS.Oops(b+"rgb parameter negative");return -1;}if(a>16777215){PS.Oops(b+"rgb parameter out of range");return -1;}return a;};PS.UnmakeRGB=function(b){var c,g,d,a,f,e;c="[PS.UnmakeRGB] ";if(typeof b!=="number"){return PS.Oops(c+"RGB parameter not a number");}b=Math.floor(b);if(b<0){return PS.Oops(c+"RGB parameter negative");}if(b>16777215){return PS.Oops(c+"RGB parameter out of range");}g=b/PS.RSHIFT;g=Math.floor(g);f=g*PS.RSHIFT;d=(b-f)/PS.GSHIFT;d=Math.floor(d);e=d*PS.GSHIFT;a=b-f-e;return{r:g,g:d,b:a};};PS.ColorParams=function(k,j,h,l){var a,i,c,m,e,f,d;a=false;i=PS.TypeOf(j);if(i==="number"){if(h===undefined){if((j<0)||(j>16777215)){PS.Oops(k+"multiplexed rgb value out of range");return null;}j=Math.floor(j);c=j/PS.RSHIFT;c=Math.floor(c);f=c*PS.RSHIFT;e=(j-f)/PS.GSHIFT;e=Math.floor(e);d=e*PS.GSHIFT;m=j-f-d;a=true;}else{c=j;e=h;m=l;if(m===undefined){PS.Oops(k+"b parameter missing in rgb triplet");return null;}}}else{if(i==="object"){c=j.r;if(c===undefined){PS.Oops(k+"r element missing in rgb table");return null;}e=j.g;if(e===undefined){PS.Oops(k+"g element missing in rgb table");return null;}m=j.b;if(m===undefined){PS.Oops(k+"b element missing in rgb table");return null;}}else{if(i==="array"){if(j.length<3){PS.Oops(k+"rgb array length invalid");return null;}c=j[0];e=j[1];m=j[2];}else{PS.Oops(k+"Invalid color parameter");return null;}}}if(!a){if(typeof c!=="number"){PS.Oops(k+"red value is not a number");return null;}c=Math.floor(c);if((c<0)&&(c>255)){PS.Oops(k+"red value out of range ["+c+"]");return null;}if(typeof e!=="number"){PS.Oops(k+"green value is not a number");return null;}e=Math.floor(e);if((e<0)&&(e>255)){PS.Oops(k+"green value out of range ["+e+"]");return null;}if(typeof m!=="number"){PS.Oops(k+"blue value is not a number");return null;}m=Math.floor(m);if((m<0)&&(m>255)){PS.Oops(k+"blue value out of range ["+m+"]");return null;}}return{r:c,g:e,b:m};};PS.Dissolve=function(c,b,a){var d;if((a<=0)||(c===b)){return c;}if(a>=100){return b;}if(c>b){d=c-b;d=(a*d)/100;d=Math.floor(d);return(c-d);}d=b-c;d=(a*d)/100;d=Math.floor(d);return(c+d);};PS.InitBead=function(c,e,d,b){var a;a={};a.left=c;a.right=c+d;a.top=e;a.bottom=e+d;a.size=d;a.visible=true;a.empty=true;a.red=PS.D_B_R;a.green=PS.D_B_G;a.blue=PS.D_B_B;a.color="rgb("+a.red+","+a.green+","+a.blue+")";a.colorNow=a.color;a.alpha=PS.D_ALPHA;a.alphaRed=PS.D_B_R;a.alphaGreen=PS.D_B_G;a.alphaBlue=PS.D_B_B;a.glyph=0;a.glyphStr="";a.glyphRed=PS.D_GL_R;a.glyphGreen=PS.D_GL_G;a.glyphBlue=PS.D_GL_B;a.glyphColor="rgb("+PS.D_GL_R+","+PS.D_GL_G+","+PS.D_GL_B+")";a.flash=true;a.flashPhase=0;a.flashRed=PS.D_FL_R;a.flashGreen=PS.D_FL_G;a.flashBlue=PS.D_FL_B;a.flashColor="rgb("+PS.D_FL_R+","+PS.D_FL_G+","+PS.D_FL_B+")";a.borderWidth=PS.D_BDR_W;a.borderRed=PS.D_BDR_R;a.borderGreen=PS.D_BDR_G;a.borderBlue=PS.D_BDR_B;a.borderAlpha=PS.D_ALPHA;a.borderColor="rgb("+PS.D_BDR_R+","+PS.D_BDR_G+","+PS.D_BDR_B+")";a.data=0;a.audio=null;a.volume=PS.D_VOL;a.loop=PS.D_LOOP;a.exec=null;a.off=document.createElement("canvas");a.off.width=d;a.off.height=d;a.off.backgroundColor=b;a.offContext=a.off.getContext("2d");a.offContext.font=Math.floor(d/2)+"pt sans-serif";a.offContext.textAlign="center";a.offContext.textBaseline="middle";return a;};PS.Bead=function(b){var c,a,g,f,d,e;c=PS.Grid.context;g=0;f=0;d=b.size;a=b.offContext;e=b.borderWidth;if(e>0){a.fillStyle=b.borderColor;a.fillRect(0,0,d,d);g+=e;f+=e;d-=(e+e);}if(b.empty){a.fillStyle=PS.Grid.bgColor;}else{a.fillStyle=b.colorNow;}a.fillRect(g,f,d,d);if(b.glyph>0){a.fillStyle=b.glyphColor;a.fillText(b.glyphStr,PS.Grid.glyphX,PS.Grid.glyphY);}c.drawImage(b.off,b.left,b.top);};PS.EraseBead=function(a){var b,c,f,e,d;b=PS.Grid.context;f=a.left;e=a.top;c=a.size;d=a.borderWidth;if(d>0){b.fillStyle=a.borderColor;b.fillRect(f,e,c,c);f+=d;e+=d;c-=(d+d);}b.fillStyle=PS.Grid.bgColor;b.fillRect(f,e,c,c);};PS.InitGrid=function(a,h){var f,e,c,d,b,g;f={};f.context=PS.Context();if(!f.context){return null;}f.x=a;f.y=h;f.count=a*h;if(a>=h){f.beadSize=d=Math.floor(PS.CVS_W/a);f.width=d*a;f.height=d*h;f.left=0;}else{f.beadSize=d=Math.floor(PS.CVS_W/h);f.width=d*a;f.height=d*h;f.left=Math.floor((PS.CVS_W-f.width)/2);}f.top=0;f.right=f.left+f.width;f.bottom=f.top+f.height;f.bgRed=PS.D_BG_R;f.bgGreen=PS.D_BG_G;f.bgBlue=PS.D_BG_B;f.bgColor="rgb("+f.bgRed+","+f.bgGreen+","+f.bgBlue+")";f.borderRed=PS.D_BDR_R;f.borderGreen=PS.D_BDR_G;f.borderBlue=PS.D_BDR_B;f.borderColor="rgb("+f.borderRed+","+f.borderGreen+","+f.borderBlue+")";f.borderMax=Math.floor((d-8)/2);f.pointing=-1;f.flash=true;f.flashList=[];f.glyphX=Math.floor(d/2);f.glyphY=Math.floor((d/7)*4);f.glyphSize=Math.floor(d/2)+"pt sans-serif";f.beads=[];g=f.top;for(c=0;c=PS.Grid.x){PS.Oops(b+"x parameter exceeds grid width");return false;}return true;};PS.CheckY=function(b,a){if(typeof b!=="number"){PS.Oops(a+"y parameter not a number");return false;}b=Math.floor(b);if(b<0){PS.Oops(a+"y parameter negative");return false;}if(b>=PS.Grid.y){PS.Oops(a+"y parameter exceeds grid height");return false;}return true;};PS.GridSize=function(a,g){var f,e,d,c,b;f="[PS.GridSize] ";if(a===PS.DEFAULT){a=PS.D_G_W;}else{if(typeof a!=="number"){return PS.Oops(f+"Width param not a number");}a=Math.floor(a);if(a<1){PS.Oops(f+"Width parameter < 1");a=1;}else{if(a>PS.G_MAX){PS.Oops(f+"Width parameter > "+PS.G_MAX);a=PS.G_MAX;}}}if(g===PS.DEFAULT){g=PS.D_G_H;}else{if(typeof g!=="number"){return PS.Oops(f+"Height param not a number");}g=Math.floor(g);if(g<1){PS.Oops(f+"Height parameter < 1");g=1;}else{if(g>PS.G_MAX){PS.Oops(f+"Height parameter > "+PS.G_MAX);g=PS.G_MAX;}}}if(PS.Grid){c=PS.Grid.beads;if(c){d=PS.Grid.count;for(e=0;e127){j=0;}else{j=255;}if(h>127){a=0;}else{a=255;}if(p>127){d=0;}else{d=255;}PS.FooterColor="rgb("+j+","+a+","+d+")";k.style.color=PS.FooterColor;}k=document.getElementById(PS.STS_ID);if(k){k.style.backgroundColor=PS.Grid.bgColor;}k=document.getElementById(PS.CVS_ID);if(k){k.width=PS.CVS_W;PS.DrawGrid();}return m;};PS.MakeRGB=function(f,e,a){var d,c;d="[PS.MakeRGB] ";if(typeof f!=="number"){return PS.Oops(d+"R parameter not a number");}f=Math.floor(f);if(f<0){f=0;}else{if(f>255){f=255;}}if(typeof e!=="number"){return PS.Oops(d+"G parameter not a number");}e=Math.floor(e);if(e<0){e=0;}else{if(e>255){e=255;}}if(typeof a!=="number"){return PS.Oops(d+"B parameter not a number");}a=Math.floor(a);if(a<0){a=0;}else{if(a>255){a=255;}}c=(f*PS.RSHIFT)+(e*PS.GSHIFT)+a;return c;};PS.XBShow=function(b,e,c){var d,a;d=b+(e*PS.Grid.x);a=PS.Grid.beads[d];if((c===undefined)||(c===PS.CURRENT)||(c===a.visible)){return a.visible;}a.visible=c;if(c){if(PS.Grid.flash&&a.flash){PS.FlashStart(b,e);}else{a.colorNow=a.color;PS.Bead(a);}}else{PS.EraseBead(a);}return c;};PS.BeadShow=function(a,f,b){var e,d,c;e="[PS.BeadShow] ";if((b!==undefined)&&(b!==PS.CURRENT)){if((b===PS.DEFAULT)||b){b=true;}else{b=false;}}if(a===PS.ALL){if(f===PS.ALL){for(c=0;cPS.D_ALPHA){c=PS.D_ALPHA;}}}}}if(b===PS.ALL){if(g===PS.ALL){for(d=0;dPS.Grid.borderMax){e=PS.Grid.borderMax;}}}}if(a===PS.ALL){if(f===PS.ALL){for(b=0;bPS.D_ALPHA){c=PS.D_ALPHA;}}}}}if(b===PS.ALL){if(g===PS.ALL){for(d=0;d0)){PS.Bead(a);}return e;};PS.BeadGlyphColor=function(o,l,k,h,n){var m,a,c,d,p,f,e;m="[PS.BeadGlyphColor] ";if(k===PS.DEFAULT){k=PS.D_GL_RGB;c=PS.D_GL_R;d=PS.D_GL_G;p=PS.D_GL_B;}else{if((k!==undefined)&&(k!==PS.CURRENT)){a=PS.ColorParams(m,k,h,n);if(!a){return PS.ERROR;}c=a.r;d=a.g;p=a.b;}}if(o===PS.ALL){if(l===PS.ALL){for(e=0;ePS.MAX_VOL){e=PS.MAX_VOL;}}}}if(a===PS.ALL){if(g===PS.ALL){for(b=0;b=100){c.colorNow=c.color;c.flashPhase=0;PS.Grid.flashList.splice(h,1);l-=1;}else{c.flashPhase=p;a=PS.Dissolve(c.flashRed,c.alphaRed,p);j=PS.Dissolve(c.flashGreen,c.alphaGreen,p);o=PS.Dissolve(c.flashBlue,c.alphaBlue,p);c.colorNow="rgb("+a+","+j+","+o+")";h+=1;}PS.Bead(c);}}if(PS.FooterDelay>0){PS.FooterDelay-=1;if(!PS.FooterDelay){n=document.getElementById(PS.FTR_ID);if(n){n.innerHTML="";}}}if(PS.StatusUp&&(PS.StatusUpPhase<100)){if(PS.StatusUpDelay>0){PS.StatusUpDelay-=1;}else{PS.StatusUpDelay=PS.STS_REG;p=PS.StatusUpPhase+PS.StatusUpStep;if(p>=100){p=100;k=PS.StatusHue;if(PS.StatusDown){PS.StatusDelay=PS.StatusDelayRate;PS.StatusDownPhase=0;PS.StatusDownDelay=PS.STS_REG;}}else{a=PS.Dissolve(PS.Grid.bgRed,PS.StatusRed,p);j=PS.Dissolve(PS.Grid.bgGreen,PS.StatusGreen,p);o=PS.Dissolve(PS.Grid.bgBlue,PS.StatusBlue,p);k="rgb("+a+","+j+","+o+")";}PS.StatusUpPhase=p;n=document.getElementById(PS.STS_ID);if(n){n.style.color=k;}}}if(PS.StatusDown&&(PS.StatusDownPhase<100)){if(PS.StatusDelay>0){PS.StatusDelay-=1;}else{if(PS.StatusDownDelay>0){PS.StatusDownDelay-=1;}else{PS.StatusDownDelay=PS.STS_REG;p=PS.StatusDownPhase+PS.StatusDownStep;if(p>=100){p=100;k=PS.Grid.bgColor;}else{a=PS.Dissolve(PS.StatusRed,PS.Grid.bgRed,p);j=PS.Dissolve(PS.StatusGreen,PS.Grid.bgGreen,p);o=PS.Dissolve(PS.StatusBlue,PS.Grid.bgBlue,p);k="rgb("+a+","+j+","+o+")";}PS.StatusDownPhase=p;n=document.getElementById(PS.STS_ID);if(n){n.style.color=k;}if(p>=100){PS.StatusText("");}}}}l=PS.Holding.length;if(l>0){if(PS.KeyDelay>0){PS.KeyDelay-=1;}else{PS.KeyDelay=PS.KEY_RATE;h=0;while(h0){PS.UserDelay+=1;if(PS.UserDelay>=PS.UserClock){PS.UserDelay=0;if(PS.Tick){try{PS.Tick();}catch(m){PS.UserClock=0;PS.Oops("PS.Tick() failed ["+m.message+"]");}}}}};PS.FlashStart=function(c,f){var e,b,d,a;e=c+(f*PS.Grid.x);b=PS.Grid.beads[e];b.flashPhase=0;b.colorNow=b.flashColor;PS.Bead(b);a=PS.Grid.flashList.length;for(d=0;d=PS.Grid.left)&&(h=PS.Grid.top)&&(g=d.top)&&(g=d.left)&&(h=0){a=PS.Grid.beads[PS.MouseX+(PS.MouseY*PS.Grid.x)];if(a.audio){PS.AudioPlay(a.audio,a.volume,null,PS.CURRENT,undefined);}if(typeof a.exec==="function"){try{a.exec(PS.MouseX,PS.MouseY,a.data);}catch(c){PS.Oops("Bead "+PS.MouseX+", "+PS.MouseY+" function failed ["+c.message+"]");}}if(PS.Click){try{PS.Click(PS.MouseX,PS.MouseY,a.data);}catch(b){PS.Oops("PS.Click() failed ["+b.message+"]");}}}};PS.MouseUp=function(c){var a;if(PS.Grid&&PS.Release){PS.MouseXY(c);if(PS.MouseX>=0){a=PS.Grid.beads[PS.MouseX+(PS.MouseY*PS.Grid.x)];try{PS.Release(PS.MouseX,PS.MouseY,a.data);}catch(b){PS.Oops("PS.Release() failed ["+b.message+"]");}}}};PS.MouseMove=function(f){var b,e;PS.OverCanvas=true;PS.MouseXY(f);if(PS.MouseX>=0){b=PS.Grid.beads[PS.MouseX+(PS.MouseY*PS.Grid.x)];if((PS.MouseX!==PS.LastX)||(PS.MouseY!==PS.LastY)){if(PS.Leave){if(PS.LastX>=0){e=PS.Grid.beads[PS.LastX+(PS.LastY*PS.Grid.x)];try{PS.Leave(PS.LastX,PS.LastY,e.data);}catch(d){PS.Oops("PS.Leave() failed ["+d.message+"]");}}}if(PS.Enter){try{PS.Enter(PS.MouseX,PS.MouseY,b.data);}catch(c){PS.Oops("PS.Enter() failed ["+c.message+"]");}}PS.LastX=PS.MouseX;PS.LastY=PS.MouseY;}}else{if(PS.LastX>=0){if(PS.Leave){e=PS.Grid.beads[PS.LastX+(PS.LastY*PS.Grid.x)];try{PS.Leave(PS.LastX,PS.LastY,e.data);}catch(a){PS.Oops("PS.Leave() failed ["+a.message+"]");}}PS.LastX=-1;PS.LastY=-1;}}};PS.MouseOut=function(c){var b;PS.OverCanvas=false;PS.MouseBead=-1;if(PS.Grid&&PS.Leave){if(PS.LastBead>=0){b=PS.Grid.beads[PS.LastBead];try{PS.Leave(b.x,b.y,b.data);}catch(a){PS.Oops("PS.Leave() failed ["+a.message+"]");}}}PS.LastBead=-1;};PS.LegalKey=function(a){if((a===91)||(a===93)){return false;}if((a>=32)||(a===27)||(a===9)){return true;}return false;};PS.KeyFilter=function(b,a){if((b>=65)&&(b<=90)){if(a){b+=32;}return b;}switch(b){case 33:b=PS.KEY_PAGE_UP;break;case 34:b=PS.KEY_PAGE_DOWN;break;case 35:b=PS.KEY_END;break;case 36:b=PS.KEY_HOME;break;case 37:b=PS.ARROW_LEFT;break;case 38:b=PS.ARROW_UP;break;case 39:b=PS.ARROW_RIGHT;break;case 40:b=PS.ARROW_DOWN;break;case 45:b=PS.KEY_INSERT;break;case 46:b=PS.KEY_DELETE;break;case 188:b=44;break;case 190:b=46;break;case 191:b=47;break;case 192:b=96;break;case 222:b=39;break;case 219:b=91;break;case 221:b=93;break;case 220:b=92;break;default:break;}if(a){switch(b){case 96:b=126;break;case 49:b=33;break;case 50:b=64;break;case 51:b=35;break;case 52:b=36;break;case 53:b=37;break;case 54:b=94;break;case 55:b=38;break;case 56:b=42;break;case 57:b=40;break;case 48:b=41;break;case 45:b=95;break;case 61:b=43;break;case 91:b=123;break;case 93:b=125;break;case 92:b=124;break;case 59:b=58;break;case 39:b=34;break;case 44:b=60;break;case 46:b=62;break;case 47:b=63;break;default:break;}}return b;};PS.SysKeyDown=function(c){var a;if(PS.DebugFocus){c.returnValue=true;return true;}if(PS.KeyDown){c.returnValue=false;if(!c.which){a=c.keyCode;}else{a=c.which;}if(PS.LegalKey(a)){PS.HoldShift=c.shiftKey;PS.HoldCtrl=c.ctrlKey;if(!PS.Pressed[a]){a=PS.KeyFilter(a,c.shiftKey);PS.Pressed[a]=1;if(PS.Holding.length<1){PS.KeyDelay=PS.KEY_RATE*5;}if(PS.Holding.indexOf(a)<0){PS.Holding.push(a);}try{PS.KeyDown(a,c.shiftKey,c.ctrlKey);}catch(b){PS.Oops("PS.KeyDown() failed ["+b.message+"]");}}}}return false;};PS.SysKeyUp=function(d){var b,a;if(PS.KeyUp){d.returnValue=false;if(d.which===null){b=d.keyCode;}else{b=d.which;}if(PS.LegalKey(b)){b=PS.KeyFilter(b,d.shiftKey);PS.Pressed[b]=0;a=PS.Holding.indexOf(b);if(a>=0){PS.Holding.splice(a,1);}if(PS.Holding.length<1){PS.KeyDelay=0;PS.HoldShift=0;PS.HoldCtrl=0;}try{PS.KeyUp(b,d.shiftKey,d.ctrlKey);}catch(c){PS.Oops("PS.KeyUp() failed ["+c.message+"]");}}}return false;};PS.SysWheel=function(b){var c;if(!PS.OverCanvas){b.returnValue=true;return true;}if(PS.Wheel){c=0;if(!b){b=window.event;}if(b.wheelDelta){c=b.wheelDelta/120;if(window.opera){c=-c;}}else{if(b.detail){c=-(b.detail/3);}}if(b.preventDefault){b.preventDefault();}if(c>=PS.FORWARD){c=PS.FORWARD;}else{c=PS.BACKWARD;}try{PS.Wheel(c);}catch(a){PS.Oops("PS.Wheel() failed ["+a.message+"]");}}b.returnValue=false;};PS.DefaultEvent=function(a){a.returnValue=true;};PS.Random=function(b){var a;a="[PS.Random] ";if(typeof b!=="number"){return PS.Oops(a+"Parameter is not a number");}b=Math.floor(b);if(b<2){return 1;}b=Math.random()*b;b=Math.floor(b)+1;return b;};PS.PianoFiles=["a0","bb0","b0","c1","db1","d1","eb1","e1","f1","gb1","g1","ab1","a1","bb1","b1","c2","db2","d2","eb2","e2","f2","gb2","g2","ab2","a2","bb2","b2","c3","db3","d3","eb3","e3","f3","gb3","g3","ab3","a3","bb3","b3","c4","db4","d4","eb4","e4","f4","gb4","g4","ab4","a4","bb4","b4","c5","db5","d5","eb5","e5","f5","gb5","g5","ab5","a5","bb5","b5","c6","db6","d6","eb6","e6","f6","gb6","g6","ab6","a6","bb6","b6","c7","db7","d7","eb7","e7","f7","gb7","g7","ab7","a7","bb7","b7","c8"];PS.Piano=function(d,a){var b,c;b="[PS.Piano] ";if(typeof d!=="number"){return PS.Oops(b+"Parameter is not a number");}d=Math.floor(d);if(d<1){d=1;}else{if(d>88){d=88;}}c="piano_"+PS.PianoFiles[d-1];if(a){c="l_"+c;}return c;};PS.HchordFiles=["a2","bb2","b2","c3","db3","d3","eb3","e3","f3","gb3","g3","ab3","a3","bb3","b3","c4","db4","d4","eb4","e4","f4","gb4","g4","ab4","a4","bb4","b4","c5","db5","d5","eb5","e5","f5","gb5","g5","ab5","a5","bb5","b5","c6","db6","d6","eb6","e6","f6","gb6","g6","ab6","a6","bb6","b6","c7","db7","d7","eb7","e7","f7"];PS.Harpsichord=function(d,a){var b,c;b="[PS.Harpsichord] ";if(typeof d!=="number"){return PS.Oops(b+"Parameter is not a number");}d=Math.floor(d);if(d<1){d=1;}else{if(d>57){d=57;}}c="hchord_"+PS.HchordFiles[d-1];if(a){c="l_"+c;}return c;};PS.XyloFiles=["a4","bb4","b4","c5","db5","d5","eb5","e5","f5","gb5","g5","ab5","a5","bb5","b5","c6","db6","d6","eb6","e6","f6","gb6","g6","ab6","a6","bb6","b6","c7","db7","d7","eb7","e7","f7","gb7","g7","ab7","a7","bb7","b7"];PS.Xylophone=function(c){var a,b;a="[PS.Xylophone] ";if(typeof c!=="number"){return PS.Oops(a+"Parameter is not a number");}c=Math.floor(c);if(c<1){c=1;}else{if(c>39){c=39;}}b="xylo_"+PS.XyloFiles[c-1];return b;};PS.ImageError=function(a){PS.Debug("[PS.ImageLoad] Error loading "+this.src);};PS.DoImageLoad=function(){var a,g,f,e,b,j,c,h;a=this.getAttribute("data-id");g=PS.LoaderList.length;f=0;while(f=F)||((R+J)<0)){return true;}}if((s===undefined)||(s===PS.DEFAULT)){s=0;}else{if(typeof s!=="number"){return PS.Oops(D+"ypos parameter not a number");}s=Math.floor(s);if((s>=l)||((s+T)<0)){return true;}}if(m===undefined){o=0;m=0;c=J;d=T;}else{if(typeof m!=="number"){return PS.Oops(D+"left parameter not a number");}m=Math.floor(m);if((m<0)||(m>=J)){return PS.Oops(D+"left parameter outside of image");}if(typeof o!=="number"){return PS.Oops(D+"top parameter not a number");}o=Math.floor(o);if((o<0)||(o>=T)){return PS.Oops(D+"top parameter outside of image");}if(typeof c!=="number"){return PS.Oops(D+"width parameter not a number");}c=Math.floor(c);if(c<1){return true;}if((m+c)>J){return PS.Oops(D+"left + width exceeds image width");}if(typeof d!=="number"){return PS.Oops(D+"height parameter not a number");}d=Math.floor(d);if(d<1){return true;}if((o+d)>T){return PS.Oops(D+"top + height exceeds image height");}}p=F-R;if(c>p){c=p;}A=l-s;if(d>A){d=A;}E=(J*C);z=PS.Grid.beadSize;p=z*c;A=z*d;PS.BlitCanvas.width=p;PS.BlitCanvas.height=A;B=PS.BlitContext;B.font=PS.Grid.glyphSize;B.textAlign="center";B.textBaseline="middle";u=(o*E)+(m*C);e=s;for(G=0;G0){S=f+(e*F);P=PS.Grid.beads[S];P.empty=false;if(X0){B.fillStyle=P.borderColor;B.fillRect(K,I,O,O);K+=L;I+=L;O-=(L+L);}B.fillStyle=P.colorNow;B.fillRect(K,I,O,O);if(P.glyph>0){B.fillStyle=P.glyphColor;B.fillText(P.glyphStr,k+PS.Grid.glyphX,j+PS.Grid.glyphY);}}else{B.fillStyle=PS.Grid.bgColor;B.fillRect(K,I,O,O);}}f+=1;Y+=C;}e+=1;u+=E;}PS.Grid.context.drawImage(PS.BlitCanvas,z*R,z*s);return true;};PS.AudioError=function(a){var d,b;d=a.target.error.code;switch(d){case 1:b="Playback aborted";break;case 2:b="Network failure";break;case 3:b="Source decode failed";break;case 4:b="Invalid source file";break;default:b="Unknown";break;}return PS.Oops("HTML5 audio error "+d+" ("+b+")");};PS.AudioLoaded=function(c){var a,b;a=this.getAttribute("data-channel");b=PS.AudioChannels[a];b.status=PS.CH_READY;if(b.playNow){b.playNow=false;PS.PlayHTML5Audio(a,undefined,undefined,undefined);}};PS.AudioEnding=function(e){var a,d,c;a=this.getAttribute("data-channel");d=PS.AudioChannels[a];d.status=PS.CH_READY;c=d.exec;if(c&&(typeof c==="function")){try{d.exec=null;c(d.data);}catch(b){PS.Oops("Audio function error ["+b.message+"]");}}};PS.AudioInit=function(){var c,b,a;c="[PS.AudioInit] ";if(!document.createElement("audio").canPlayType){PS.Oops(c+"HTML5 audio not supported");return false;}PS.AudioContext=null;PS.AudioCurrentPath=PS.D_AUDIO_PATH;if(!PS.AudioContext){PS.ChannelsUsed=0;PS.AudioChannels.length=PS.AUDIO_MAX_CH;for(b=0;bPS.MAX_VOL){e=PS.MAX_VOL;}}}if(!b||(b===PS.DEFAULT)){b=null;}else{if(typeof b!=="function"){return PS.Oops(g+"Func parameter not a valid function");}}if((j===undefined)||(j===PS.CURRENT)){j=PS.AudioCurrentPath;}else{if(j===PS.DEFAULT){j=PS.D_AUDIO_PATH;}else{if(typeof j!=="string"){return PS.Oops(g+"Path parameter not a valid string");}}}if(!PS.AudioContext){h=j+a+".wav";for(d=0;dPS.AUDIO_MAX_CH)){return PS.Oops(a+"Invalid channel id");}b=PS.AudioChannels[d-1];b.audio.pause();b.audio.currentTime=0;b.status=PS.CH_READY;return d;}};PS.AudioPause=function(e){var a,d,b;a="[PS.AudioPause] ";if(typeof e!=="number"){return PS.Oops(a+"Parameter is not a number");}e=Math.floor(e);if(!PS.AudioContext){if((e<1)||(e>PS.AUDIO_MAX_CH)){return PS.Oops(a+"Invalid channel id ["+e+"]");}d=PS.AudioChannels[e-1];b=d.audio;if(b.paused){PS.PlayHTML5Audio(e-1,undefined,undefined,undefined);}else{d.status=PS.CH_PAUSED;b.pause();}return e;}};PS.LoadChannel=function(c,g,f,e,h,b){var d,a;d=PS.AudioChannels[c];d.id=g;if(f!==undefined){d.volume=f;}else{d.volume=PS.D_VOL;}if(e){d.exec=e;}else{d.exec=null;}if(h!==undefined){d.data=h;}else{d.data=d.num;}if(b){d.playNow=true;}else{d.playNow=false;}a=d.audio;a.addEventListener("error",PS.AudioError,false);a.addEventListener("canplaythrough",PS.AudioLoaded,false);a.addEventListener("ended",PS.AudioEnding,false);a.preload="auto";a.volume=d.volume;a.setAttribute("src",g);d.status=PS.CH_LOADING;};PS.LoadHTML5Audio=function(g,f,e,h,a){var c,d,b;c="[PS.LoadHTML5Audio] ";for(b=0;b