Also, when restarting, it doesn't load anymore. I looked at your code and this what I think is the problem:
In your method generate (in your Bg class), you call the method height at some point. Only, in height you also call generate, causing a forever loop of calling methods, which eventually causes the stack (some part of the memory, where also the data of methods is stored) to overflow.
When you grab some 'sand', it first says you have 0 of it, then 1, then 2, etc. Just add one to the value to display.
And this truely shows potential! I hope you're still working on this to turn this into a full game.
Whoops, just realised, the x and y should be this:
[code]int x = Greenfoot.getRandomNumber(getFullWidth()-getWidth())+getWidth()/2;
int y = Greenfoot.getRandomNumber(getFullHeight()-getHeight())+getHeight()/2;
[/code]
2013/9/2
Jump!
2013/9/2
Jump!
2013/9/2
Magnifying Glass
2013/8/31
2D Minecraft-v2
2013/8/31
2D Minecraft-v2
2013/8/22
Put your finger here
2013/8/19
Slender 2D
2013/8/17
Nightmare: Emergence
2013/8/17
Nightmare: Emergence