Hi coders, I sent my friend a game which I made fro a school project, he then sent me it back with so many improvements without any comments. Cann someone very kindly help me understand what is going on in each line or most it. Thank you so much. (The code is below)
 
  import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.Color;
/**
 * Write a description of class DodgeWorld here.
 * 
 * author T Y
 
 */
public class DodgeWorld extends World
{
    /**
     * Constructor for objects of class DodgeWorld.
     * 
     */
    public DodgeWorld()
    {    
        super(400, 800, 1); // Changes size of canvas 
        addCharacter();
        
        scoreCounter = new Counter("Score: ");//
        addObject(scoreCounter, getWidth() / 3 - 15, getHeight() / 8 - 15);
        
        lifeCounter = new Counter("Lives: ");//
        addObject(lifeCounter, getWidth() / 2, getHeight() / 8 - 15);
        
        getLifeCounter().add(3);
            
    }
    
    public Counter scoreCounter;//
    public Counter lifeCounter;//
    public int score = 0;//
    private int zone = 100;//
    private int timer = 0;//
    
    public boolean gameOver = false;
    
    public void act()
    {
        addDangers();
    }
    
    public void addCharacter()
    {
        addObject(new Man(), 200, 680); //positionning of the bluebird
    }
    
    public void addDangers()
    {
        if (Greenfoot.getRandomNumber(1000) < zone)
        {
            addObject(new Rock(), Greenfoot.getRandomNumber(400), -10);//
            if (timer >= 100 && zone < 200)
            {
                zone++;
            }
            
            if (timer == 400 || timer == 800 || timer == 1000)//
            {
                zone += 25;
            }
            
            timer++;//
        }
    }
    
    public Counter getScoreCounter()
    {
        return scoreCounter;//
    }
    
    public Counter getLifeCounter()
    {
        return lifeCounter;//
    }
}
          
        
  
