I'm trying to load a series of randomly repeating images into a type mask, but am having trouble doing it. The end result should look like this:
But so far, I can only get the pieces to slide across the screen behind the mask. Can anyone help me with this? I'm a beginner and I'm stuck... My code so far is:
int totalPieces = 9;
int counter = 0;
int counterThreshold = 1000;
class Piece{
PImage img;
float x, y;
float xDir, yDir;
Piece(String path)
{
img = loadImage(path);
x = random(1)*width;
y = random(1)*height;
xDir = random(1)*2+0.5; // change this to a fix number like xDir = 3; will fix the speed