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

#1 2012-02-12 13:47:17

djmorris96
New Scratcher
Registered: 2012-02-12
Posts: 7

Using Questions on Scratch

So for a school project I have to create a game. My game is like a trivia, somewhat similar to "who's still standing" So far, i can get the sprites to continue on point for if the person gets the answer right. BUT it screws up when i have the answer wrong. HELP!!! The project is due tomorrow

if <(answer) = Van Gogh>
    change [score v] by (1)
    play sound [scream-female1 v]
    hide
    broadcast [death1]
end
this is if they get the answer right. next is what i have to get the answer wrong. IT DOESNT WORK!!!!!

if <not <(answer) = Van Gogh>>
    set [score v] to (0)
    broadcast [playerdeath]
end
it switches to the game over background, but the next question will pop up... HELP

Offline

 

#2 2012-02-12 13:49:57

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Using Questions on Scratch

Please upload your project so I can further assist you.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#3 2012-02-12 13:56:35

djmorris96
New Scratcher
Registered: 2012-02-12
Posts: 7

Re: Using Questions on Scratch

its up. "Last Sprite Standing" by djmorris96

Offline

 

#4 2012-02-12 13:58:20

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Using Questions on Scratch

Change the broadcast [death] to a broadcast and wait, and then add stop all after that.

Offline

 

#5 2012-02-12 14:00:58

djmorris96
New Scratcher
Registered: 2012-02-12
Posts: 7

Re: Using Questions on Scratch

@scimonster Which death? the death1, drops the contestant and moves on to the next player. playerdeath is supposed to drop you and the game stops from there

Offline

 

#6 2012-02-12 14:00:58

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Using Questions on Scratch

djmorris96 wrote:

So for a school project I have to create a game. My game is like a trivia, somewhat similar to "who's still standing" So far, i can get the sprites to continue on point for if the person gets the answer right. BUT it screws up when i have the answer wrong. HELP!!! The project is due tomorrow

if < (answer) = Van Gogh>
    change [score v] by (1)
    play sound [scream-female1 v]
    hide
    broadcast [death1]
end
this is if they get the answer right. next is what i have to get the answer wrong. IT DOESNT WORK!!!!!

if <not <(answer) = Van Gogh>>
    set [score v] to (0)
    broadcast [playerdeath]
end
it switches to the game over background, but the next question will pop up... HELP

Instead of using the not block, use an if-else statement for the whole thing, like this:

if <(answer) = [Van Gogh]>
    change [score v] by (1)
    play sound [scream-female1 v]
    hide
    broadcast [death1]
else
    set [score v] to (0)
    broadcast [playerdeath]
end


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#7 2012-02-12 14:02:32

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Using Questions on Scratch

djmorris96 wrote:

@scimonster Which death? the death1, drops the contestant and moves on to the next player. playerdeath is supposed to drop you and the game stops from there

PlayerDeath.

Offline

 

#8 2012-02-12 14:27:22

djmorris96
New Scratcher
Registered: 2012-02-12
Posts: 7

Re: Using Questions on Scratch

thank you so much! the if-else statement fixed everything

Offline

 

#9 2012-02-12 14:33:55

djmorris96
New Scratcher
Registered: 2012-02-12
Posts: 7

Re: Using Questions on Scratch

NEVERMIND!!! STILL DOESNT WORK!! Is it just my computer. could someone try to download it and try?

Offline

 

#10 2012-02-12 14:43:40

Servine
Scratcher
Registered: 2011-03-19
Posts: 1000+

Re: Using Questions on Scratch

I can fix it. Just upload to your account.


http://bluetetrarpg.x10.mx/usercard/?name=Servine

Offline

 

#11 2012-02-12 14:50:02

djmorris96
New Scratcher
Registered: 2012-02-12
Posts: 7

Re: Using Questions on Scratch

http://scratch.mit.edu/projects/djmorris96/2328448

Offline

 

#12 2012-02-12 14:54:08

Servine
Scratcher
Registered: 2011-03-19
Posts: 1000+

Re: Using Questions on Scratch

djmorris96 wrote:

http://scratch.mit.edu/projects/djmorris96/2328448

Ok. Judging by the looks, your coding is fine. Ill try to fix thoguh.

EDIT: FIXED. Ill release the finished later!

Last edited by Servine (2012-02-12 14:55:13)


http://bluetetrarpg.x10.mx/usercard/?name=Servine

Offline

 

#13 2012-02-12 14:58:22

djmorris96
New Scratcher
Registered: 2012-02-12
Posts: 7

Re: Using Questions on Scratch

Servine wrote:

djmorris96 wrote:

http://scratch.mit.edu/projects/djmorris96/2328448

Ok. Judging by the looks, your coding is fine. Ill try to fix thoguh.

EDIT: FIXED. Ill release the finished later!

THANK YOU!!! ASAP please.

Offline

 

#14 2012-02-12 15:03:58

Servine
Scratcher
Registered: 2011-03-19
Posts: 1000+

Re: Using Questions on Scratch

Here it is!

I would have made that mistake, until I looked closer and found that if one of the answers is correct, it responds true, but then it checks if the answers were the EXACT as the given, and they weren't so its false. Basically, it works.

I also tweaked it a bit.


http://bluetetrarpg.x10.mx/usercard/?name=Servine

Offline

 

Board footer