Hay have an issue with int share between actors. I read a lot about this int this site but i cant do it dont know why... Can u pl help me?
----------------------------------------------------
So i want to move the Int2 Into the Example.class and do a Int=Int+Int2 finale score. How can i do this?
1 2 3 4 5 6 7 8 9 10 | import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) public class Example extends Moduls { int Int= 0 ; public void act() { // Add your action code here. } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) public class Example2 extends Moduls { int Int2= 0 ; public void act() { // Add your action code here. } public void something(){ Int2++; } public Example2(){ somethhing(); } } |