How do i make an actor move relative to the result of a die. My die code is below, how can I gather information from one actor and give it to another (similar to worldref) and then to move the actor accordingly to the result of the dice. Many thanks
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.Color;
/**
* Write a description of class Dice here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Dice extends Actor
{
/**
* Act - do whatever the Dice wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
if (Greenfoot.mouseClicked(this))
{
int randNumber = Greenfoot.getRandomNumber(4);
randNumber = randNumber + 1;
GreenfootImage Dice = new GreenfootImage( randNumber+"" , 25, Color.WHITE, Color.BLACK);
set

