No description provided
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#258861' allowfullscreen></iframe>
float x = 200; float x2 = 300; float y2 = 350; float grav = 0.0; boolean gameover = false; String url10 = "https://art.ngfiles.com/images/853000/853717_2009mechagodzilla_godzilla-glow.png?f1553043294"; String url11 = "https://cdn140.picsart.com/289319776004211.png?r1024x1024"; PImage back = loadImage(url11); PImage godzilla = loadImage(url10); String url5 = "http://pixelartmaker.com/art/f59eaa826d4e49f.png"; String url4 = "https://www.bleepstatic.com/swr-guides/b/buzzing-dohl/fake-blue-screen-of-death.png"; PImage oof = loadImage(url4); String oofed = "https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Fukui_Earthquake_1948_-_damaged_building.jpg/640px-Fukui_Earthquake_1948_-_damaged_building.jpg"; PImage oof2 = loadImage(oofed); String url3 = "https://cdnb.artstation.com/p/assets/images/images/021/244/447/large/joshua-groves-pixel-art-volcano-isle.jpg?1570941618"; PImage review; PImage background = loadImage(url3); String url = "https://devstickers.com/assets/img/pro/nz5y.png"; String url2 = "https://www.tynker.com/projects/images/396cce56f8f0cbe494d66cb68feb6ca80531e193/cacti---cacti1.png"; String img2 = "https://cdn.pixabay.com/photo/2013/07/12/15/29/fireball-149924_960_720.png"; PImage img = loadImage(url); PImage fire = loadImage(img2); String url12 = "http://icons.iconarchive.com/icons/paomedia/small-n-flat/1024/building-icon.png"; PImage nuke = loadImage(url12); int y = 550; int y3 = 350; float X3 = 200; float obs1X = 600; int timer = 0; float obs2X = 1000; boolean jumped; Sprite player = new Sprite(x, y , 120 , 100); Sprite god = new Sprite(X3, y3 , 120 , 100); int slide = 1; float obs1h = random(50,100); float obs2h = random(50,100); float obs1y = 400- (obs1h/2); float obs2y = 400- (obs2h/2); int score; Sprite obstacle = new Sprite(obs1X, obs1y, obs1h, obs1h); Sprite bad = new Sprite(obs1X, obs1y, obs1h, obs1h); Sprite obstacle2 = new Sprite(obs1X, obs1y, obs1h, obs1h); Sprite bad2 = new Sprite(obs2X, obs2y, obs2h, obs2h); void setup(){ size(800,400); timer = 0; Sprite player = new Sprite(x, y , 120 , 100); Sprite god = new Sprite(X3, y3 , 120 , 101); Sprite obstacle = new Sprite(obs1X, obs1y , obs1h +50 , obs1h); Sprite bad = new Sprite(obs2X, obs2y , obs2h, obs2h); Sprite obstacle2 = new Sprite(obs1X, obs1y , obs1h , obs1h); Sprite bad2 = new Sprite(obs2X, obs2y , obs2h , obs2h); } void draw(){ background(255); if(slide == 1){ fill(0); textSize(40); text("Welcome to theme jumper!",100,200); textSize(20); text("Choose your theme:",150,250); text("Chrome Dino: extinction \n press A to play this!", 125,280); text("Mini Godzilla jumper! \n press S to play this!", 370, 280); } if(slide == 2){ image(background,400,200,800,400); obstacle.setImage(fire); bad.setImage(fire); player.setImage(img); y += grav; timer = timer + 6/1; score = timer; grav += 0.2; if(y > 350){ grav = 0; y = 350; jumped = false; } obs1X -= 4; obs2X -= 4; rectMode(CENTER); fill(0); //Code for checking collisions if(abs(obs1X - player.getX()) < 30){ if(abs(obs1y - player.getY())<(15+obs1h/2) ){ gameover = true; } } if(abs(obs2X - player.getX()) < 30){ if(abs(obs2y - player.getY())<(15+obs2h/2) ){ gameover = true; } } bad.setX(obs2X); bad.setY(obs2y); bad.display(); obstacle.setY(obs1y); obstacle.setX(obs1X); player.display(); obstacle.display(); player.setY(y); textSize(20); text("Score: " + score,100,50); if(obs1X < 0){ obs1X = obs2X + random(300, 600); obs1h = random(50,100); obs1y = 400- (obs1h/2); } if(obs2X < 0){ obs2X = obs1X + random(600, 1200); obs2h = random(50,100); obs2y = 400- (obs2h/2); } if(gameover == true){ fill(0,250,0); textSize(25); image(oof,400,200,800,400); text("OH Geez! OH MY GOSH! THAT IS HORRIB... Uh... er... oops,\n I didn't know you were here :|\n let's just say that the dino didn't make it \nto the end before the volcano exploded. :o",116,50); } } if(slide == 3){ image(back,400,200,1200,800); god.display(); god.setY(y3); bad2.setX(obs2X); bad2.setY(obs2y); bad2.display(); bad2.setImage(nuke); obstacle2.setY(obs1y); obstacle2.setX(obs1X); obstacle2.display(); obstacle2.setImage(nuke); god.setImage(godzilla); textSize(20); text("Score: " + score,100,50); y3 += grav; timer = timer + 6/1; score = timer; grav += 0.2; if(y3 > 350){ grav = 0; y3 = 350; jumped = false; } obs1X -= 4; obs2X -= 4; if(abs(obs1X - god.getX()) < 30){ if(abs(obs1y - god.getY())<(15+obs1h/2) ){ gameover = true; } } if(abs(obs2X - god.getX()) < 30){ if(abs(obs2y - god.getY())<(15+obs2h/2) ){ gameover = true; } } if(obs1X < 0){ obs1X = obs2X + random(300, 600); obs1h = random(50,100); obs1y = 400- (obs1h/2); } if(obs2X < 0){ obs2X = obs1X + random(600, 1200); obs2h = random(50,100); obs2y = 400- (obs2h/2); } if(gameover == true){ fill(0); image(oof2,400,200,800,400); text("Ouch, that hurts. What? thats all I got to say. \nAnd hey look, godzilla got killed by a pile of bricks, Ha! What a joke!",116,50); } } } void keyPressed(){ if(slide == 1){ if(key == 'a'){ slide = 2; } } if(slide == 1){ if(key == 's'){ slide = 3; } } if(slide == 2){ if(key == 'w'){ if(jumped == false){ grav = -10; } jumped = true; } if(key == ' '){ if(jumped == false){ grav = -10; } jumped = true; } if(keyCode == UP){ if(jumped == false){ grav = -10; } jumped = true; } } if(slide == 3){ if(key == 'w'){ if(jumped == false){ grav = -10; } jumped = true; } if(key == ' '){ if(jumped == false){ grav = -10; } jumped = true; } if(keyCode == UP){ if(jumped == false){ grav = -10; } jumped = true; } } }