Throws: - If there is no world instantiated. Returns: The height of the object, or -1 if it has no image. That an object's image overlaps vertically. Public int getHeight() Return the height of the object. Parameters: world - The world the object was added to. This method can be overridden to implementĬustom behavoiur when the actor is inserted into the world. Protected void addedToWorld(greenfoot.World world) This method will be called by the Greenfoot system when the object hasīeen inserted into the world. At each action step in the environment,Įach object's act method is invoked, in unspecified order. Public void act() The act method is called by the greenfoot framework to give objects aĬhance to perform some action. Methods inherited from class Ĭlone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait Set an image for this object from an image file. Set the image for this object to the specified image. Return the y-coordinate of the object's current location.Ĭheck whether this object intersects with another given object. Return the x-coordinate of the object's current location. Return the world that this object lives in. Return the current rotation of the object. Return one object that is located at the specified cell (relative to this Return an object that intersects this object. Return all objects within range 'r' around this object. Return all objects that intersect the given location (relative to this Return the neighbours to this object within a given distance. Return all the objects that intersect this object. Returns the image used to represent this Actor. This method will be called by the Greenfoot system when the object has The act method is called by the greenfoot framework to give objects a The method here is empty, and subclasses normally provide their own implementations. Is called when the 'Act' or 'Play' buttons are activated in the Greenfoot interface. One of the most important aspects of this class is the 'act' method. Public abstract class Actor extends Īn Actor is an object that exists in the Greenfoot world.Įvery Actor has a location in the world, and an appearance (that is:Īn Actor is not normally instantiated, but instead used as a superclass
0 Comments
Leave a Reply. |