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

#1 2011-03-10 08:57:31

14makjg1mak
New Scratcher
Registered: 2011-03-10
Posts: 1

how to make a game alway start with 10 points?

how to make a game alway start with 10 points? it's very important i need to know because it's my school project.

Offline

 

#2 2011-03-10 10:26:05

puppetadventurer
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: how to make a game alway start with 10 points?

<when green flag clicked>
<set{ score }to( 10 )


3

Offline

 

#3 2011-03-10 11:14:53

3DBlenderRender
Scratcher
Registered: 2011-03-10
Posts: 44

Re: how to make a game alway start with 10 points?

Just like Puppet Adventurer said. There are several different methods, however, using the red variables is the easiest way. Remember that operators (Green Blocks) can be used to create comparisons. For example,

When Flag Clicked,
Set Score to 10,
If: (Score > 1),
Then: If: Up Arrow Pressed
Then: Move 2 Steps,

This code allows a character to move until the Score hits 0. This is commonly used for creating RPGs, Fighting Games with HP, or timed Games. If this isn't clear enough, that's OK, I'll go more into depth. If I were to write the code out in a sentence, I would say:

"After the flag has been clicked, if the score is above 1, (I.E. not 0), then allow the character to move forwards 2 steps at a time when the up arrow is pressed." Or "The character can only move forwards by way of the up arrow when the score is above 1."

Hope that helped, and good luck with your school project.
- 3DBlenderRender

Offline

 

Board footer