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

2020/1/10

Can I make a World a superclass of another World?

LightningFast LightningFast

2020/1/10

#
I want to add an actor within the superclass constructor, but I don't know how to put it over an actor in my subclass.
danpost danpost

2020/1/10

#
LightningFast wrote...
"put it over an actor"
Please elaborate. What do you mean by this?
danpost danpost

2020/1/10

#
LightningFast wrote...
Can I make a World a suprclass of another World?
A World subclass can have a subclass of its own (a sub-subclass, if you will). It, in turn, can also be extended from, etc.
LightningFast LightningFast

2020/1/10

#
I have a scrolling background in Level1World and I'm adding heart objects in the superclassWorld. I want to add life (heart objects) over the background objects because right now they're being covered. I don't know what to do.
danpost danpost

2020/1/10

#
LightningFast wrote...
I have a scrolling background in Level1World and I'm adding heart objects in the superclassWorld. I want to add life (heart objects) over the background objects because right now they're being covered. I don't know what to do.
You can just use the setPaintOrder method in your World subclass constructor:
public Level1World()
{
    super(600, 400, 1);
    setPaintOrder(Heart.class);
    // etc.
LightningFast LightningFast

2020/1/10

#
it works thank you!!!!!
You need to login to post a reply.