I am trying to move my image along with the shape so I can make the collider with the shape (some kind of space shooter) but my image does not move along with the circle I make for it. It dissapears to the next spawned circle instead of completing it's track towards the bottom of the screen (I want to make a vertical linear move from top to bottom but everytime another circle+image spawns, the previous circle goes down but the image spawns to the next circle and so on)
update method:
timePassed+=delta;
if(timePassed>700){
timePassed=0;
RandomInt = random.nextInt(400);
gigis.add(new Circle(200+RandomInt,0,40));
gigiSkin.add(new Image("img/gegi.png"));
}
for(Circle c: gigis){
c.setCenterY(c.getCenterY()+(delta/6f));
gigiY= c.getCenterY()+(delta/6f);
}
for(Circle c: bullets){
c.setCenterY(c.getCenterY()-(delta/1.25f));
projY = c.getCenterY()-(delta/1.5f);
}
render method:
for(Circle c: bullets){
g.draw(c);
}
for(Image skin: bulletSkin){
skin.draw(projX,projY,80,80);
}
g.setColor(Color.red);
for(Circle c: gigis){
g.draw(c);
}
for(Image skin: gigiSkin){
skin.draw(200+RandomInt,gigiY,80,80);
}
}