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: Mutilar Gujin
Country: Papua New Guinea
Language: English (Spanish)
Genre: Art
Published (Last): 3 October 2010
Pages: 194
PDF File Size: 5.61 Mb
ePub File Size: 1.19 Mb
ISBN: 219-2-21921-457-7
Downloads: 61039
Price: Free* [*Free Regsitration Required]
Uploader: Yojar

Show some text centred at the given position in the world. Return all objects at a given cell. This method can be overridden to implement custom behaviour when the execution is started. All Actor are associated with a World and can get access to the world object. More greenfoor scenarios may use smaller cells down to single pixel size to achieve fine-grained placement and smoother animation. Images of type ‘jpeg’, ‘gif’ and ‘png’ are supported.

Removes one object of the given class that this actor is currently touching if any exist. The resources for the sound will not be released while it is paused. If a class is specified as a parameter, only objects of that class or its subclasses will be returned.

Mirrors the image horizontally the left of the image becomes the right, and vice versa. Creates a RGB color with the specified red, green, blue, and alpha values greefnoot the range 0 – Object Represents audio that can be played in Greenfoot. List of objects at the given offset. This utility class provides methods to control the simulation and interact with the system. List of rgeenfoot of the given class type that intersect with the current object.


Start playing this sound. Play this sound repeatedly in a loop. True if there is an object of the given class type that intersects with the current object, false otherwise. GreenfootImage getBackground Return the world’s background image. Return the world that this actor lives in, provided that it is an instance of the given “worldClass” class i.

The value returned is the vertical index of the actor’s cell in the world.

Actor (Greenfoot API)

Set an image for this actor from an image file. An object at the given location, or null if none found.

If possible, you should always use stopbecause the resources can be released after calling stop. The book ‘Introduction to Programming with Greenfoot’ is the official book used by both teachers and students.


The x-coordinate of the object’s current location. You can also access it from within Greenfoot – use the “Greenfoot Class Documentation” menu item, from the Help menu.

If the sound is currently looping, it will finish the current loop and stop. This method considers only logical location, ignoring extent of the image. The act method is called by the greenfoot framework to give actors a chance to perform some action. Font font field applying a new size to it. This method does nothing. Set a background image for the world from an image file. Assign a new location for this actor.


The rotation in degrees.

Zero degrees is towards the east right-hand side of the worldand the angle increases clockwise. Set the act order of objects in the world. If the image size is larger than the world in pixels, it is clipped. At each action step in the environment, each object’s act method is invoked, in unspecified order. CS Unplugged with Greenfoot.

greenfolt This constructor allows the option of creating an unbounded world, which actors can move outside the boundaries of. Return all the objects that intersect this object. Return all greenoot that intersect the center of the given location relative to this object’s location. Objects of a class not explicitly specified inherit the act order from their superclass.

Paint order is specified by class: An Actor is not normally instantiated, but instead used as a superclass to more specific objects in the world.