class enemy { float x, y; float speed; float w=0.1; PImage img; int hp,hpx; boolean tf = false; enemy(float x0, float y0, float sp,int hp0) { img = loadImage("mzl_oofbzymj.png"); x = x0; y = y0; speed = sp; hpx = hp0; hp=hpx; } void display() { image(img, x, y, w, w); fill(0); if (w>0) { textSize(10); text(100-(int)w, x, y); } if ((int)w>100) { damage(); } } void move() { w=w+speed; } void Restart(float sp) { tf = true; w=0.1; hp=hpx; speed = sp; x=random(10, 400); y=random(10, 150); } float sizex1() { return x; } float sizex2() { return x+w; } float sizey1() { return y; } float sizey2() { return y+w; } void damage() { text("OUT!!", width/2, height/2); dam = 1; } void out() { speed=0; w=0; } void hit() { if (stack != 0) { if (mouseX>=sizex1()&& mouseX<=sizex2()&& mouseY>=sizey1()&& mouseY<=sizey2()) { stack--; p++; hp--; if(hp==0){ tf = false; out(); } } } } void bosshit() { if (stack != 0) { if (mouseX>=sizex1()&& mouseX<=sizex2()&& mouseY>=sizey1()&& mouseY<=sizey2()) { stack--; p++; hp--; if(hp==0){ cl++; tf = false; out(); } } } } }