Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Problem with making all sprites Clones (or no sprites Clones)
- aPapaTaco
- New to Scratch
4 posts
Problem with making all sprites Clones (or no sprites Clones)
Hiya! I'm making a card game and I use clones of a card Sprite to populate the player's hand. The problem is that after cards are dealt, the last card drawn is not considered a clone. How can I fix that?
The code repeats 5 times to
The first 4 copies are clones, but the 5th one remains the sprite itself, which is causing some issues. I also have code randomizing which cards are drawn (by randomizing costumes), and the pos of the cards, but I wasn't sure if that would be relevant to this question.
Alternatively, is there a way to replicate the sprite 5 times without using clones? That might even be a better fix, TBH. It seems like some code treats clones differently than sprites, and some code treats them the same, which is what is causing issues.
The code repeats 5 times to
create clone of [myself v]
The first 4 copies are clones, but the 5th one remains the sprite itself, which is causing some issues. I also have code randomizing which cards are drawn (by randomizing costumes), and the pos of the cards, but I wasn't sure if that would be relevant to this question.
Alternatively, is there a way to replicate the sprite 5 times without using clones? That might even be a better fix, TBH. It seems like some code treats clones differently than sprites, and some code treats them the same, which is what is causing issues.
- CodesNorth
- Scratcher
66 posts
Problem with making all sprites Clones (or no sprites Clones)
Hi! Perhaps try using this code.
when green flag clicked
repeat (5)
create clone of [ myself]
end
hide
when I start as a clone
show
Don't code south. It's really not worth it.
- invalidaccess
- Scratcher
100+ posts
Problem with making all sprites Clones (or no sprites Clones)
Hiya! I'm making a card game and I use clones of a card Sprite to populate the player's hand. The problem is that after cards are dealt, the last card drawn is not considered a clone. How can I fix that?https://scratch.mit.edu/projects/992071436/ check this out
The code repeats 5 times tocreate clone of [myself v]
The first 4 copies are clones, but the 5th one remains the sprite itself, which is causing some issues. I also have code randomizing which cards are drawn (by randomizing costumes), and the pos of the cards, but I wasn't sure if that would be relevant to this question.
Alternatively, is there a way to replicate the sprite 5 times without using clones? That might even be a better fix, TBH. It seems like some code treats clones differently than sprites, and some code treats them the same, which is what is causing issues.
- aPapaTaco
- New to Scratch
4 posts
Problem with making all sprites Clones (or no sprites Clones)
CodesNorth, yes! That fixed the problem. Thank you.
invalidaccess, I will take a look at that. Thank you.
invalidaccess, I will take a look at that. Thank you.
- Discussion Forums
- » Help with Scripts
- » Problem with making all sprites Clones (or no sprites Clones)