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

2014/1/23

Code suddenly stopped working?

Nooyi Nooyi

2014/1/23

#
Hello, I'm programming a game. Until today, it worked very well but suddenly it doesn't. I'm using a method for detecting balks (see code down) but now my little character is convinced that there are balks everywhere around him, whether there is a free field or not. I have no idea where this is suddenly coming from, I changed nothing in this code piece but anyway it stopped working. This is an example code piece, there are three more (left, up and down):
public boolean balkRight() {
    int x = getX(); 
    int y = getY(); 
    move(1);
    if (isTouching(tree.class) || isTouching(explodingBalk.class))  {
            move(-1);                       
            return true;                    
        }
    else    {
            move(-1);            
            return false;
    }
}
Is there anybody who could help me?
Nooyi Nooyi

2014/1/23

#
ok solved it :)
You need to login to post a reply.