Greenfoot

1 program Added 2026-03-17T10:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: enabled Evidence Report issue View issues
Aliases: —
Provenance: commit c37ea51207 · authored 2026-03-17T06:16:36+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

Gren (0.21)Gnuplot (0.18)Gremlin (0.18)Goat (0.13)Grace (0.12)

LLM-contributed programs

Pong Ball Actor

Provenance: commit c37ea51207 · authored 2026-03-17T06:16:36+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch enabled
code.java · added: 2026-03-17T10:00:00Z
import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

public class Ball  extends Actor{
    private int x;
    private int y;
    private int incx;
    private int incy;

    public Ball(){
        x=350;
        y=250;
        incx=5;
        incy=5;
    }

    @Override
    public void act() {
        int posx = this.getX();
        int posy = this.getY();

        int nuevox = posx + incx;
        int nuevoy = posy + incy;

        this.setLocation(nuevox, nuevoy);

        World mundo = this.getWorld();

        if(nuevox > mundo.getWidth()){
            incx = -incx;
        }

        if(nuevoy > mundo.getHeight()){
           incy = -incy;
           this.setLocation(x, y);
           Greenfoot.delay(100);
        }

        if(nuevoy < 0){
           incy = -incy;
           this.setLocation(x, y);
           Greenfoot.delay(100);
        }

        if(nuevox < 0){
            incx = -incx;
            //posx = x;
           // posy = y;
        }

         if(this.isTouching(Paddle.class)){
            incy = -incy;
        }


    }
}

Contribute — propose a file extension

Tell us where to find evidence about Greenfoot (mapped to pl/greenfoot). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Greenfoot/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← GreenBerry greenplum →