This site requires JavaScript, please enable it in your browser!
Greenfoot back
ronald
ronald wrote ...

2021/11/9

BINARY

1
2
ronald ronald

2021/11/10

#
public void act()
    {
        if (Greenfoot.mouseClicked(this))
        {
            MouseInfo mi = Greenfoot.getMouseInfo();
            int x = (mi.getX()-30)/35;
            int y = (mi.getY()-30)/35;
            //map[y][x] = (map[y][x]+1)%2;
            setBackground(new GreenfootImage(images[map[y][x]]));
            //drawBinary(x, y);
        }    
    }
OK Do I have to redo a for loop so that I click so that the drawing appears with the green and blue buttons at the same time? I put a piece of code and commented in the meantime
danpost danpost

2021/11/11

#
ronald wrote...
Do I have to redo a for loop so that I click so that the drawing appears with the green and blue buttons at the same time?
If you have to, just move line 10 from here to where you add the buttons.
You need to login to post a reply.
1
2