This is a great educationel game that not only teaches kids how to type, but also introduces kids to new animals and how to spell their names.
The showcase player uses a modified version of Processing.js in combination with jsweet to let students program their apps in Java code while still allowing for browser support.
Content created by students is scaled to fit the showcase frame while maintaining aspect ratio and cursor position. This is why some projects may appear blurry in fullscreen, or why some small details may not be visible on a small screen
<iframe width='500px' height='400px' src='https://nest.ktbyte.com/nest#223' allowfullscreen></iframe>
boolean mainPage = true; boolean losePage = false; boolean warning = false; boolean loseLifeAbility = true; boolean gamePage = false; String[] animalSelection = { "cat", "dog", "owl", "pig", "cow", "camel", "turtle", "zebra", "whale", "moose", "giraffe", "squirrel", "dolphin", "cheetah", "platypus", "elephant", "kangaroo", "rhino", "hippo" }; int chooser = int(random(0, 5)); int lastPick = 0; String animal; int index = 0; int life = 3; int timer = 90; int score = 0; int barShrink = 600; PImage[] imgs = new PImage[19]; void setup() { size(600, 600); imgs[0] = loadImage("http://openclipart.org/image/300px/svg_to_png/8392/Gerald_G_Cartoon_Cat.png"); imgs[1] = loadImage("http://i.imgur.com/dSVEXKX.png?1"); imgs[2] = loadImage("http://i.imgur.com/tsvSMMV.png"); imgs[3] = loadImage("http://www.cutevector.com/incl/data/big/0512-cute-pig-cartoon-vector-clipart.jpg"); imgs[4] = loadImage("http://i.imgur.com/tlqz07k.jpg?1"); imgs[5] = loadImage("http://i.imgur.com/Ozu7oZ8.jpg?1"); imgs[6] = loadImage("http://i.imgur.com/4tvpMO3.gif?1"); imgs[7] = loadImage("http://i.imgur.com/M3KdXex.png?1"); imgs[8] = loadImage("http://i.imgur.com/Rff2q8Q.png?1"); imgs[9] = loadImage("http://www.smiling-moose.com/images/upload/funny%20moose%202.jpg"); imgs[10] = loadImage("http://i.imgur.com/DLbcchd.png?1"); imgs[11] = loadImage("http://i.imgur.com/B0pyOQe.png?1"); imgs[12] = loadImage("http://i.imgur.com/jaQV4jw.png?1"); imgs[13] = loadImage("http://i.imgur.com/WmBSn5N.png?1"); imgs[14] = loadImage("http://i.imgur.com/Y5ftC4S.png?1"); imgs[15] = loadImage("http://i.imgur.com/dwLCWYV.jpg?1"); imgs[16] = loadImage("http://i.imgur.com/dWMfCAq.png?1"); imgs[17] = loadImage("http://i.imgur.com/adk6AJf.jpg?1"); imgs[18] = loadImage("http://i.imgur.com/ntS4psF.png?1"); } void draw() { background(255); if (mainPage == true) { textSize(20); fill(255, 10, 0); text("Instructions: Type the name of the animal that is displayed.", 40, 150); textSize(20); fill(0, 50, 255); text("Note: The game is not case sensitive.", 125, 250); textSize(32); fill(38, 164, 6); text("Press enter to play!", 150, 450); if (keyPressed && key == 10) { mainPage = false; gamePage = true; } } if (gamePage == true) { imageMode(CENTER); textSize(20); fill(0, 50, 255); text("Score: "+score, 10, 22); fill(38, 164, 6); text("Lives: "+life, 10, 46); rect(-1, 590, barShrink-=3, 10); animal = animalSelection[chooser]; if (score < 51 || score > 151) { if (chooser == 0) { image(imgs[0], 300, 300); } if (chooser == 1) { image(imgs[1], 300, 300, width/2, height/2); } if (chooser == 2) { image(imgs[2], 300, 300, width/2, height/2); } if (chooser == 3) { image(imgs[3], 300, 300, width/1.5, height/2); } if (chooser == 4) { image(imgs[4], 300, 300, width/2, height/2); } } if ((score > 51 && score < 101) || score > 151) { if (chooser == 5) { image(imgs[5], 300, 300); } if (chooser == 6) { image(imgs[6], 300, 300); } if (chooser == 7) { image(imgs[7], 300, 300); } if (chooser == 8) { image(imgs[8], 300, 300); } if (chooser == 9) { image(imgs[9], 300, 300); } } if ((score > 101 && score < 151) || score > 151) { if (chooser == 10) { image(imgs[10], 300, 300); } if (chooser == 11) { image(imgs[11], 300, 300); } if (chooser == 12) { image(imgs[12], 300, 300); } if (chooser == 13) { image(imgs[13], 300, 300); } if (chooser == 14) { image(imgs[14], 300, 300); } } if (score > 151) { if (chooser == 15) { image(imgs[15], 300, 300); } if (chooser == 16) { image(imgs[16], 300, 300); } if (chooser == 17) { image(imgs[17], 300, 300); } } if (warning == true) { timer--; textSize(20); fill(218, 21, 21); text("-1", 85, 46); loseLifeAbility = false; if (timer <= 0) { warning = false; timer = 90; loseLifeAbility = true; } } if (barShrink <= 0) { if (loseLifeAbility == true) { life--; } warning = true; barShrink = 600; } if (life <= 0) { losePage = true; gamePage = false; chooser = int(random(0, 5)); } } if (losePage == true) { textSize(50); fill(255, 10, 0); text("GameOver :-(", 130, 200); textSize(32); fill(38, 164, 6); text("Press space to play again!", 105, 350); if (keyPressed && key == 32) { mainPage = true; losePage = false; warning = false; life = 3; score = 0; barShrink = 600; } } } void keyPressed() { if (gamePage == true) { if (int(key) >= int('a') && int(key) <= int('z')) { final int[] asciivalues = int( animal.toCharArray() ); if (int(key)==asciivalues[index]) { index++; if (index == animal.length()) { score += 5; index = 0; barShrink = 600; lastPick = chooser; if (score < 51 || barShrink <= 0) { while (lastPick == chooser) { chooser = int(random(0, 5)); } } if ((score > 51 && score < 101) || barShrink <= 0) { while (lastPick == chooser) { chooser = int(random(5, 10)); } } if ((score > 101 && score < 151) || barShrink <= 0) { while (lastPick == chooser) { chooser = int(random(10, 15)); } } if (score > 151 || barShrink <= 0) { while (lastPick == chooser) { chooser = int(random(0, 19)); } } } } else { if (loseLifeAbility == true) { life--; warning = true; } } } } }