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

2012/4/13

Why is this not working (Using System Time)

PStigerID PStigerID

2012/4/13

#
In class:
    long millisIntersection;
    int checkMillis = 0; //!=0 check disabled
In act:
                if(checkMillis == 0) {
                    millisIntersection=System.currentTimeMillis();
                    int checkMillis = 1; }
                if(System.currentTimeMillis()-millisIntersection =< 10000)
                    Greenfoot.stop();
Thanks PStiger
danpost danpost

2012/4/13

#
If you are wanting the scenario to 'stop' AFTER 10 seconds, then you needs to use '>=' (not '=<'). You may also have to add another check in the same line (checkMillis == 1).
PStigerID PStigerID

2012/4/13

#
I just saw it as well...I need more Coffee!!!!! -_- Thanks.
You need to login to post a reply.