Passing variables from one class to another
I'm making a tetris game. Most of the hard work is done, in that the pieces fall, and the player can move them side to side, turn them, and drop them. Now I'd like to make a scoring system and other nice little bells and whistles.
The "MainGrid" class is where the game is actually played. Now I made a new class called "MasterPanel" that makes a MainGrid and a new section called the "ScorePanel"
The thing is, I need information to be fed from the MainGrid into the ScorePanel, even though neither one is contained inside the other. I hope that makes sense. How can I do it?