Sorry if the question is dumb but my brain just cannot solve it for some reason..
So I've made one opengl object public static Square ball = new Square(75,75);
And I am trying to make it so that every so often a new ball appears on the screen
public void Loop(GL10 gl) {
gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
gl.glLoadIdentity();
long timeSinceStart = SystemClock.uptimeMillis();
long deltaTime = timeSinceStart - oldTimeSinceStart;
oldTimeSinceStart = timeSinceStart;
if(deltaTime >= 15) {
RandBall(gl);
}}
code for RandBall()
`public void RandBall(GL10 gl) {
gl.glPushMatrix();
gl.glTranslatef(rand.nextInt((1280 - 0) + 1) + 0,
rand.nextInt((720 - 0) + 1) + 0, 0);
getBall().draw(gl);
gl.glPopMatrix();
}`
but when I run the code it draws only one object and constantly changes its coordinates. How do I make it so that it draws multiple objects with different random coordinates? The solution is probably going to be an easy one but I just can't see it :/