Class Balloon

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

public class Balloon
extends SmoothMover

This class creates a Balloon object.

Version:
24.04.2015
Author:
Maria - Despoina Gkaintatzi

Constructor Summary
Balloon(int size)
          Constructor for objects of class Balloon.
Balloon(int size, Vector speed, java.lang.String letter)
          Constructor for objects of class Balloon
 
Method Summary
 void act()
          Act - do whatever the Balloon wants to do.
 void breakBalloon()
          Breakes the balloon.
 void drawSomeLetter(java.lang.String letter, java.awt.Color color)
          Draws a given letter in a specific color in the image that represents the actor.
 void makeSound(boolean correct)
          Makes a sound every time a key is pressed.
 void setSize(int size)
          Sets the size of this balloon.
 
Methods inherited from class SmoothMover
accelerate, addForce, getExactX, getExactY, getMovement, getSpeed, increaseSpeed, move, moveOneStep, setLocation, setLocation, 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

Balloon

public Balloon(int size)
Constructor for objects of class Balloon.

Parameters:
size(int) - the size of the balloon

Balloon

public Balloon(int size,
               Vector speed,
               java.lang.String letter)
Constructor for objects of class Balloon

Parameters:
size(int) - the size of the balloon
speed(Vector) - the speed of the balloon
Method Detail

act

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

Overrides:
act in class greenfoot.Actor

breakBalloon

public void breakBalloon()
Breakes the balloon.


drawSomeLetter

public void drawSomeLetter(java.lang.String letter,
                           java.awt.Color color)
Draws a given letter in a specific color in the image that represents the actor.

Parameters:
letter(String) - the letter to be drawn in the balloon
color(Color) - the color of the letter

makeSound

public void makeSound(boolean correct)
Makes a sound every time a key is pressed. The sound differs according to whether the key being pressed is the expected key.

Parameters:
correct(boolean) - true if the key is correct

setSize

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

Parameters:
size(int) - the desirable size