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

2020/2/4

Tic Tac Toe

ItzTigerr ItzTigerr

2020/2/4

#
I need help creating a 3x3 grid in my world
tjofe tjofe

2020/2/5

#
I will help you later
lehrerfreund lehrerfreund

2020/2/5

#
If you mean your world should be just a 3x3 grid you could just adjust this in the World-class:
public class MyWorld extends World
{
    public MyWorld()
    {    
        super(3, 3, 200); 
    }
}
This means that your world is consisting of 3x3 cells, every cell is 200x200 pixels (so the width of your world actually is 600px - 3 cells a 200 px).. You can set your marks with something like
// in World-class
Cross m = new Cross();
addObject(m, 1, 1);
This sets a mark into the middle cell, as you start counting cells with 0: 0/0 1/0 2/0 1/0 1/1 1/2 2/0 2/1 2/2
You need to login to post a reply.