Class Snail

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

public class Snail
extends SmoothMover

This class creates a Snail object.

Version:
24.04.2015
Author:
Maria - Despoina Gkaintatzi

Constructor Summary
Snail(int size)
          Constructor for the objects of class Snail.
Snail(int size, Vector speed)
          Constructor for the objects of class Snail.
 
Method Summary
 void act()
          Act - do whatever the Snail wants to do.
 void makeSound(boolean correct)
          Makes a sound every time a key is pressed.
 void setSize(int size)
          Sets the size of this snail.
 
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

Snail

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

Parameters:
size(int) - the desirable size

Snail

public Snail(int size,
             Vector speed)
Constructor for the objects of class Snail.

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

act

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

Overrides:
act in class greenfoot.Actor

makeSound

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

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

setSize

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

Parameters:
size(int) - the desirable size