Clearing a Double Array (I think I am doing it wrong)

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前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准