Discuss Scratch

djrolexvb
Scratcher
5 posts

Choose your own adventure

making choices afect what happens
erin13ninja
Scratcher
60 posts

Choose your own adventure

Hi, can you be more specific with exactly what it is you need help with?
djrolexvb
Scratcher
5 posts

Choose your own adventure

I need to make the awnser of a player to a question make a happen if they thype in 1 and b for 2.

like if they awnser yes say say if they awnser no say awww
MajesticGalaxy
Scratcher
12 posts

Choose your own adventure

Heres a example of a multi-chose script,
so lets start by making 2 button scritps:
Button #1:
whenclickedshowwhenthisspriteclickedbroadcast Chose BurgerhidewhenIreceive Chose Pizzahide
Button#2:
whenclickedshowwhenthisspriteclickedbroadcast Chose PizzahidewhenIreceiveChose Burgerhide

And make a random sprite:
whenIreceive Chose PizzasayYou chose Pizza!whenIreceive Chose BurgersayYou chose Burger!
Let me know if this helped. Good luck
TheNonNameMouse
Scratcher
88 posts

Choose your own adventure

I haven't tried, but it's hard and you have to list out all the combinations. I suggest using a variable or a list.
MajesticGalaxy
Scratcher
12 posts

Choose your own adventure

djrolexvb wrote:

I need to make the awnser of a player to a question make a happen if they thype in 1 and b for 2.

like if they awnser yes say say if they awnser no say awww
What do you mean when you say “1 and b for 2”?
djrolexvb
Scratcher
5 posts

Choose your own adventure

Thank you evreyone for the help espicialy MajesticGalaxy
djrolexvb
Scratcher
5 posts

Choose your own adventure

and ya basicly 1 dose this 2 dose this
deck26
Scratcher
1000+ posts

Choose your own adventure

Someone asked in another topic about levels - the logic isn't that different even though you're not going through the different steps in a fixed order. Here's a slightly edited version of my reply on that topic.


Any game with levels will have things that are common in all levels (eg movement controls) and things that are different (backdrops, hazards etc). you need to work out which are which.

Use variables to keep track of the current state of things and use appropriate blocks to control what happens.

examples

whenxkeypressediflevel=2 thendosomethingelseiflevel=3 thendosomethingelseelse different behaviour for different levels
As you can see there are different things you can do so it depends on the project. You may use multiple methods in one project according to how the sprites etc behave.
TheUltimatepixel
Scratcher
19 posts

Choose your own adventure

Variables could help
I was thinking of 3 holes

whichhole
askGo to which holeandwaitifscratchblocksif(Which hole)<4 and(Which hole)>0sayThis is not including but add the answers in/scratchblocks
MajesticGalaxy
Scratcher
12 posts

Choose your own adventure

Oh did you mean the “whats you name” part?
If so, use this:

whenthisspriteclickedaskWhat is you nameandwaitifanswer= 1thenset nameto Dylanelseifanswer= 2thenset nameto Andrewelseifanswer= 3thenset nameto Stephenelseifanswer= 4thenset nameto Curry
Did that help?
djrolexvb
Scratcher
5 posts

Choose your own adventure

yah that helped, thanks to the following majestic galaxy, Deck 26, and TheUltimatepixel.

Check out my project please, as it gets better using your help!

Powered by DjangoBB