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

#1 2012-11-08 01:10:18

tash_5
New Scratcher
Registered: 2012-11-05
Posts: 5

Trouble with Scores...

Hi,
The "obstacle' sprites that I have created are set to change the score when my main sprite is touching them. Although I seem to have a problem:
For example, ive got a coin that increases the score by 0.2, instead of increasing the original score of (for example) 2 to 2.2 it continues to increase until my sprite moves off it. 

Is there any way that if my main sprite touches another 'obstacle' sprite once with out moving and just remains touching it, that it only decreases/increases the score by the decided value once?

Sorry, another question. How do I make my backgrounds move when my sprite is at the end of the stage, or moving back to a previous background? Ive managed to acomplish it moving forward by doing:

if green flag clicked
forever/start
if <touching edge>/start
broadcast change background
go to x: -193 y: -50
if /end
forever /end

Although if my sprite jumps too high it still changes the background and it only goes forward, not backward.

Any help would be appreciated for these questions  smile

Offline

 

#2 2012-11-08 06:57:58

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

Re: Trouble with Scores...

1). Try using this in your code:

wait until <not <touching [obstacle v]?>>
2). If you want to know more about scrolling, try going here.

I hope that this helps!

Last edited by ErnieParke (2012-11-08 06:58:27)


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

Offline

 

#3 2012-11-09 01:19:53

tash_5
New Scratcher
Registered: 2012-11-05
Posts: 5

Re: Trouble with Scores...

Thank you so much! that helped heaps  smile

Offline

 

#4 2012-11-09 07:06:30

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

Re: Trouble with Scores...

tash_5 wrote:

Thank you so much! that helped heaps  smile

Well that's great, and good luck on your project!


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

Offline

 

Board footer