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

#1 2007-06-12 13:11:22

JonnyX
Scratcher
Registered: 2007-06-11
Posts: 2

Help with game

I can't figure out how to tell if the space bar is pressed while the sprite is over another sprite. If it isn't I need to add to a variable, if it is I need to add to another variable, and for all presses it needs to be added to yet another variable. So two variables are raised per space bar. Either General & Hit or General & Miss.

Any methods on how to do this would be appreciated.
Thanks!
JonnyX

Offline

 

#2 2007-06-12 13:45:23

weissjd
Scratcher
Registered: 2007-05-16
Posts: 64

Re: Help with game

Put something like this in one of the sprites:

When space key pressed
  change general by 1
  if touching othersprite
    change hit by 1
  else
    change miss by 1

Offline

 

#3 2007-06-12 13:49:09

JonnyX
Scratcher
Registered: 2007-06-11
Posts: 2

Re: Help with game

Ahhh, thanks. I forgot about the "touching ___?" button.  tongue

Offline

 

Board footer