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

#1 2007-06-26 09:46:14

lilmonkichi
Scratcher
Registered: 2007-06-26
Posts: 4

Scoring problems (touching a sprite to increase score)

ive made a game but im having trouble with the score, if (sprite1) touches (sprite2) then the score goes up by one, but the score only increases if i touch the sprite from the side, but not from above or below (e.g. if i had a dog as my character and it touched [cat2] to get one point, it would only work if it touched the tail or the head, but not the body),  can anyone help?  smile

Offline

 

#2 2007-06-26 11:05:57

Duncan
Scratcher
Registered: 2007-05-15
Posts: 47

Re: Scoring problems (touching a sprite to increase score)

Are you doing any other checks when touching from the top or bottom that makes it miss the score increment?

A simple test:

Forever
    go to mouse pointer
    if touching sprite 2
       change score by 1

shows that the score will increase wherever sprite2 is touched.

Offline

 

#3 2007-06-26 21:19:58

lilmonkichi
Scratcher
Registered: 2007-06-26
Posts: 4

Re: Scoring problems (touching a sprite to increase score)

i tried that and it worked with the mouse but my game uses the direction keys instead of the mouse, i tried re-opening it and it changed again so that the score only increases when touching from the top or bottom and not from the sides, it changes back and forth sometimes if i re-open it.

Last edited by lilmonkichi (2007-06-27 04:00:30)

Offline

 

#4 2007-06-27 05:34:01

lilmonkichi
Scratcher
Registered: 2007-06-26
Posts: 4

Re: Scoring problems (touching a sprite to increase score)

i figured out how to solve it, instead of putting [when sprite1 touched sprite 2, increases point by 1] you put it on sprite two as [if sprite 2 touches sprite1 increase point by one]  smile

Offline

 

Board footer