How can I make variables between objects? I am trying to make it so when I press a button, it will change a value in an array in another object. Are there better ways to do this? Thanks.


1 | if (Greenfoot.mouseClicked(objOne)) objTwo.setArrayValue(index, value); |
1 | if (Greenfoot.mouseClicked(objOne)) objTwo.setArrayValue(index, value); |
1 | public static int my_var = 5 ; |