I want the coins to scroll with the background, thius is the code:
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class coi here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class coi extends animal
{
/**
* Act - do whatever the coi wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void moveCoins(int dx, int dy) {
<coin> coins = getObjects(Coin.class);
for (Coin coin : coins) {
coin.setLocation(coin.getX() + dx, coin.getY() + dy);
}
}
}