java.lang.Objectgreenfoot.World
RPSworld
public class RPSworld
The classic game of Rock-Paper-Scissors!
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 |
---|
public RPSworld()
Method Detail |
---|
public void act()
shoot
.
act
in class greenfoot.World
shoot()
public void shoot()
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 Item
s.
Item