@Duta, I cannot be sure. It was too long ago. This was like my 3rd project in Greenfoot. I am not sure if I was using static variables at that point. However, I noticed I had said that it compiled different each time; which indicates that it was probably something else.
A lot of folks have been asking about how to detect collisions, or how not to pass through objects, so I created this example which also has an example of how one can sub-class my 'Bar' class to give it some functionality.
2012/5/26
Dots and Boxes
2012/5/21
Parking Escape
2012/5/15
Barriers and Bars
2012/5/14
Nim Game
2012/5/14
Breakout
2012/5/14
PlatFormed v6
2012/5/13
Breakout
2012/5/13
Nightmare
2012/5/13
Snake