0

My code was working fine with the first two sprites introduced and then it stopped working after I made it more complicated.

The goal of the game is shoot 100 balloons with the arrow by clicking on it for it to glide straight across. When the arrow touches any balloon, the balloon(s) is/are supposed to pop and disappear.

This was working fine for the first balloon, but when I added two more balloons, it no longer worked. Help, please?

Here's the link: http://scratch.mit.edu/projects/24305501/

2 Answers 2

0

I believe that your problem stems from how you are moving the arrow. When the mouse is clicked, the arrow moves to the edge of the screen, goes back to the starting point and then checks to see if it is touching anything. Of course, because it is already at the starting point, it will not be touching any balloons and won't broadcast the "arrow" message.

To solve this, I would make the arrow movement a loop, where in each iteration the arrow moves a little bit, checks to see if it hit the balloons, and then repeats. If it all happened fast enough, it would look smooth. To bring the arrow back to the starting point, just put in an if clause checking to see if the arrow has hit the edge of the screen.

Hope this helps.

0

Before things go complicated just wanted to point out something you missed.

You have a variable Score. But its value is constant at 6; even after the game starts. So do When green flag clicked, set Score to 0. This will help you to check for the result in a forever loop.

Other thing is, Touching the sprite condition should be checked in a forever loop or something, since a piece of code runs just ones to check if touches the sprite or not.

So work on that and wish you all the best.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .