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

#1 2011-10-13 12:57:17

Shrimpy247
New Scratcher
Registered: 2011-10-13
Posts: 3

Problem with targeting

I am having a problem with a Scratch project where I want a gun shot to move towards a target, which are two separate sprites. I have told this to do so when I press the space bar. But when I press this a second time it will not got to the target, but stays on the same course as the last shot. What should I do?  Sorry if this doesn't make sense.

Offline

 

#2 2011-10-13 16:33:16

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Problem with targeting

I can't answer with certainty unless you post it, but it sounds to me like the old script is still running and pressing SPACE won't reactivate the script because the old script is still running.

<when[  SPACE  ]key pressed>
<point towards(  target  )>
<repeat until> <<  <touching[  target  ]>  <or>  <touching[  edge  ]>  >>
      <move(  5  )steps>
<end>

Bear in mind, you won't be able to shoot until after the bullet hits the target or the edge of the screen.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer