There are many examples where people have published their code, some are better than others, you can see http://www.greenfoot.org/scenarios/11302 or http://www.greenfoot.org/scenarios/10770 The second scenario the creator has a youtube channel where he explains everything he did, just invest an hour or 2 and watch all parts of it.