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

#1 2012-03-06 01:42:00

RenreiChan
New Scratcher
Registered: 2012-03-06
Posts: 1

Score help please!~

So I'm doing a game for my ICT class and it's basically a simple colour guessing one... except, if answer the question wrong, it just keeps going around to answering it again. I was wondering what script I would put in to make it change to the "GAME OVER" screen I made if the answer was wrong five times in a row? I tried putting in the "if" answer "does not equal" but I'm stuck for the rest.

If nobody knows that, how do I put a timer on each question to make it "GAME OVER" if it's not answered in ten seconds?

Arigatou!~

Offline

 

#2 2012-03-06 01:46:57

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Score help please!~

when gf clicked
if <not <(answer) = [correctanswer]>>
 broadcast [gameover v]
end
Then make a Game Over sprite that says  "Game Over". Put 2 scripts in it saying

When gf clicked
hide
When I receive [gameover v]
show
go to front
stop all
BTW: Are you in Brisbane School of Distance Education?

Last edited by jji7skyline (2012-03-06 01:47:58)


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#3 2012-03-06 02:21:26

trinary
Scratcher
Registered: 2012-01-29
Posts: 1000+

Re: Score help please!~

Use:

when gf clicked
set [wrong_in_a_row v] to (1)
set [question# v] to (1)
repeat until < (length of [questions v]) = (0) >
set [question# v] to (pick random (1) to (length of [questions v]) )
reset timer
ask (item (question#) of [questions v]) and wait
if <(timer) > (10) >
say [Sorry, you took too long.] for (2) secs
change [wrong_in_a_row v] by (1)
else
if < (answer) = (item (question#) of [answers v] ) >
say [Correct!] for (2) secs
delete (question#) of [questions v]
delete (question#) of [answers v]
set [wrong_in_a_row v] to (0)
else
say [Incorrect.] for (2) secs
change [wrong_in_a_row v] by (1)
end
end
if <(wrong_in_a_row) = (5)>
say [Sorry, you've answered 5 questions incorrectly in a row!] for (2) secs
broadcast [gameover v]
end
end
broadcast [gameover v]
In the sprite with the game over screen, use this:
when gf clicked
hide

when I receive [gameover v]
switch to costume [gameover v]

Last edited by trinary (2012-03-06 02:25:33)


http://trinary.tk/images/signature_.php

Offline

 

Board footer