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

#1 2007-05-29 13:18:30

2muchcute
Scratcher
Registered: 2007-05-28
Posts: 2

How do you...

...make games like you conrol a person and you bump into something and it adds points? I new to this thing. =]

Offline

 

#2 2007-05-29 14:41:39

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: How do you...

For the "bumping into", you need to use If <> blocks, with one of the <Touching> blocks depending on what you are going to be bumping into.  Touching (spritename) works, or Touching (colour).

Have a look at the code for the games that come with Scratch to see how they do it, then experiment.

For Points, a variable.  Make a new variable (called score, perhaps) and include a block at teh start of your scripts that sets it to zero.  Then when you have set up a "bumping into" script using "If Touching..." you can include a block that says "increase score by 1"


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

Board footer