Hi all,
After trying to find an app or program to do what I need, but haven't found one yet so figured I may be able to do it in Scratch!
Anyway, I originally looked for a manual/user guide that was comprehensive - is there one?
Ok, on to what I'm trying to achieve.
Basically, I am designing a few board games and rather than using paper cards and dice, I want to simulate them. I'd love to be able to show an image with each as it comes up if possible.
Ideally, I'd like to be able to do 2 main things:
1) create a list of any number of named "cards" or "die faces", e.g.
"Spring, Summer, Winter, Fall"
Or
"1, 2, 2, 3, 3, 4, stop, go"
Or even a standard deck of cards. I'd like to assign a quantity to each item in the list.
2) randomly choose from the list and display the results (pictures would be great if possible. I can easily create all needed graphics.)
3) subtract 1 from the quantity value assigned from each
4) choose randomly again from the remaining quantities.
An important bonus would be if I can tally how many of each list item I've used so that I can tweak the gameplay.
Any suggestions for where to get started/tutorials would be greatly appreciated!
Thanks,
Andrew
Offline
Try the wiki.
Right now I can't help, but wait about 5 minutes and someone will come along.
Offline
Multidimensional lists aren't available in scratch, but you can easily do the same with 2 lists. Have a list called Cards, and a list called Quantity, then when you display a random card, just select a random list item from cards, check if the corresponding entry in Quantity is above 1, then display it, then subtract 1 from the Quantity list. It's usually best to draft out a basic engine in Scratch, before adding in the graphics, so for now, you could have the scratch cat saying what card is drawn, or whatever, before you add in all the graphics.
Generally, this makes game programming more simple to debug and fix.
Offline
I can help you tomorrow, or you can try to figure it out with this:
I see you've gotten the random part down: or do you?
But once you have the part to put it in a list, you have to then wait for the player to "draw a card", and remove it from the list, and add one to that count. Make sure it automatically redraws/shuffles when the list is empty
What you can do is: just give the cards number from 1-8, and just make the costume match for each one, because since ice is 1, the costume number for ice should be 1. do you get it?
If not, just give me the graphics and I can help you tomorrow.
Offline
hi kayybee -
Yeah, I think I just have to learn how to show/hide sprites. Ran out of time last nite...
Also wish I could make the programming area and stage bigger.
One thing that would be a big help: being able to total values in a list!
cheers
Andrew
Offline
To total values in a list, just go:
when green flag clicked set [count v] to (1) set [variable v] to (0) repeat (length of [list v]) change [variable v] by (item (count) of [list v]) change [count v] by (1) endAnd, there is a block for hiding and showing, under looks:
show hide
Last edited by kayybee (2012-09-11 19:19:56)
Offline