World(int worldWidth, int worldHeight, int cellSize, boolean bounded). The act method is called by the greenfoot framework to give actors a chance to. Get all the objects in the world, or all the objects of a particular class.

Author: Maubei Sakinos
Country: Bulgaria
Language: English (Spanish)
Genre: Spiritual
Published (Last): 27 September 2013
Pages: 340
PDF File Size: 3.50 Mb
ePub File Size: 2.82 Mb
ISBN: 426-8-61688-676-9
Downloads: 39651
Price: Free* [*Free Regsitration Required]
Uploader: Yoshakar

The value returned is the horizontal index of the actor’s cell in the world. Tutorials Learn how to aip Greenfoot and begin programming: Move this actor the specified distance in the direction it is currently facing.

Mirrors the image horizontally the left of the image becomes the right, and vice versa. If the sound is already playing once, it will start looping instead. World public abstract class World extends java. Greendoot the image size is larger than the world in pixels, it is clipped. True if the actor is at or beyond the edge cell of the world, and false otherwise.

If it is playing already, it will do nothing. This method considers only logical location, ignoring extent of the image.

All Classes (Greenfoot API)

New Kinect with Greenfoot. Return an object that intersects this object. Object World is the world that Actors live in. This method can be overridden to implement custom behaviour when the actor is inserted into the world. Steps may be only in the four main directions, or may include diagonal steps, depending on the ‘diagonal’ parameter. The direction can be set using the setRotation int method. Show some text centred at the given position in the world.


Images of type ‘jpeg’, ‘gif’ and ‘png’ are supported. Return the color at the centre of the cell. Subclasses can then define their own appearance and behaviour.

GreenfootSound public class GreenfootSound extends java. The file may be in jpeg, gif or png format. Returns a string representation of this sound containing the name of the file and whether it is currently playing or not. At each action step in the environment, each object’s act method is invoked, in unspecified order. You can also access it from within Greenfoot – use the “Greenfoot Class Documentation” menu item, from the Help menu. The y-coordinate of the actor’s current location Throws: Return the world that this actor lives in, provided that it is an instance of the given “worldClass” class i.

Package greenfoot

Returns a new Font object obtained by deriving the java. Zero degrees is to the east right-hand side of the worldand the angle increases clockwise. IllegalStateException – If the actor has not been added into a world.

Return the x-coordinate of the actor’s current location. IllegalArgumentException – If the image can not be loaded. List of objects of the given class type within the given radius. Creates an image with the given string drawn as text using the given font size, with the given foreground GreenfootColor on the given background GreenfootColor.

List of objects at the given offset. Xpi called on an already looping sound, it will do nothing. Detect whether the actor has reached the edge of the world. Every Actor has a location in the world, and an appearance that is: Return one object that is located at the specified cell relative grdenfoot this objects location.


True if the mouse has been pressed changed from a non-pressed state to being pressed on the given object.

Rotation is expressed as a degree value, range Learn Maths with Greenfoot. Object Represents audio that can be played in Breenfoot.

This default implementation is empty. The UserInfo class can be used to store data permanently on a server, and to share this data between different users, when the scenario runs on the Greenfoot web site.


Set a background image for the world from an image file. Return all objects at a given cell. This image can be modified to change the actor’s appearance.

This moves the actor to the specified location. The size of cells can be specified at world creation time, and is constant after creation. The Greenfoot Greenfooot is available online. This method is called by the Greenfoot system when the execution has stopped. True if the object’s intersect, false otherwise.

A wide range of other short videos are also available. The world this actor is in, or null if either this actor is not in a world Throws: The x-coordinate of the object’s current location.

Going Further There are many more things you can do with Greenfoot, such as: