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

2014/1/17

memory game

Vigelandzoon Vigelandzoon

2014/1/17

#
I am making a game in greenfoot and i am trying to make 2 of the same images dissapear when the are clicked on but they dissapear automaticaly when i run the programe. I hope that i can get some advice
public void opencard()

    {
        int duiker = 0;
        int duiker2 = 0;
        if (duiker == duiker2)
        {

            if(Greenfoot.mouseClicked(Duiker.class))
            {
                setImage("duiker_tcm46-175501.jpg");
                if(Greenfoot.mouseClicked(duiker2))
                {
                    duiker2 = 1;

                }

                duiker = 1;
                {
                    getWorld().removeObject(this);

                }

            }
            else if(Greenfoot.mouseClicked(this))
            {
               setImage("duiker_tcm46-175501.jpg");
               Greenfoot.delay(150);

              setImage("150px_RGB_WEBSAFE_D_B_G_26-29652.gif");

            }
        }
    }
Vigelandzoon Vigelandzoon

2014/1/17

#
[Disallowed URL]
You need to login to post a reply.