I think it would help more if you just posted the entire class codes instead of snippets from them. Also, please use the 'code' link below the reply box for inserting code into you posts.


import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class background2 here. * * @author (your name) * @version (a version number or a date) */ public class background2 extends World { /** * Constructor for objects of class background2. * */ public background2() { // Create a new world with 600x400 cells with a cell size of 1x1 pixels. super(500, 350, 1); start2 secondstart2 = new start2(); addObject(secondstart2,318,395); player1 player1 = new player1(); addObject(player1,165,152); player2 player2 = new player2(); addObject(player2,454,149); langa langa = new langa(); addObject(langa,84,273); langb6 langb6 = new langb6(); addObject(langb6,454,149); langb56 langb56 = new langb56(); addObject(langb56,454,149); langb5 langb5 = new langb5(); addObject(player1,454,149); } }
public void act() { if (Greenfoot.mouseClicked(start)); getWorld().setBackground(new GreenfootImage("background2.png")); } }