Pages: 1
Topic closed
Hello
I have a sprite called blobby and a bullet sprite. When the bullet sprite touches blobby, blobby hides and a counter called point increases by 1. Note the code works but I guess it could have been written better. I have two blobbies on screen at the start. How do I get more blobbies to appear on stage when one dies? Thank you in advance.
Offline
There's really no way to dynamically duplicate the blobbies...I would just reuse the blobbies that are already dead like this:
//Use the "get a blobby" broadcast to resurrect a blobby that's already dead //We have a variable we need to set called "need a blobby" When I receive [blobby death]: set need a blobby to 1 broadcast [get a blobby] //This code goes on the blobbies: When I receive [get a blobby]: if <i am dead = 1>: //do something to make me alive again... set need a blobby to 0
That way you can have "infinite" blobbies, as long as there are never too many on screen at once.
Offline
msa969 wrote:
Thank you fullmoon,
I will give this a go.
Just one final question
how do I broadcast blobby is dead?
And will i check for the broadcast on the blobby?
That's sort of up to you. I guess I would broadcast [blobby death] from a blobby when it dies (i.e., right after the "hide" block).
And no, that script is supposed to go on the stage.
Offline
Topic closed
Pages: 1