// Background
PImage img;
// Mario
PImage img2;
// Mario's Position
float XPos;
// Enemies
PImage img3;
PImage img4;
PImage img5;
PImage img6;
PImage img7;
// Falling Speed
int dx = 0;
int dy = 2;
// Enemy Locations
float x = 0;
float y = -20;
float x1 = 0;
float y1 = -360;
float x2 = 0;
float y2 = -150;
float x3 = 0;
float y3 = -490;
float x4 = 0;
float y4 = -290;
boolean gameover = false;
void setup() {
size(800,500);
img = loadImage("http://www.wall321.com/thumbnails/detail/20120313/mario 1680x1050 wallpaper_www.wall321.com_88.jpg"); //bg
img2 = loadImage("http://images1.wikia.nocookie.net/__cb20130419153649/mario-fanon/es/images/thumb/3/32/Yeah.gif/186px-Yeah.gif"); //mario
img3 = loadImage("http://images2.wikia.nocookie.net/__cb20130407235958/fantendo/images/4/4f/Koopa_Troopa.gif.png"); //goomba
img4 = loadImage("http://lh5.ggpht.com/_wTgN7MIrGd4/SzH2Jc3agOI/AAAAAAAADcg/pzIzmjCH-K4/koopa-shell.png");//koopa
img5 = loadImage("http://images3.wikia.nocookie.net/__cb20081102125653/mario/de/images/thumb/8/88/Riesen_Kugelwilli.png/60px-Riesen_Kugelwilli.png"); //bullet bill
img6 = loadImage("https://secure.gravatar.com/avatar/63abd98aa4b7d94fc1d9fabfc9be153f?s=140&d=https://github.com/images/gravatars/gravatar-140.png"); //boo
img7 = loadImage("http://fc02.deviantart.net/fs50/f/2009/260/8/3/New_Bob_omb_Animation_by_Neslug.gif"); //bomb
x = random(50,750);
x1 = random(50,750);
x2 = random(50,750);
x3 = random(50,750);
x4 = random(50,750);
}
void draw() {
if (!gameover) {
background(0);
image(img,0,0);
image(img2, XPos,300);
float num = 1;
int score = millis();
textSize(32);
text("Score: " + score, 500, 31);
fill(255);
y = y + dy;
y1 = y1 + dy;
y2 = y2 + dy;
YOU ARE READING
JavaScript Coding
RandomHello, world! So to start this off I'm not the best writer. However, if you enjoy programing or just video games (and fails) in general then you're in the right place. This is sort of a book I will occasionally post on since coming up with these is...
