Discuss Scratch

khoakhiem
Scratcher
58 posts

My Diep.io Game

I made a Diep.io game, and I'm not sure how to add the shapes and their life. Can someone help?
https://scratch.mit.edu/projects/112584136/
awesome-llama
Scratcher
1000+ posts

My Diep.io Game

Have clones of the shapes, and their life can be recorded in a local variable. Local variables are unique for each clone, so each cloned shape can have independent life. The life can easily be subtracted and when it reaches 0, the clone is dead, and deleted.
khoakhiem
Scratcher
58 posts

My Diep.io Game

Thanks!
khoakhiem
Scratcher
58 posts

My Diep.io Game

Now wait, it doesn't work. When the life gets to zero, ALL the other clones die. Help?
awesome-llama
Scratcher
1000+ posts

My Diep.io Game

khoakhiem wrote:

Now wait, it doesn't work. When the life gets to zero, ALL the other clones die. Help?
Make sure the health is a local variable, not global. If you did do it and still happens, did you use a broadcast to change life. The clones may all detect the same signal, therefore all clones die.
I cannot see the project, since I am using a tablet, not a computer.

Last edited by awesome-llama (June 6, 2016 05:21:04)

khoakhiem
Scratcher
58 posts

My Diep.io Game

Thanks!
khoakhiem
Scratcher
58 posts

My Diep.io Game

Hey, you have a computer to work on?
awesome-llama
Scratcher
1000+ posts

My Diep.io Game

khoakhiem wrote:

Hey, you have a computer to work on?
Yes I do, but just couldn't acces it at that time.

khoakhiem wrote:

Now wait, it doesn't work. When the life gets to zero, ALL the other clones die. Help?

Anyway, I played it, but seems to works fine, and the clones act individual and don't all die together.

Last edited by awesome-llama (June 7, 2016 10:28:13)

Powered by DjangoBB