Class Bubble

java.lang.Object
  extended by greenfoot.Actor
      extended by SmoothMover
          extended by Bubble

public class Bubble
extends SmoothMover

This class creates a Bubble object

Version:
12.06.2015
Author:
Maria - Despoina Gkaintatzi

Constructor Summary
Bubble(int size)
          Constructor for the objects of class Bubble.
Bubble(int size, Vector speed, java.lang.String message, java.awt.Font font, int x)
          Constructor for the objects of class Bubble.
 
Method Summary
 void act()
          Act - do whatever the Bubble wants to do.
 void setSize(int size)
          Sets the size of this bubble.
 
Methods inherited from class SmoothMover
accelerate, addForce, getExactX, getExactY, getMovement, getSpeed, increaseSpeed, move, moveOneStep, setLocation, setLocation, setMovement, stop
 
Methods inherited from class greenfoot.Actor
addedToWorld, getImage, getIntersectingObjects, getNeighbours, getObjectsAtOffset, getObjectsInRange, getOneIntersectingObject, getOneObjectAtOffset, getRotation, getWorld, getX, getY, intersects, isAtEdge, isTouching, move, removeTouching, setImage, setImage, setRotation, turn, turnTowards
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bubble

public Bubble(int size)
Constructor for the objects of class Bubble.

Parameters:
size(int) - the desirable size

Bubble

public Bubble(int size,
              Vector speed,
              java.lang.String message,
              java.awt.Font font,
              int x)
Constructor for the objects of class Bubble.

Parameters:
size(int) - the desirable size
speed(Vector) - the speed of the bubble
message(String) - the message to be displayed
font(Font) - the fonts of the message
x(int) - the x coordinate where the bubble image will be drawn
Method Detail

act

public void act()
Act - do whatever the Bubble wants to do. This method is called whenever the 'Act' or 'Run' button gets pressed in the environment.

Overrides:
act in class greenfoot.Actor

setSize

public void setSize(int size)
Sets the size of this bubble.

Parameters:
size(int) - the desirable size