Hi!
Scenario name: maze
World subclass: Earth
Actor subclass: Wall
Using MS Paint, I have created a 1 pixel by 1 pixel image that I have filled with color. File name is wall.png and it is store in the images folder already. It is the icon of the Wall actor subclass.
I need to create a maze. I have already done so using two methods. In the first method, I created different segments using MS Paint (e.g. wall1.png, wall2.png, etc) and then arranged these into a maze in the world. The second is by using for-loops to use the 1 pixel image.
Now I want to create a new maze simply by placing a Wall object into the world, like, say, addObject(new Wall(), 50, 50); then changing the size of this pixel to, say, (100, 1) to create a horizontal wall that is 1 pixel thin. I would then add another part of the maze by, say, addObject(new Wall(), 200, 200); then changing the scale vertically to create a vertical wall.
I have tried on my own and from the answers given here like
GreenfootImage x = getImage();
x.scale(100, 1);
setImage(x);
does not work for me. Please help. Thank you.