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

2020/6/15

IsTouching can't find symbol? Dance Dance Revolution game

Ipurplish Ipurplish

2020/6/15

#
The WasdButtons are like the arrows in dance dance revolution, but i have them in the center of the screen. "Note" is another class that comes down/up/across the screen, and collides with the WasdButton, at which point you hit the key it is touching to get points and remove the note. the wasdNum is used to determine which key is which. the myWorld sets the wasdNum of each key at world generation. But the isTouching is giving an error saying "can't find symbol - variable Note".
public class WasdButtons extends Actor
{
    int wasdNum;
    public void act() 
    {
        setButtons();
        if(Greenfoot.isKeyDown("w")&&wasdNum==1){
            if(isTouching(Note)){
            }
        }
    }   
    public void setButtons()[h1][/h1]
    {
        this.setImage(wasdNum+"wasd.png");
    }
}
please help! thankyou!
danpost danpost

2020/6/15

#
Ipurplish wrote...
But the isTouching is giving an error saying "can't find symbol - variable Note". << Code Omitted >>
Try "Note.class" in line 8 (it is expecting a class there where you had "Note").
Ipurplish Ipurplish

2020/6/15

#
awesome! thanks! it worked
You need to login to post a reply.