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

#1 2012-03-19 03:15:41

SonicBoom84
New Scratcher
Registered: 2012-03-19
Posts: 3

please, help me!!

whats the coding so, that when you touch 1 out of the 2 platforms, it says correct or incorrect depending on what platform you land on and goes onto the next level, if you get the answer correct. please help me, its for an assignment. Thanks SonicBoom84

Offline

 

#2 2012-03-19 03:53:53

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

Re: please, help me!!

Put this script platform 1.

when I receive [levelstart v]
if <not <(level) = (something)> >
set [answered v] to (0)
go to x: (xpositionofsprite) y: (ypositionofsprite)
switch to costume (level)
wait until < <touching [player v]?> or < (answered?) = (1) > >
if <touching [player v]?>
set [answered? v] to (1)
if < (item (level) of [answers v] ) = [1] >
say [Correct!] for (2) secs
change [level v] by (1)
broadcast [levelstart v]
else
say [Incorrect!] for (2) secs
broadcast [levelstart v]
end
end
end
Put this script platform 2.
when I receive [levelstart v]
if <not <(level) = (something)> >
set [answered v] to (0)
go to x: (xpositionofsprite) y: (ypositionofsprite)
switch to costume (level)
wait until < <touching [player v]?> or < (answered?) = (1) > >
if <touching [player v]?>
set [answered? v] to (1)
if < (item (level) of [answers v] ) = [2] >
say [Correct!] for (2) secs
change [level v] by (1)
broadcast [levelstart v]
else
say [Incorrect!] for (2) secs
broadcast [levelstart v]
end
end
end
Put this in the sprite that the player controls.
when I receive [levelstart v]
go to x: (whereyouwantittostart) y:(whereyouwantittostart)
Basically, you have a lot of costumes for each of the platforms.
Each of the platforms' costumes shows a possible answer for each question.
You set which platform is the correct one by adding a '1' or '2' to the list 'answers', with '1' specifying the correct platform as platform 1 and '2' as the correct platform being costume 2.
Each time, if the correct platform is landed upon the level is increased by 1.
Else, the level is restarted.
You can script what you want on each level to happen using the 'level' variable.

Is this what you are looking for?

Last edited by trinary (2012-03-19 03:59:19)


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

Offline

 

#3 2012-03-19 04:57:53

SonicBoom84
New Scratcher
Registered: 2012-03-19
Posts: 3

Re: please, help me!!

thx, i will try it, it should be what i am looking for

Offline

 

#4 2012-03-19 05:25:53

SonicBoom84
New Scratcher
Registered: 2012-03-19
Posts: 3

Re: please, help me!!

sorry, to say but its not working, i did everything it the pictures said.

Offline

 

Board footer