In the example I've posted, variables car, grape and banana store object references for the same class Sprite.
It's very easy to modify the code to use a Sprite[] or an ArrayList<Sprite> instead of 3 variables.
In your own code, you got 30 cellOne object references stored in an Array.
Take a look at the method checkImmersion() @ class Sprite.
It's very easy to modify the code to use a Sprite[] or an ArrayList<Sprite> instead of 3 variables.
In your own code, you got 30 cellOne object references stored in an Array.
Take a look at the method checkImmersion() @ class Sprite.