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

#1 2012-06-14 14:50:20

11janssena
New Scratcher
Registered: 2012-06-14
Posts: 1

Collecting things

Hi everyone,
I need help! does anybody know how to collect and score points. I need it school, so quickly, please!
Thanks,  smile 
11janssena

Offline

 

#2 2012-06-14 15:13:09

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: Collecting things

You will need a variable for the score, and then a script that changes the variable when someone scores.


Why are the secret organizations getting all the attention?  mad

Offline

 

#3 2012-06-16 06:44:29

InfinityCore
Scratcher
Registered: 2012-05-12
Posts: 8

Re: Collecting things

Let's say if someone scores a point for touching a apple.

The script would say

When the flag is clicked
forever [
wait until touching apple [
change score by 1 ]]

So basically if you touch the apple it will change your score by 1


http://24.media.tumblr.com/tumblr_m5z970MWLx1rzo5q1o1_1280.png

Offline

 

#4 2012-06-20 09:51:42

skippito
Scratcher
Registered: 2012-03-17
Posts: 100+

Re: Collecting things

Here is a script for the points.

when gf clicked
forever
  wait until <touching [Thing v]?>
  change [Score v] by [How many points the thing it collected is worth]
end

Last edited by skippito (2012-06-21 13:23:03)

Offline

 

#5 2012-06-21 13:17:34

InfinityCore
Scratcher
Registered: 2012-05-12
Posts: 8

Re: Collecting things

skippito wrote:

Here is a script for the points.

when gf clicked
forever
  wait until <touching [Thing v]?>
  change [Score v] by [How many points the thing it collected is worth]
end

Since i'm rubbish at coding blocks in forums i'll describe it.

Since forever if you are touching it, it will change points you are left with 2 options:
-Either hide the sprite which gives you the points (or move it) once touched
-or wait until not touching sprite until able to wait to touch sprite.


http://24.media.tumblr.com/tumblr_m5z970MWLx1rzo5q1o1_1280.png

Offline

 

#6 2012-06-21 13:27:13

skippito
Scratcher
Registered: 2012-03-17
Posts: 100+

Re: Collecting things

OK. Try putting this in the things being collected:

when gf clicked
forever
  wait until <touching [collector v]?>
  go to x: (pick random [-180] to [180]) y: (pick random [-180] to [180])
  change [Score v] by [the number of points the thing being collected is worth]
end
I hope this helped.   smile

Last edited by skippito (2012-06-21 13:28:17)

Offline

 

Board footer