Help needed (Processing)

What is wrong with this Sketck?

//////////////////////////////////////////////////////
Ptica[] p = new Ptica[1200];
int N = 100;

void setup() {
size(1280, 900);
for(int i=0; i < N; i++) {
p[i] = new Ptica(random(width), random(height)); } }

void draw() {
background(32, 112, 80);
for(int i=0; i < N; i++) {
p[i].leti(i); } }

void mousePressed() {
if(N < 1200) {
N = N + 1;
println(“n =”, str(N));
p[N] = new Ptica(mouseX, mouseY); } }

///////////////////////////////////////////////////////////////////

class Ptica {
//varijable vidljive u cijeloj klasi
float x;
float y;
float azimut;
float brzina;
float r;

//konstruktor (Lee)
Ptica(float tx, float ty) {
azimut = random(TWO_PI);
brzina = random(1,3);
r = 3.0;
x = tx;
y = ty; }

//metode klase Ptica
void sudar(int j) {
for(int i = 0; i < N; i++) {
if(i != j) {
float d = dist(p[i].x,p[i].y, p[j].x,p[j].y);
if(d < 6) {
p[i] = p[N-1];
p[j] = p[N-2];
N = N - 2; } } } }

void leti(int i) {
translacija();
sudar(i);
provjeri_rubove();
//println(N);
crtaj(i); }

void translacija() {
float dx = brzinacos(azimut);
float dy = brzina
sin(azimut);
x = x + dx;
y = y + dy; }

void crtaj(int i) {
textSize(16);
text(str(i), x+8, y+8);

fill(200,100);
stroke(255);

pushMatrix();
  translate(x, y);
  rotate(azimut + 0.5*PI);
  beginShape(TRIANGLES);
    vertex(0, -r*2);
    vertex(-r, r*2);
    vertex(r, r*2);
  endShape();
popMatrix(); }

void provjeri_rubove() {
if(x < 0) x = width;
if(y < 0) y = height;
if(x > width) x = 0;
if(y > height) y = 0; } }

Can you please format your code? Highlight it and press the </> code button to preserve indentation.

What exactly does this code do? What do you expect it to do? How are those two things different? Which line of code is behaving differently from what you expected?

Have you tried debugging your code?