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

2018/4/25

Help?

765ams29 765ams29

2018/4/25

#
I'm doing a project in my programming class rn, how do I get an actor to spawn after one of the same actor gets destroyed?
danpost danpost

2018/4/25

#
765ams29 wrote...
I'm doing a project in my programming class rn, how do I get an actor to spawn after one of the same actor gets destroyed?
In your World subclass act method, get the size of a list of that type object and compare it to the maximum number of those type objects you want in the world. If less than that maximum, spawn one of that type.
765ams29 765ams29

2018/4/25

#
danpost wrote...
765ams29 wrote...
I'm doing a project in my programming class rn, how do I get an actor to spawn after one of the same actor gets destroyed?
In your World subclass act method, get the size of a list of that type object and compare it to the maximum number of those type objects you want in the world. If less than that maximum, spawn one of that type.
Thank you, but how do I put all that into code?
danpost danpost

2018/4/25

#
765ams29 wrote...
how do I put all that into code?
I honestly do not know. I have no idea what you are working with. Did you try anything? Show some attempted code. Then, I might get an idea.
765ams29 765ams29

2018/4/26

#
danpost wrote...
765ams29 wrote...
how do I put all that into code?
I honestly do not know. I have no idea what you are working with. Did you try anything? Show some attempted code. Then, I might get an idea.
I have literally nothing, I can't think of anything that would work like that /: , is there no other way to spawn objects like this? It seems like a pretty simple thing to do in programming?
danpost danpost

2018/4/26

#
This tells you exactly what you need to do (and is probably the simplest).
You need to login to post a reply.