Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » sprites in a list
- PloniAlmoni
- New to Scratch
7 posts
sprites in a list
Hi,
I'm trying to make a card game. What I have done so far is upload all of the individual cards as sprites. Now I would like to make a list of these sprites that I can choose like 5 cards from randomly. Any pointers on how to make a list of sprites and then choose them randomly?
Thank you.
Ploni
I'm trying to make a card game. What I have done so far is upload all of the individual cards as sprites. Now I would like to make a list of these sprites that I can choose like 5 cards from randomly. Any pointers on how to make a list of sprites and then choose them randomly?
Thank you.
Ploni
- scubajerry
- Scratcher
1000+ posts
sprites in a list
Look at the code in the STAGE for my solitaire game There is a lot of stuff, but look mostly at the DECK list. There is a unique number (1-52) for each card. They are ordered 2-A for each suit and repeats 4 times. Every one of the 52 clones knows its unique number (1-52).
Last edited by scubajerry (Jan. 19, 2014 14:11:53)
- PloniAlmoni
- New to Scratch
7 posts
sprites in a list
Oh wow!
This looks extremely complicated to me at present. I'm totally new to scratch and to programming all together. Maybe I should think of an easier first project. ;/
Ploni
P.S. Oh, I noticed that you did not have to upload 52 sprites, one for each card. How did you do that; like an .svg file as one sprite?
This looks extremely complicated to me at present. I'm totally new to scratch and to programming all together. Maybe I should think of an easier first project. ;/
Ploni
P.S. Oh, I noticed that you did not have to upload 52 sprites, one for each card. How did you do that; like an .svg file as one sprite?
Last edited by PloniAlmoni (Jan. 19, 2014 14:14:56)
- PloniAlmoni
- New to Scratch
7 posts
sprites in a list
What I was thinking was to upload all of the cards as an individual sprite, which is what I have already done, then put all of these sprites (cards) into a list then randomly select, say, 5 cards for each player… 5 hidden for the ‘bot’ and 5 exposed to the player. Looks like you have an easier way for the list though.
- scubajerry
- Scratcher
1000+ posts
sprites in a list
It can be complicated. I first did solitaire as one sprite with 52 costumes. I had the sprite go to the right place, change to the right costume and STAMP its image on the background. That was a pain.
Next I did it with 1 sprite and had 52 clones (I was looking for a way to learn clones). Each clone knows who it is and responds appropriately to the rules of solitaire. That was less of a pain, but I had advanced my knowledge of scratch a bunch by then.
You can do it with 52 sprites, but it would it would also be a pain. The advice I would give you is start with just a few cards until you are SURE you have the script right. I don't think you want to be updating 52 scripts very often.
Next I did it with 1 sprite and had 52 clones (I was looking for a way to learn clones). Each clone knows who it is and responds appropriately to the rules of solitaire. That was less of a pain, but I had advanced my knowledge of scratch a bunch by then.
You can do it with 52 sprites, but it would it would also be a pain. The advice I would give you is start with just a few cards until you are SURE you have the script right. I don't think you want to be updating 52 scripts very often.
- scubajerry
- Scratcher
1000+ posts
sprites in a list
Oh wow!
P.S. Oh, I noticed that you did not have to upload 52 sprites, one for each card. How did you do that; like an .svg file as one sprite?
I copied it from someone else who had magically done all the artwork. You are welcome to use “my” costumes.
- PloniAlmoni
- New to Scratch
7 posts
sprites in a list
Well, I'm trying to do Uno, which is easy enough to do with tcl script on an IRC eggdrop so I figured it must be doable on Scratch as well. As such, my costumes would be different consisting of the 108 cards used in Uno.
Ploni
Ploni
- scubajerry
- Scratcher
1000+ posts
sprites in a list
Uno would be easier. You can search on Scratch for UNO and see how others have done it and get costumes. Scratch is all about sharing, as long as you give credit in the notes.
Last edited by scubajerry (Jan. 19, 2014 14:57:46)
- Discussion Forums
- » Help with Scripts
- » sprites in a list