// Character drawing class Type extends Particle { float headAngle; int typeNum, shapeNum; Type(float ix, float iy, float spd, float s, int n) { super(ix, iy, spd, s); typeNum = n; shapeNum = typeNum%NUM_TYPESHAPES; } void update() { super.update(); if (super.inString) { headAngle = 0; } else { headAngle = atan2(dy, dx) - HALF_PI; // Make 'heads' follow the cursor } } void display() { pushMatrix(); translate(x, y); rotate(headAngle); pushMatrix(); scale(typeSize/min(dist(x, y, mouseX, mouseY)+1, 10)); shape(typeShape[shapeNum], 0, 0);// Draw shapes popMatrix(); popMatrix(); } int getShapeNum() { return shapeNum; } }