Class RPSworld

java.lang.Object
  extended by greenfoot.World
      extended by RPSworld

public class RPSworld
extends greenfoot.World

The classic game of Rock-Paper-Scissors!

Version:
0.5
Author:
Impirator

Field Summary
 
Fields inherited from class greenfoot.World
lock, READ_LOCK_TIMEOUT
 
Constructor Summary
RPSworld()
          Constructor for 3x1 board for playing Rock-Paper-Scissors.
 
Method Summary
 void act()
          Used to judge which side (if any) wins.
 void shoot()
          Randomly generates a rock-type, paper-type, or scissors-type Item in the leftmost and rightmost positions of the board.
 
Methods inherited from class greenfoot.World
addObject, getBackground, getCellSize, getColorAt, getHeight, getObjects, getObjectsAt, getWidth, isTiled, numberOfObjects, removeObject, removeObjects, repaint, setActOrder, setBackground, setBackground, setPaintOrder, setTiled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RPSworld

public RPSworld()
Constructor for 3x1 board for playing Rock-Paper-Scissors.

Method Detail

act

public void act()
Used to judge which side (if any) wins. It is only necessary to press 'act' as opposed to 'run' after a call to shoot.

Overrides:
act in class greenfoot.World
See Also:
shoot()

shoot

public void shoot()
Randomly generates a rock-type, paper-type, or scissors-type Item in the leftmost and rightmost positions of the board. This should be done prior to runtime. An invokation of this method resets the board to blank, before generating new Items.

See Also:
Item