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: Maushakar Faerg
Country: Honduras
Language: English (Spanish)
Genre: Business
Published (Last): 26 November 2006
Pages: 253
PDF File Size: 12.34 Mb
ePub File Size: 9.62 Mb
ISBN: 650-1-67242-454-8
Downloads: 85782
Price: Free* [*Free Regsitration Required]
Uploader: Kigataxe

Mirrors the image vertically the top of the image becomes the bottom, and vice versa. If the sound is currently looping, it will finish the current loop and stop. The value returned is the horizontal index of the actor’s cell in the world. New Kinect with Greenfoot. 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. An object ggeenfoot the given class type that intersects with the current object.

An object at the given location, or null if none found.

World (Greenfoot API)

Return one object that is located at the specified cell relative to this objects location. An object is within range if the distance between its centre and this object’s centre is less than or equal to ‘radius’. IllegalArgumentException – If the image can not be loaded.

Object Represents audio that can be played in Greenfoot. If the sound is currently paused, it will resume playback from the point where it was paused.

Return an object that intersects this object. Objects of classes not listed will appear below the objects whose classes have been specified. Move this actor the specified distance in the direction it is currently facing.


Return the x-coordinate of the actor’s current location. Set the rotation of this actor. The size of cells can be specified at world creation time, and is constant after creation. Return the world’s background image. Construct a new world. The second edition of the book is out now.

Returns a string representation of this sound containing the name of the file and whether it is currently playing or not. You can also access it from within Greenfoot – use the “Greenfoot Class Documentation” menu item, from the Help menu.

Actor The act method is called by the greenfoot framework to give actors a chance to perform some action. This method can be overridden to implement custom behaviour when the actor is inserted into the world.

Removes one object of the given class that this actor is currently touching if any exist. Make sure that this is really the method you want. This site requires JavaScript, please enable it in your browser! CS Unplugged with Greenfoot. Play this sound repeatedly in a loop. Act method for world. Creates a RGB color with the specified red, green, blue, and alpha values in the range 0 – Simple scenarios may use large cells that entirely contain the representations of objects in a single cell.

Package greenfoot

Greehfoot the y-coordinate of the object’s current location. Return one object that is located greefoot the specified cell relative to this objects location.


Objects found can be restricted to a specific class and its subclasses by supplying the ‘cls’ parameter. The sound will be played once. If there is no background image at the location it will return Color.

Removes one object of the given class that this actor is currently touching if any exist. A greefnoot of all neighbours found. The y-coordinate of the actor’s current location Throws: Stop playing this sound if it is currently playing. The object will have a default image. The world’s act method greenfoot called before the act method of any objects in the world. One of the most important aspects of this class is the ‘act’ greenfiot.

The file may be in jpeg, gif or png format. Returns the image used to represent this actor. Set an image for this actor from an image file. An Actor is not normally instantiated, but instead used as a superclass to more specific objects in the world. Actor Construct an Actor. Get a sorted list of the UserInfo items for this scenario surrounding the current user.

The world this actor is in, or null if either this actor is not in a world Throws: Return all objects that intersect the center of the given location relative to this object’s location.