summaryrefslogtreecommitdiff
path: root/application.macosx
diff options
context:
space:
mode:
authorNæþ'n Lasseter <Næþ'n Lasseter nathan@bytemark.co.uk>2016-03-30 15:47:29 +0100
committerNæþ'n Lasseter <Næþ'n Lasseter nathan@bytemark.co.uk>2016-03-30 15:47:29 +0100
commit47e6af7301cfd73a8c7a4f8480e86dc7cdc57c4d (patch)
treeade3c7d88715452069458c8f08e59f4a4ce06088 /application.macosx
first commitHEADmaster
Diffstat (limited to 'application.macosx')
-rw-r--r--application.macosx/KeyboardDefense.app/Contents/Info.plist70
-rw-r--r--application.macosx/KeyboardDefense.app/Contents/MacOS/JavaApplicationStubbin0 -> 61376 bytes
-rw-r--r--application.macosx/KeyboardDefense.app/Contents/PkgInfo1
-rw-r--r--application.macosx/KeyboardDefense.app/Contents/Resources/Java/KeyboardDefense.jarbin0 -> 3598 bytes
-rw-r--r--application.macosx/KeyboardDefense.app/Contents/Resources/Java/core.jarbin0 -> 572015 bytes
-rw-r--r--application.macosx/KeyboardDefense.app/Contents/Resources/Java/gluegen-rt-natives-macosx-universal.jarbin0 -> 3975 bytes
-rw-r--r--application.macosx/KeyboardDefense.app/Contents/Resources/Java/gluegen-rt.jarbin0 -> 248411 bytes
-rw-r--r--application.macosx/KeyboardDefense.app/Contents/Resources/Java/jogl-all-natives-macosx-universal.jarbin0 -> 332048 bytes
-rw-r--r--application.macosx/KeyboardDefense.app/Contents/Resources/Java/jogl-all.jarbin0 -> 4803414 bytes
-rw-r--r--application.macosx/KeyboardDefense.app/Contents/Resources/sketch.icnsbin0 -> 68094 bytes
-rw-r--r--application.macosx/source/KeyboardDefense.java264
-rw-r--r--application.macosx/source/KeyboardDefense.pde239
12 files changed, 574 insertions, 0 deletions
diff --git a/application.macosx/KeyboardDefense.app/Contents/Info.plist b/application.macosx/KeyboardDefense.app/Contents/Info.plist
new file mode 100644
index 0000000..e82f80a
--- /dev/null
+++ b/application.macosx/KeyboardDefense.app/Contents/Info.plist
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+ <dict>
+ <key>CFBundleName</key>
+ <string>KeyboardDefense</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>CFBundleAllowMixedLocalizations</key>
+ <string>true</string>
+ <key>CFBundleExecutable</key>
+ <string>JavaApplicationStub</string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleIconFile</key>
+ <string>sketch.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>KeyboardDefense</string>
+
+ <!-- http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/PListKeys.html#//apple_ref/doc/uid/20001431-113616 -->
+ <key>LSUIPresentationMode</key>
+ <integer>0</integer>
+
+ <key>LSArchitecturePriority</key>
+ <array>
+ <string>x86_64</string>
+ <string>i386</string>
+ </array>
+
+ <key>Java</key>
+ <dict>
+ <key>VMOptions</key>
+ <string></string>
+
+ <key>MainClass</key>
+ <string>KeyboardDefense</string>
+
+ <key>JVMVersion</key>
+ <string>1.6*</string>
+
+ <key>ClassPath</key>
+ <string>$JAVAROOT/KeyboardDefense.jar:$JAVAROOT/core.jar:$JAVAROOT/jogl-all.jar:$JAVAROOT/gluegen-rt.jar:$JAVAROOT/jogl-all-natives-macosx-universal.jar:$JAVAROOT/gluegen-rt-natives-macosx-universal.jar</string>
+
+ <!-- http://developer.apple.com/releasenotes/Java/java141/system_properties/chapter_4_section_1.html#//apple_ref/doc/uid/TP30000285 -->
+ <key>Properties</key>
+ <dict>
+ <key>apple.laf.useScreenMenuBar</key>
+ <string>true</string>
+ <key>apple.awt.showGrowBox</key>
+ <string>false</string>
+ <key>com.apple.smallTabs</key>
+ <string>true</string>
+ <key>apple.awt.Antialiasing</key>
+ <string>false</string>
+ <key>apple.awt.TextAntialiasing</key>
+ <string>true</string>
+ <key>com.apple.hwaccel</key>
+ <string>true</string>
+ <key>apple.awt.use-file-dialog-packages</key>
+ <string>false</string>
+ </dict>
+ </dict>
+ </dict>
+</plist>
diff --git a/application.macosx/KeyboardDefense.app/Contents/MacOS/JavaApplicationStub b/application.macosx/KeyboardDefense.app/Contents/MacOS/JavaApplicationStub
new file mode 100644
index 0000000..56ec300
--- /dev/null
+++ b/application.macosx/KeyboardDefense.app/Contents/MacOS/JavaApplicationStub
Binary files differ
diff --git a/application.macosx/KeyboardDefense.app/Contents/PkgInfo b/application.macosx/KeyboardDefense.app/Contents/PkgInfo
new file mode 100644
index 0000000..bd04210
--- /dev/null
+++ b/application.macosx/KeyboardDefense.app/Contents/PkgInfo
@@ -0,0 +1 @@
+APPL???? \ No newline at end of file
diff --git a/application.macosx/KeyboardDefense.app/Contents/Resources/Java/KeyboardDefense.jar b/application.macosx/KeyboardDefense.app/Contents/Resources/Java/KeyboardDefense.jar
new file mode 100644
index 0000000..7adc20c
--- /dev/null
+++ b/application.macosx/KeyboardDefense.app/Contents/Resources/Java/KeyboardDefense.jar
Binary files differ
diff --git a/application.macosx/KeyboardDefense.app/Contents/Resources/Java/core.jar b/application.macosx/KeyboardDefense.app/Contents/Resources/Java/core.jar
new file mode 100644
index 0000000..adbffde
--- /dev/null
+++ b/application.macosx/KeyboardDefense.app/Contents/Resources/Java/core.jar
Binary files differ
diff --git a/application.macosx/KeyboardDefense.app/Contents/Resources/Java/gluegen-rt-natives-macosx-universal.jar b/application.macosx/KeyboardDefense.app/Contents/Resources/Java/gluegen-rt-natives-macosx-universal.jar
new file mode 100644
index 0000000..8e506a3
--- /dev/null
+++ b/application.macosx/KeyboardDefense.app/Contents/Resources/Java/gluegen-rt-natives-macosx-universal.jar
Binary files differ
diff --git a/application.macosx/KeyboardDefense.app/Contents/Resources/Java/gluegen-rt.jar b/application.macosx/KeyboardDefense.app/Contents/Resources/Java/gluegen-rt.jar
new file mode 100644
index 0000000..4a5337b
--- /dev/null
+++ b/application.macosx/KeyboardDefense.app/Contents/Resources/Java/gluegen-rt.jar
Binary files differ
diff --git a/application.macosx/KeyboardDefense.app/Contents/Resources/Java/jogl-all-natives-macosx-universal.jar b/application.macosx/KeyboardDefense.app/Contents/Resources/Java/jogl-all-natives-macosx-universal.jar
new file mode 100644
index 0000000..ec11e7f
--- /dev/null
+++ b/application.macosx/KeyboardDefense.app/Contents/Resources/Java/jogl-all-natives-macosx-universal.jar
Binary files differ
diff --git a/application.macosx/KeyboardDefense.app/Contents/Resources/Java/jogl-all.jar b/application.macosx/KeyboardDefense.app/Contents/Resources/Java/jogl-all.jar
new file mode 100644
index 0000000..58e6958
--- /dev/null
+++ b/application.macosx/KeyboardDefense.app/Contents/Resources/Java/jogl-all.jar
Binary files differ
diff --git a/application.macosx/KeyboardDefense.app/Contents/Resources/sketch.icns b/application.macosx/KeyboardDefense.app/Contents/Resources/sketch.icns
new file mode 100644
index 0000000..6dc82bc
--- /dev/null
+++ b/application.macosx/KeyboardDefense.app/Contents/Resources/sketch.icns
Binary files differ
diff --git a/application.macosx/source/KeyboardDefense.java b/application.macosx/source/KeyboardDefense.java
new file mode 100644
index 0000000..0e44c63
--- /dev/null
+++ b/application.macosx/source/KeyboardDefense.java
@@ -0,0 +1,264 @@
+import processing.core.*;
+import processing.data.*;
+import processing.event.*;
+import processing.opengl.*;
+
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.io.File;
+import java.io.BufferedReader;
+import java.io.PrintWriter;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.IOException;
+
+public class KeyboardDefense extends PApplet {
+
+int[][] stars;
+int starcount;
+char[][] board = {
+ {'Q','W','E','R','T','Y','U','I','O','P'},
+ {'A','S','D','F','G','H','J','K','L',' '},
+ {'Z','X','C','V','B','N','M',' ',' ',' '}
+};
+
+int starsize = 5;
+int boardsize = 28;
+
+int score, level;
+boolean playing;
+
+int[][] keyCoords = {
+ {0, 1}, //a
+ {4, 2}, //b
+ {2, 2}, //c
+ {2, 1}, //d
+ {2, 0}, //e
+ {3, 1}, //f
+ {4, 1}, //g
+ {5, 1}, //h
+ {7, 0}, //i
+ {6, 1}, //j
+ {7, 1}, //k
+ {8, 1}, //l
+ {6, 2}, //m
+ {5, 2}, //n
+ {8, 0}, //o
+ {9, 0}, //p
+ {0, 0}, //q
+ {3, 0}, //r
+ {1, 1}, //s
+ {4, 0}, //t
+ {6, 0}, //u
+ {3, 2}, //v
+ {1, 0}, //w
+ {1, 2}, //x
+ {5, 0}, //y
+ {0, 2} //z
+};
+
+int[] cols = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
+ 20, 21, 22, 24, 25, 27
+};
+
+int[] baseKeyColours = {
+ 0xffFFFFFF, 0xffFFFFFF, 0xffFFFFFF, 0xffFFFFFF, 0xffFFFFFF,
+ 0xffFFFFFF, 0xffFFFFFF, 0xffFFFFFF, 0xffFFFFFF, 0xffFFFFFF,
+ 0xffFFFFFF, 0xffFFFFFF, 0xffFFFFFF, 0xffFFBBBB, 0xffFFFFFF,
+ 0xffFFFFFF, 0xffFFBBBB, 0xffFFFFFF, 0xffFFFFFF, 0xffFFFFFF,
+ 0xffFFFFFF, 0xffFFFFFF, 0xffFFFFFF, 0xffFFFFFF, 0xffFFFFFF, 0xffFFFFFF
+};
+
+int[] keyColours;
+
+int keyMap[] = {
+ 10, 23, 21, 12, 2,
+ 13, 14, 15, 7, 16,
+ 17, 18, 25, 24, 8,
+ 9, 0, 3, 11, 4,
+ 6, 22, 1, 20, 5, 19
+};
+
+long time, startime;
+
+public void setup() {
+ size(784, 612);
+ stars = new int[100][2];
+ keyColours = new int[26];
+ starcount = 0;
+ score = 0;
+ level = 5000;
+ playing = true;
+ textFont(createFont("FreeMono Bold", 20));
+ genStar();
+ startime = time = millis();
+}
+
+public void makeStar(int[] star) {
+ line(
+ star[0] - starsize, star[1] - starsize,
+ star[0] + starsize, star[1] + starsize
+ );
+ line(
+ star[0] - starsize, star[1] + starsize,
+ star[0] + starsize, star[1] - starsize
+ );
+}
+
+public void makeBoard() {
+ noStroke();
+ for(int i = 0; i < 28; i+=2) {
+ fill(0xffCCCCCC);
+ rect(i*boardsize, 0, boardsize, 612);
+ fill(0xffAAAAAA);
+ rect(i*boardsize + boardsize, 0, boardsize, 612);
+ }
+ for(int i = 0; i < 28; i+=2) {
+ fill(0xffEEEEEE);
+ rect(i*boardsize, 500, boardsize, 84);
+ fill(0xffCCCCCC);
+ rect(i*boardsize + boardsize, 500, boardsize, 84);
+ }
+
+ stroke(0xff000000);
+ int box = 0;
+ for(int i = 0; i < 10; i++) {
+ fill(keyColours[box]);
+ rect(i*3*boardsize, 500, boardsize, boardsize);
+ fill(0xff000000);
+ text(board[0][i], (i*3*boardsize)+2, 500+15);
+ box++;
+ }
+ for(int i = 0; i < 9; i++) {
+ fill(keyColours[box]);
+ rect((i*3*boardsize)+boardsize, 500+boardsize, boardsize, boardsize);
+ fill(0xff000000);
+ text(board[1][i], (i*3*boardsize)+boardsize+2, 500+boardsize+15);
+ box++;
+ }
+ for(int i = 0; i < 7; i++) {
+ fill(keyColours[box]);
+ rect((i*3*boardsize)+(2*boardsize), 500+(2*boardsize), boardsize, boardsize);
+ fill(0xff000000);
+ text(board[2][i], (i*3*boardsize)+(2*boardsize)+2, 500+(2*boardsize)+15);
+ box++;
+ }
+
+ for (int i = 0; i < 26; i++)
+ keyColours[i] = baseKeyColours[i];
+}
+
+public void makeScore() {
+ text("Score: " + score, 644, 610);
+}
+
+public void genStar() {
+ int col = cols[PApplet.parseInt(random(26))];
+ stars[starcount][0] = (col*boardsize) + (boardsize/2);
+ stars[starcount][1] = 0;
+ starcount++;
+}
+
+public void checkFallen() {
+ for (int i = 0; i < starcount; i++)
+ if (stars[i][1] > 600)
+ gameOver();
+}
+
+public void gameOver() {
+ stars = new int[100][2];
+ starcount = 0;
+ playing = false;
+}
+
+public void makeGOScreen() {
+ clear();
+ background(0xffCCCCCC);
+ fill(0xff000000);
+ text("GAME OVER", 350, 300);
+ text("Score: " + score, 350, 330);
+}
+
+public void draw() {
+ if (playing) {
+ checkFallen();
+
+ clear();
+ background(0xffCCCCCC);
+
+ if (millis() > (startime + level) && playing) {
+ genStar();
+ startime = millis();
+ }
+
+ if (millis() > time) {
+ for(int i = 0; i < starcount; i++)
+ stars[i][1] += 1;
+ time = millis();
+ }
+
+ makeBoard();
+
+ for(int i = 0; i < starcount; i++)
+ makeStar(stars[i]);
+
+ makeScore();
+ } else {
+ makeGOScreen();
+ }
+}
+
+public void shiftStars(int star) {
+ for (int i = star; i < starcount; i++) {
+ stars[i][0] = stars[i+1][0];
+ stars[i][1] = stars[i+1][1];
+ }
+ starcount--;
+}
+
+public int checkStars(int keyIndex) {
+ int sc = -1;
+ int
+ l = keyCoords[keyIndex][0]*3*boardsize + (keyCoords[keyIndex][1]*boardsize),
+ r = (keyCoords[keyIndex][0]*3*boardsize) + (keyCoords[keyIndex][1]*boardsize) + boardsize,
+ t = 500 + (keyCoords[keyIndex][1]*boardsize),
+ b = 500 + (keyCoords[keyIndex][1]*boardsize) + boardsize;
+
+ for (int i = 0; i < starcount; i++)
+ if(stars[i][0] > l && stars[i][0] < r) {
+ if(stars[i][1] > 500 && stars[i][1] < 584) {
+ if(stars[i][1] > t && stars[i][1] < b)
+ sc = 2;
+ else
+ sc = 1;
+ shiftStars(i);
+ level -= (level == 1000 ? 0 : 100);
+ }
+ }
+
+ return sc;
+}
+
+public void keyPressed() {
+ int keyIndex = -1;
+ if (key >= 'A' && key <= 'Z') {
+ keyIndex = key - 'A';
+ } else if (key >= 'a' && key <= 'z') {
+ keyIndex = key - 'a';
+ }
+ if (keyIndex != -1) {
+ score += checkStars(keyIndex);
+ keyColours[keyMap[keyIndex]] = 0xff00FF00;
+ }
+}
+ static public void main(String[] passedArgs) {
+ String[] appletArgs = new String[] { "KeyboardDefense" };
+ if (passedArgs != null) {
+ PApplet.main(concat(appletArgs, passedArgs));
+ } else {
+ PApplet.main(appletArgs);
+ }
+ }
+}
diff --git a/application.macosx/source/KeyboardDefense.pde b/application.macosx/source/KeyboardDefense.pde
new file mode 100644
index 0000000..01e9400
--- /dev/null
+++ b/application.macosx/source/KeyboardDefense.pde
@@ -0,0 +1,239 @@
+int[][] stars;
+int starcount;
+char[][] board = {
+ {'Q','W','E','R','T','Y','U','I','O','P'},
+ {'A','S','D','F','G','H','J','K','L',' '},
+ {'Z','X','C','V','B','N','M',' ',' ',' '}
+};
+
+int starsize = 5;
+int boardsize = 28;
+
+int score, level;
+boolean playing;
+
+int[][] keyCoords = {
+ {0, 1}, //a
+ {4, 2}, //b
+ {2, 2}, //c
+ {2, 1}, //d
+ {2, 0}, //e
+ {3, 1}, //f
+ {4, 1}, //g
+ {5, 1}, //h
+ {7, 0}, //i
+ {6, 1}, //j
+ {7, 1}, //k
+ {8, 1}, //l
+ {6, 2}, //m
+ {5, 2}, //n
+ {8, 0}, //o
+ {9, 0}, //p
+ {0, 0}, //q
+ {3, 0}, //r
+ {1, 1}, //s
+ {4, 0}, //t
+ {6, 0}, //u
+ {3, 2}, //v
+ {1, 0}, //w
+ {1, 2}, //x
+ {5, 0}, //y
+ {0, 2} //z
+};
+
+int[] cols = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
+ 20, 21, 22, 24, 25, 27
+};
+
+int[] baseKeyColours = {
+ #FFFFFF, #FFFFFF, #FFFFFF, #FFFFFF, #FFFFFF,
+ #FFFFFF, #FFFFFF, #FFFFFF, #FFFFFF, #FFFFFF,
+ #FFFFFF, #FFFFFF, #FFFFFF, #FFBBBB, #FFFFFF,
+ #FFFFFF, #FFBBBB, #FFFFFF, #FFFFFF, #FFFFFF,
+ #FFFFFF, #FFFFFF, #FFFFFF, #FFFFFF, #FFFFFF, #FFFFFF
+};
+
+int[] keyColours;
+
+int keyMap[] = {
+ 10, 23, 21, 12, 2,
+ 13, 14, 15, 7, 16,
+ 17, 18, 25, 24, 8,
+ 9, 0, 3, 11, 4,
+ 6, 22, 1, 20, 5, 19
+};
+
+long time, startime;
+
+void setup() {
+ size(784, 612);
+ stars = new int[100][2];
+ keyColours = new int[26];
+ starcount = 0;
+ score = 0;
+ level = 5000;
+ playing = true;
+ textFont(createFont("FreeMono Bold", 20));
+ genStar();
+ startime = time = millis();
+}
+
+void makeStar(int[] star) {
+ line(
+ star[0] - starsize, star[1] - starsize,
+ star[0] + starsize, star[1] + starsize
+ );
+ line(
+ star[0] - starsize, star[1] + starsize,
+ star[0] + starsize, star[1] - starsize
+ );
+}
+
+void makeBoard() {
+ noStroke();
+ for(int i = 0; i < 28; i+=2) {
+ fill(#CCCCCC);
+ rect(i*boardsize, 0, boardsize, 612);
+ fill(#AAAAAA);
+ rect(i*boardsize + boardsize, 0, boardsize, 612);
+ }
+ for(int i = 0; i < 28; i+=2) {
+ fill(#EEEEEE);
+ rect(i*boardsize, 500, boardsize, 84);
+ fill(#CCCCCC);
+ rect(i*boardsize + boardsize, 500, boardsize, 84);
+ }
+
+ stroke(#000000);
+ int box = 0;
+ for(int i = 0; i < 10; i++) {
+ fill(keyColours[box]);
+ rect(i*3*boardsize, 500, boardsize, boardsize);
+ fill(#000000);
+ text(board[0][i], (i*3*boardsize)+2, 500+15);
+ box++;
+ }
+ for(int i = 0; i < 9; i++) {
+ fill(keyColours[box]);
+ rect((i*3*boardsize)+boardsize, 500+boardsize, boardsize, boardsize);
+ fill(#000000);
+ text(board[1][i], (i*3*boardsize)+boardsize+2, 500+boardsize+15);
+ box++;
+ }
+ for(int i = 0; i < 7; i++) {
+ fill(keyColours[box]);
+ rect((i*3*boardsize)+(2*boardsize), 500+(2*boardsize), boardsize, boardsize);
+ fill(#000000);
+ text(board[2][i], (i*3*boardsize)+(2*boardsize)+2, 500+(2*boardsize)+15);
+ box++;
+ }
+
+ for (int i = 0; i < 26; i++)
+ keyColours[i] = baseKeyColours[i];
+}
+
+void makeScore() {
+ text("Score: " + score, 644, 610);
+}
+
+void genStar() {
+ int col = cols[int(random(26))];
+ stars[starcount][0] = (col*boardsize) + (boardsize/2);
+ stars[starcount][1] = 0;
+ starcount++;
+}
+
+void checkFallen() {
+ for (int i = 0; i < starcount; i++)
+ if (stars[i][1] > 600)
+ gameOver();
+}
+
+void gameOver() {
+ stars = new int[100][2];
+ starcount = 0;
+ playing = false;
+}
+
+void makeGOScreen() {
+ clear();
+ background(#CCCCCC);
+ fill(#000000);
+ text("GAME OVER", 350, 300);
+ text("Score: " + score, 350, 330);
+}
+
+void draw() {
+ if (playing) {
+ checkFallen();
+
+ clear();
+ background(#CCCCCC);
+
+ if (millis() > (startime + level) && playing) {
+ genStar();
+ startime = millis();
+ }
+
+ if (millis() > time) {
+ for(int i = 0; i < starcount; i++)
+ stars[i][1] += 1;
+ time = millis();
+ }
+
+ makeBoard();
+
+ for(int i = 0; i < starcount; i++)
+ makeStar(stars[i]);
+
+ makeScore();
+ } else {
+ makeGOScreen();
+ }
+}
+
+void shiftStars(int star) {
+ for (int i = star; i < starcount; i++) {
+ stars[i][0] = stars[i+1][0];
+ stars[i][1] = stars[i+1][1];
+ }
+ starcount--;
+}
+
+int checkStars(int keyIndex) {
+ int sc = -1;
+ int
+ l = keyCoords[keyIndex][0]*3*boardsize + (keyCoords[keyIndex][1]*boardsize),
+ r = (keyCoords[keyIndex][0]*3*boardsize) + (keyCoords[keyIndex][1]*boardsize) + boardsize,
+ t = 500 + (keyCoords[keyIndex][1]*boardsize),
+ b = 500 + (keyCoords[keyIndex][1]*boardsize) + boardsize;
+
+ for (int i = 0; i < starcount; i++)
+ if(stars[i][0] > l && stars[i][0] < r) {
+ if(stars[i][1] > 500 && stars[i][1] < 584) {
+ if(stars[i][1] > t && stars[i][1] < b)
+ sc = 2;
+ else
+ sc = 1;
+ shiftStars(i);
+ level -= (level == 1000 ? 0 : 100);
+ }
+ }
+
+ return sc;
+}
+
+void keyPressed() {
+ int keyIndex = -1;
+ if (key >= 'A' && key <= 'Z') {
+ keyIndex = key - 'A';
+ } else if (key >= 'a' && key <= 'z') {
+ keyIndex = key - 'a';
+ }
+ if (keyIndex != -1) {
+ score += checkStars(keyIndex);
+ keyColours[keyMap[keyIndex]] = #00FF00;
+ }
+}