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

#1 2011-08-26 02:21:54

dk233
Scratcher
Registered: 2011-08-22
Posts: 7

Variable block need help plz

I'm making a 2player battle game (The Ep1c Battle) it will be my first proper game ive posted. my other games are trials when i need someone to help me with problems. anyway in this game your player has 35/or more lives. i want it to be so when one player gets to 0 lives it says "red losess" or something is there a varible block like that plz plz plz help me. Lives go down when 1 player uses attack. its a variable and im done eerything else so all i need is that plz plz plz help me
thanks
dk233

Offline

 

#2 2011-08-26 02:25:28

dk233
Scratcher
Registered: 2011-08-22
Posts: 7

Re: Variable block need help plz

Oh ps how long until i can become a normal scratcher???
i go on lots  smile

Offline

 

#3 2011-08-26 02:29:28

JJROCKER
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Variable block need help plz

There are many guides to becoming a new scratcher. Look in the new scratchers forums.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://img255.imageshack.us/img255/3491/signature1y.jpg&link2=http://img577.imageshack.us/img577/5272/signature1sx.jpg&link3=http://img4.imageshack.us/img4/8514/signature1et.jpg&link4=http://i.imgur.com/POEpQyZ.png&link5=http://img163.imageshack.us/img163/4640/jjrockerfinal.jpg

Offline

 

#4 2011-08-26 02:44:05

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Variable block need help plz

Well, when it gets attacked, change it's lives variable by -1. When the variable = 0, do what you want.

Offline

 

#5 2011-08-26 13:42:58

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Variable block need help plz

Use the reporter block for the if script. Use the Command "Change [-----v] by ( )" block to change the lives when hit.


I'm back.
Maybe.

Offline

 

#6 2011-08-26 18:04:38

dk233
Scratcher
Registered: 2011-08-22
Posts: 7

Re: Variable block need help plz

Guys i already got it that they got  hit it goes by one the thing i need to do was
http://scratch.mit.edu/forums/viewtopic.php?id=72889#req_message
lives =0
http://scratch.mit.edu/forums/viewtopic.php?id=72889#req_message http://scratch.mit.edu/forums/viewtopic.php?id=72889#req_message
but i got it after i posted thanks to you all i posted the game last night plz go check it out
The Ep1c Batte
http://scratch.mit.edu/projects/dk233/1997483

Offline

 

#7 2011-08-26 18:09:41

dk233
Scratcher
Registered: 2011-08-22
Posts: 7

Re: Variable block need help plz

opps all of those webadresses are wrong except the bottm one
it was meant to be

Lives=0
Show
Stop all

Offline

 

#8 2011-09-09 16:23:05

imacvilla
New Scratcher
Registered: 2010-12-19
Posts: 4

Re: Variable block need help plz

dk233 wrote:

I'm making a 2player battle game (The Ep1c Battle) it will be my first proper game ive posted. my other games are trials when i need someone to help me with problems. anyway in this game your player has 35/or more lives. i want it to be so when one player gets to 0 lives it says "red losess" or something is there a varible block like that plz plz plz help me. Lives go down when 1 player uses attack. its a variable and im done eerything else so all i need is that plz plz plz help me
thanks
dk233

You could use the following scripting in the players
[blocks]<if><( players live <=>0  )>[/blocks]
[blocks]<broadcast[ red loses [/blocks]
[blocks]<end>[/blocks]
Then to make it so 2 people can't lose you could put in this scripting
[blocks]<if><<reds live=0  <and>not dead=1  >>[/blocks]
[blocks]<broadcast[ red loses [/blocks]
[blocks]<set{ dead }to( 1 [/blocks]
[blocks]<end>[/blocks]

Hope I helped

Offline

 

Board footer