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

#1 2012-11-11 21:45:25

spear8407
New Scratcher
Registered: 2012-11-11
Posts: 2

Help with Scoring System

I am trying to create a scoring system but can't seem to get it right. Here is how I have my score written out:

When I receive <test>
If <touching image 2>
    switch costume <image 3>
    say <Ouch!> fr <1> sec
    wait <1> secs
    switch costume <image 1>
    change <score> by <25>
    hide
else
    change <score> by <-10>
    hide


The is not calculating correctly when I don't hit the target. When I miss the target the first time my score shows as -40 (it should be -10) and so on.  Has anyone run into this issue? If so do you have any recommendations on how to fix this?

Thanks!

Offline

 

#2 2012-11-12 07:05:51

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Help with Scoring System

spear8407 wrote:

I am trying to create a scoring system but can't seem to get it right. Here is how I have my score written out:

When I receive [test v]
If <touching [image 2 v]?>
    switch to costume [image 3 v]
    say [Ouch!] for (1) secs
    wait (1) secs
    switch to costume [image 1 v]
    change [score v] by (25)
    hide
else
    change [score> v]by (-10)
    hide
The is not calculating correctly when I don't hit the target. When I miss the target the first time my score shows as -40 (it should be -10) and so on.  Has anyone run into this issue? If so do you have any recommendations on how to fix this?

Thanks!

I think part of the problem might be with the other scripts you have. Could I see them?


http://i46.tinypic.com/35ismmc.png

Offline

 

#3 2012-11-12 15:49:30

Llamalover
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: Help with Scoring System

I'd suggest adding a block or code to act as an 'end' so it only goes through the script once. That way, if it is the problem, it'll deduct the 10 points, and then wait til the next try, or round, or whatever it is in your game. Otherwise there's a possibilty it'll keep checking if it's touching, or not touching the target, and will keep deduction from or adding to the score continously.


Be nice, I'm an old lady  wink

Offline

 

#4 2012-11-12 16:43:24

powerpoint56
Scratcher
Registered: 2012-04-19
Posts: 500+

Re: Help with Scoring System

Llamalover wrote:

I'd suggest adding a block or code to act as an 'end' so it only goes through the script once. That way, if it is the problem, it'll deduct the 10 points, and then wait til the next try, or round, or whatever it is in your game. Otherwise there's a possibilty it'll keep checking if it's touching, or not touching the target, and will keep deduction from or adding to the score continously.

Yes, like at the end of the "else" part,

wait until <touching [image 2 v]?>

Last edited by powerpoint56 (2012-11-12 16:43:58)


http://i48.tinypic.com/2072ctw.gif

Offline

 

#5 2012-11-12 19:51:05

spear8407
New Scratcher
Registered: 2012-11-11
Posts: 2

Re: Help with Scoring System

Thank you all for you help!

Offline

 

#6 2012-11-13 09:26:57

30-1
Scratcher
Registered: 2012-08-08
Posts: 100+

Re: Help with Scoring System

If the

broadcast [test v]
block is inside a forever or repeat block, then the broadcast could be repeated more than once.


http://i.imgur.com/ocOya7x.gif
I. Text I Based I Games I

Offline

 

#7 2012-11-13 13:54:28

Llamalover
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: Help with Scoring System

spear8407 wrote:

Thank you all for you help!

Did you get it working?


Be nice, I'm an old lady  wink

Offline

 

Board footer