My program generates a bunch of cards for each player.
I was wondering how one would make it so that a person cannot see exactly what cards his opponent has, which is why I want to set them all to another image if so the player can't see them.
Here's what I tried so far:
import greenfoot.*;
public class CardWorld extends World
{
int playerCount = 2;
int turn;
boolean turnBoolean;
Player[] Player = new Player[playerCount];
public GreenfootImage BackCard = new GreenfootImage("CardBack.png");
Cards Card = new Cards();
public CardWorld()
{
super(845, 570, 1);
//SomeDice myDice = new SomeDice();
for (int i=0; i<playerCount; i++)
{
Player[i] = new Player();
addObject(Player[i], 436, 100+340*i);
}
}
public void act()
{
if (Greenfoot.mouseClicked(Player[turn%playerCount]))
{
Card.setImage(BackCard);
Player[turn%playerCount].CardSelect();
turn ++;
}
if (turn%playerCount == 1)
{
Card.setImage(BackCard);
}
}
}

