so I have been making a tanks game for a while now and have a few questions about getOneObjectAtOffset, and text. here is the code for my intersection of bricks
the problem is that it randomly decides to setLocation. I have also noted out setLocation and made it move(100); and it would go through some bricks and not others and then randomly it would (where no bricks are located at) move the 100.
the second problem is not so much a problem as repeat coding. I have an actor called "Levels", a subclass of that "Level1", and a subclass of that "Ready1". my problem is that when "Levels" creates the text, the text is also applied to ALL of its subclass's. so how do I basically say in code to not repeat the code of the actor it extends. and by the way the reason I have it as a subclass is for organization because I plan to have multiple 'Levels'.
anyway here is the game
thanks
public void ghost() { Actor collided = getOneObjectAtOffset(getX(),getY()+0,Brick.class); if(collided != null) { setLocation(getX(),getY()-10); //it moves in increments of 10 } }