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

2020/3/19

setPaintOrder not working

APCSP-6 APCSP-6

2020/3/19

#
import greenfoot.*;  
import java.util.*;
public class Counter extends Actor
{

    public void act() 
    {
        if (isTouching(Waitress.class))
        {
            setPaintOrder(Waitress.class,Counter.class);
        }
    }
}
My set paint order is not working? What am I doing wrong??
danpost danpost

2020/3/20

#
APCSP-6 wrote...
What am I doing wrong??
Line 10 should be in the constructor of your world -- not in an Actor subclass.
APCSP-6 APCSP-6

2020/3/20

#
So it goes in the MyWorld?
danpost danpost

2020/3/20

#
APCSP-6 wrote...
So it goes in the MyWorld?
Yes.
APCSP-6 APCSP-6

2020/3/20

#
Okay, it is working now. Thank you so much!!
moraidai moraidai

2020/3/20

#
monsieur bonjour
You need to login to post a reply.