Pages: 1
Topic closed
Hi,
I am new to Scratch and I would like to know what I would need to do to make a Rock Paper Scissor game that would have 2 opponents vs each other (no human interaction except clicking green flag) and how to make the variable count the wins.
I know some basic stuff like making variables, but I don't know how to get them to work as required above.
Thanks a lot.
Offline
I'm not going to be much of a help because i don't know how to make variables
but i would suggest making something easier because I've been using scratch for some time and you need to make the script work on your sprite and it is complicated so i would make that a goal for the future,
good luck!
Offline
Hi babbet,
Thank you for the reply, I'm vaguely familiar with how to set scripts on sprites, and some other basic stuff, however this is important to make as it is required for my class.
Offline
Aezek wrote:
Hi,
I am new to Scratch and I would like to know what I would need to do to make a Rock Paper Scissor game that would have 2 opponents vs each other (no human interaction except clicking green flag) and how to make the variable count the wins.
I know some basic stuff like making variables, but I don't know how to get them to work as required above.
Thanks a lot.
1. Make three variables, called P1, P2, and Result for simplicity.
2. Make a script that sets each variable to a random number from 1 to 3 using the "pick random" block.
3. Use game logic as follows, using a series of "if" blocks:
(We'll say that 1 = rock, 2 = paper, and 3 = scissors.)
If P1 = P2, then both players' moves are the same, so it's a draw. Set the variable Result to "Draw."
If P1 = 1 and P2 = 2, then set Result to "P2 Wins."
If P1 = 1 and P2 = 3, then set Result to "P1 Wins."
If P1 = 2 and P2 = 1, then set Result to "P1 Wins."
If P1 = 2 and P1 = 3, then set result to "P2 Wins."
If P1 = 3 and P1 = 1, then set Result to "P2 Wins."
If P1 = 3 and P1 = 2, then set Result to "P1 Wins."
That's the base code for it, just add graphics and a win/lose screen, and that's it!
The only difference between this and a player-input game is the random blocks.
If you still need help, I'd be more than happy to upload a base project for you.
Offline
Thanks for the help, cpumaster930, It really pointed me in the right direction and helped me a lot.
I'm running into a problem with the results however.
I have uploaded my project here - http://scratch.mit.edu/projects/Aezek/1972175
It's not counting the results or announcing the winner properly for some reason, I tried with both if= Operators and now I'm using if=/else Operators, and still the same results.
Thanks!
Offline
Aezek wrote:
Thanks for the help, cpumaster930, It really pointed me in the right direction and helped me a lot.
I'm running into a problem with the results however.
I have uploaded my project here - http://scratch.mit.edu/projects/Aezek/1972175
It's not counting the results or announcing the winner properly for some reason, I tried with both if= Operators and now I'm using if=/else Operators, and still the same results.
Thanks!
It seems you ran into a technical issue...apparently, the dog was calling the result out before the random numbers were picked, resulting in the dog displaying last round's results. It's a weird glitch There was also a script error in which you told the wrong variable to change.
The fixed version is here. Hope that helps
Offline
Lovely game really want to hear about soon
....................................
http://doubleyourlikes.blogspot.com
Offline
Topic closed
Pages: 1