Choosing the size of the background for your Greenfoot world
Find other posts in the same category: |

Contents

Choosing the size of the background.

If you open the standard Wombats tutorial that comes with Greenfoot, this code is in the class that is in the box under World.

Right click on that box to open the editor. Click on "Open editor."
Find the lines of code that looks like this

public WombatWorld()
{
super(8, 8, 60);
setBackground("cell.jpg");
}

The command you use is super.
You give it 3 numbers.
The first number determines how many squares across.
The second number determines how many squares down.
The third number determines how large each square is.
For example, if you say

(super(15,10,60));

The background will have 15 squares across,
10 squares down, and each square will be the size of 60 pixels.

You can learn this by watching
Video Tutorial #3
Making Things Move
14 minutes
http://www.greenfoot.org/videos/making-things-move.mov


Next Book Page

To see posts on the same topic, click the links below the name of the author at the top of this page.