how to create a new object every 2 seconds

if(second()%2==0){
    seconds=second();
    b.add(new Bullets(mouseX));
  }

here is the code i have but it creates a wall how would you suggest fixing it?

edit: fixed if (b.get(0).y%200==0) b.add(new Bullets(mouseX)); if (b.get(0).y<=0) b.remove(0);

Tagged:

Answers

Sign In or Register to comment.