Basically, I am building my own pokemon game, however whenever I go into a new "region" the tiles should reset and refresh, however, instead of clearing the old ones out, they just add onto the existing ones, thus causing a lot of issues.
I know that once I can successfully clear the old tiles, the game will refresh nice and neat for me.
I thought all i had to do was
buttonPanels = new JButton[row][col]
to make a new (clean) instance of the button array?
The whole board is a just a JButton array.
Two images below, one of before and one of after I go into a new region. You can see how how in the after photo all the new tiles just add onto the existing ones, which causes a lot of problems.
THANK YOU!! :)
First time at trying a rpg type thing, so don't be too critical of it so far. Please boil your question down to a simple code snippet that illustrates the problem.
以上就是Clearing a Double Array (I think I am doing it wrong)的详细内容，更多请关注web前端其它相关文章！