class Melee extends Attack { float c_angle=0; //central angle of attack's sweep float sweep=0.5; //amount of sweep the attack has; 1=full circle float length_scale = 2; float width_scale = 0.5; float max_radius = 0.5; int damage = 1; PVector knockback = new PVector(1, 0); Hitbox getbox(int frame) { float progress = frame / (float)active_time; float radmag = sin(progress*PI); PVector xbasis = new PVector(cos(c_angle), sin(c_angle)); PVector ybasis = new PVector(cos(c_angle+HALF_PI), sin(c_angle+HALF_PI)); xbasis.mult(length_scale); ybasis.mult(width_scale); float angle=(-sweep/2 + sweep)*TWO_PI; xbasis.mult(cos(angle)); ybasis.mult(sin(angle)); PVector box_center = PVector.add(xbasis, ybasis); return new Hitbox(box_center, radmag*max_radius); } } class Weapon { Attack rising; Attack falling; Attack neutral; Attack special; int special_charge_time; color dim; color bright; }