This site requires JavaScript, please enable it in your browser!
Greenfoot back
ambrokato
ambrokato wrote ...

2021/5/3

Im trying to spawn a different monster in myWorld but i cant figure it out.

1
2
ambrokato ambrokato

2021/5/6

#
This the other button. I only use in the main menu,
public class Back extends Buttons
{
    
    
    
    public Back()
    {
        if (Greenfoot.mouseMoved(this))
        {
            setImage("back_hi.jpg");
        }
        if (Greenfoot.mouseMoved(getWorld()))
        {
            setImage("back.jpg");
        }
        
    }
    /**
     * Act - do whatever the Back wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {
        BacktoMain();
        
        if (Greenfoot.mouseMoved(this))
        {
            setImage("back_hi.jpg");
        }
        if (Greenfoot.mouseMoved(getWorld()))
        {
            setImage("back.jpg");
        }
    }
  
    public void BacktoMain()
    {
        
        if (Greenfoot.mouseClicked(this))
        {
            Greenfoot.setWorld(new Main());
            
            
        }
        if (Greenfoot.mouseMoved(this))
        {
            setImage("back_hi.jpg");
        }
        if (Greenfoot.mouseMoved(getWorld()))
        {
            setImage("back.jpg");
        }
    }
}
danpost danpost

2021/5/6

#
In switchToShop if statements, add condition of what current level should be.
ambrokato ambrokato

2021/5/7

#
danpost wrote...
In switchToShop if statements, add condition of what current level should be.
Came back to say Thanks Dan! appreciate your help!
You need to login to post a reply.
1
2