java.lang.Objectgreenfoot.World
City
public class City
Class City represents the world from which Snail is trying to escape. Players must type the letter they see on top of the screen. The more they type correctly the faster Snail moves.
| Constructor Summary | |
|---|---|
City(Snail snail)
Constructor for objects of class City. |
|
| Method Summary | |
|---|---|
void |
act()
Act method for class City. |
void |
changeButtonColor()
Changes the colour of the button to be typed. |
void |
changeCityImage()
Changes the background image according to the level, when passes to the next level |
void |
checkClick()
Removes message if someone clicks in it. |
void |
checkLives()
Checks if the player has used all the lifes he has and ends the game. |
void |
gameOver(java.lang.String message)
This method is called when the game is over to display the final score. |
Counter |
getLifeCounter()
Returns the lifeCounter. |
Counter |
getScoreCounter()
Returns the scoreCounter. |
void |
prepare()
Initiates components that will be included in the constructor |
void |
resetButtonColor(java.lang.String letter)
Resets the colour of the button after the correct key is typed. |
void |
scrollBackground()
Makes background scroll |
Button |
whichButton(java.lang.String letter)
Finds the correct key according to the given letter. |
| Methods inherited from class greenfoot.World |
|---|
addObject, getBackground, getCellSize, getColorAt, getHeight, getObjects, getObjectsAt, getWidth, numberOfObjects, removeObject, removeObjects, repaint, setActOrder, setBackground, setBackground, setPaintOrder, showText, started, stopped |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public City(Snail snail)
| Method Detail |
|---|
public void act()
act in class greenfoot.Worldpublic void changeButtonColor()
public void changeCityImage()
public void checkClick()
actor(Actor) - the actor to be removed.public void checkLives()
public void gameOver(java.lang.String message)
message(String) - the message to be displayed when the game is over.public Counter getLifeCounter()
public Counter getScoreCounter()
public void prepare()
public void resetButtonColor(java.lang.String letter)
public void scrollBackground()
public Button whichButton(java.lang.String letter)
letter(String) - the letter of the key in question.