public void create() { //код stage = new Stage(); stage.addActor(tank); // оба танка наследуются от 1 класса stage.addActor(tank2); Gdx.input.setInputProcessor(stage); } render
public void render() { //код stage.act(Gdx.graphics.getDeltaTime()); stage.draw(); //код } How to make each actor move independently of each other when you click on the screen? That is, if they are to the left and to the right of the screen, and when pressed, for example, to the center, it is necessary that they both move to the center from their positions.
With this code, of course only tank2 moves.
Stage works only with the first actor, which processed the event first. What methods need to be redefined so that the event is passed to the second actor? Or what logic to use?
PS A similar question, which was asked in the list below, was formulated a bit incorrectly, so in fact this is another question, but the answer was useful for me, and I hope for others.