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

2020/9/10

Why is this spawning in before I press "f"?

Pumk!n Pumk!n

2020/9/10

#
public void act()
    {
       
        if(Greenfoot.isKeyDown("f"));
        {
            addObject(new Wall(), 100, 10);
            addObject(new Wall(), 200, 60);
        }
                    }                    
danpost danpost

2020/9/10

#
You if block is one character (or statement) long -- and is void of brackets. Remove the semi-colon ( ";" ) from line 4.
Pumk!n Pumk!n

2020/9/10

#
thank you so much, I am pretty new to this, so thanks
You need to login to post a reply.