class Tile { // Tile class float x; float y; PImage img; float angle = 0; boolean falling = false; Tile(PImage timg, float tx, float ty) { img = timg; x = tx; y = ty; } // Move and rotate tile to current location // and draw void draw() { resetMatrix(); translate(x, y); rotate(angle); image(img, 0, 0); } // Update tile location and angle of rotation void update() { if (!falling) return; if (y > height) return; angle = (angle + 0.1) % TWO_PI; y += 3.0; } }