This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-05-17 13:18:18

football36
New Scratcher
Registered: 2012-05-15
Posts: 1

I have a problem with the NEXT button

my project has to do with a math problem.  I am trying tirelessly for a script that help me advance to the next screen once the correct answer is picked.  Please shed some wisdom!

Offline

 

#2 2012-05-17 13:26:48

mythbusteranimator
Scratcher
Registered: 2012-02-28
Posts: 1000+

Re: I have a problem with the NEXT button

If <(answer) = (correct)>
 broadcast [problem (whatever) v] // as many broadcasts as there are problems.
 
And then...
 
When i receive [problem (x) v] //for the backround, or backround sprite
 switch to costume [(x)] // or [i]switch to backround[/i]
 
I hope I helped!

Last edited by mythbusteranimator (2012-05-17 13:29:40)


http://www.foxtrot.com/comics/2012-04-01-fdb37077.gif
clicky

Offline

 

#3 2012-05-17 14:57:54

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: I have a problem with the NEXT button

A better one one (it involve a list, but has less broadcasts] would be

when gf clicked
set [nextanswer v] to 1
forever
if <(answer) = (questionanswer)>
broadcast [answerright v]
end
end

when I receive [answerright v]
next costume
change [nextanswer v] by 1
set [questionanswer v] to (item (nextanswer) of [answers v])
you'd need a list with all the answers in but that's about it


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#4 2012-05-18 21:56:10

atkeel
Scratcher
Registered: 2012-02-04
Posts: 52

Re: I have a problem with the NEXT button

Let's say there is 2 problems, 1+1 and 1+2. try:

(Sprite 1 smile

when gf clicked
add [2] to [answers list v]
add [3] to [answers list v]
repeat until <<answer> = <item (1 v) of [answers list v]
  ask [What is 1+1?] and wait
  if <<answer> = <item (1 v) of [answers list v]>>
    broadcast [1=correct v] and wait
end
repeat until <<answer> = <item (2 v) of [answers list v]
  ask [What is 1+2?] and wait
  if <<answer> = <item (2 v) of [answers list v]>>
    broadcast [2=correct v] and wait
end
(Stage:)
when gf clicked
switch to background [question 1 v]
when I receive [1=correct v]
switch to background [question 2 v]
when I receive [2=correct v]
switch to background [congrats! you won! v]


http://i272.photobucket.com/albums/jj183/Rainbow_Cows/cow_face.jpg Isn't he CUTE?!

Offline

 

#5 2012-05-18 22:49:36

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: I have a problem with the NEXT button

Check out my Maths Quiz here. It should help you if you check out the scripts.  wink

Last edited by jontmy00 (2012-05-18 22:50:04)


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#6 2012-05-19 06:48:23

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: I have a problem with the NEXT button

Atkeel, it'd be easier to do it with one broadcast and a next costume block


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#7 2012-05-19 10:35:33

AliensFTW
New Scratcher
Registered: 2012-05-01
Posts: 19

Re: I have a problem with the NEXT button

If you have more than one button in the same place (even if one is hiding) they might end up messing each other up. It happened in my project but I moved the button.

Offline

 

#8 2012-05-19 15:44:10

atkeel
Scratcher
Registered: 2012-02-04
Posts: 52

Re: I have a problem with the NEXT button

zammer990 wrote:

Atkeel, it'd be easier to do it with one broadcast and a next costume block

yes, but MINE IS REALLY ACCURATE!


http://i272.photobucket.com/albums/jj183/Rainbow_Cows/cow_face.jpg Isn't he CUTE?!

Offline

 

Board footer