Well, what 'kind' of game? I can help you with lives and scores.
So, make 2 variables - lives and score. Then, do this script (I'm rubbish at explaining but here goes)
<when I receive[ died
<change{ lives }by( -1
Then, for score...
<when I receive[ enemy died
<change{ score }by( 1
Hope that helps
Offline
Here is a simple game with lives. http://scratch.mit.edu/projects/T_E_P/145727
Offline
And here is a project with health and a score. http://scratch.mit.edu/projects/Lanie/212104 Looking a the script for these projects could help you.
Offline
also if you want moving put this in yur sprite:
[blocks]
<when green flag clicked>
<forever>
<if><key[ right ]pressed?>
<change x by( 5 )>
<end>
<if><key[ left ]pressed?>
<change x by( -5 )>
<end>
<if><key[ up ]pressed?>
<change y by( 5 )>
<end>
<if><key[ down ]pressed?>
<change y by( -5 )>
<end>
<end>
Offline
and in your enemy put this also to make the lives work:
[blocks]
<when green flag clicked>
<forever>
<if><touching[ (players sprite) ]>
<broadcast[ died ]
<end>
<end>
[/blocks]
and put this in your enemy sprite, asuming you are using a red object/weapon or if you have a whole sprite for a weapon change [blocks]<touching color [ red ] ?> to <touching [ (weapon sprite) ] ?>[/blocks] anyway:
[blocks]
<when green flag clicked>
<forever>
<if><touching color[ red ] ?>
<broadcast[ enemy died ]
<end>
<end>
Offline
You can use variables. Here's the script for the man/thing that loses a life:
[blocks]<when green flag clicked>
<forever if> <touching[ enemy
<change{ lives }by( -1
<end>
[/blocks]
Then you can get a little more complicated...
Here's the script for ending the game:
[blocks]<when green flag clicked>
<forever if> <( <{ lives }> <=> 0 )>
<say[ You lose ]for( 2 )secs>
<stop all>
<end>
[/blocks]
Ask me if it's too complicated for you.
Last edited by joeyman (2008-08-08 22:58:14)
Offline