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

2015/12/8

Halp.

A2O A2O

2015/12/8

#
Why is it running the if( dx > -200) forever? -_- Pls dont ask me why I did it that complicated, I need it that way.
int dx = 0;
        
        if( phase == 0)
        {
            if( dx > -200 )
            {
                setLocation(getX() -3, getY() +1);
                dx = dx -3;
            }
}
Super_Hippo Super_Hippo

2015/12/8

#
Where is this code? If this is all in (or called from) the act method, then you set 'dx' to 0 every time, so it is never below -3.
A2O A2O

2015/12/8

#
You are fucking right, I'm stupid.
A2O A2O

2015/12/8

#
Sorry for swearing :c
You need to login to post a reply.