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

#1 2011-02-23 21:03:47

WingsGames
Scratcher
Registered: 2011-02-21
Posts: 500+

Help me with variables, please

I'm working on my first game, and I have everything but the variables down. When an enemy hits your base, the health won't go down! I said "When I receive "Battlefield" (the start of the game), Wait until touching "Friendly Base", Broadcast "Pongstan On Base"." At the base, it says "When I receive "Pongstan On Base," Change "Health" by -8." Any suggestions to make it work?


Are you an aspiring home decorator? If so, please answer my question!

Offline

 

#2 2011-02-23 23:08:36

kingofdallamas
Scratcher
Registered: 2010-03-07
Posts: 500+

Re: Help me with variables, please

Ahh, you forgot to put the health variable at the total number, like <100> at the spite that receives the command. In other words, when green flag clicked, set health to the number, when receive Pongstan On base, change health by -8. There you go. Hope this helps, and good luck! Also, try uploading what you have right now, so others could look at the scripts more easier to see what's going wrong.  smile


http://i853.photobucket.com/albums/ab99/Gilgamesh1192/Ninja%20Saga/ElementalJutsus2.gifhttp://i27.photobucket.com/albums/c192/BoomKaTish/GIF/thgfhgfhfhgf.gif
ハロー友だち!

Offline

 

#3 2011-02-24 00:29:12

MisterScratch
Scratcher
Registered: 2011-02-17
Posts: 51

Re: Help me with variables, please

What I do is like When Flag Clicked Forever If Touching Enemy Broadcast I'm Hit Wait Until Not Touching Enemy (That way it doesn't keep broadcasting and I won't lose too much health) When I recieve I'm Hit Change Health by ______ Stop Script

Offline

 

#4 2011-02-24 00:33:07

kingofdallamas
Scratcher
Registered: 2010-03-07
Posts: 500+

Re: Help me with variables, please

MisterScratch wrote:

What I do is like When Flag Clicked Forever If Touching Enemy Broadcast I'm Hit Wait Until Not Touching Enemy (That way it doesn't keep broadcasting and I won't lose too much health) When I recieve I'm Hit Change Health by ______ Stop Script

That could work, too, but sometimes when i use it, the script glitches.  smile  So, I don't utilize the <forever> part in the script. Well, that's how I program.


http://i853.photobucket.com/albums/ab99/Gilgamesh1192/Ninja%20Saga/ElementalJutsus2.gifhttp://i27.photobucket.com/albums/c192/BoomKaTish/GIF/thgfhgfhfhgf.gif
ハロー友だち!

Offline

 

#5 2011-02-24 07:22:55

WingsGames
Scratcher
Registered: 2011-02-21
Posts: 500+

Re: Help me with variables, please

Thank you so much! I got it to work! Now I'm just working on the gameplay component of the game. This will be my first game, so keep an eye out for it.


Are you an aspiring home decorator? If so, please answer my question!

Offline

 

#6 2011-02-24 08:15:06

WingsGames
Scratcher
Registered: 2011-02-21
Posts: 500+

Re: Help me with variables, please

The game is now online!


Are you an aspiring home decorator? If so, please answer my question!

Offline

 

#7 2011-02-24 21:08:22

WingsGames
Scratcher
Registered: 2011-02-21
Posts: 500+

Re: Help me with variables, please

WingsGames wrote:

The game is now online!

Not anymore, unfortuneatley. The game is totally messed up online. Does anyone know how to fix this?


Are you an aspiring home decorator? If so, please answer my question!

Offline

 

#8 2011-02-24 23:02:53

kingofdallamas
Scratcher
Registered: 2010-03-07
Posts: 500+

Re: Help me with variables, please

WingsGames wrote:

Thank you so much! I got it to work! Now I'm just working on the gameplay component of the game. This will be my first game, so keep an eye out for it.

You're welcome!  smile


http://i853.photobucket.com/albums/ab99/Gilgamesh1192/Ninja%20Saga/ElementalJutsus2.gifhttp://i27.photobucket.com/albums/c192/BoomKaTish/GIF/thgfhgfhfhgf.gif
ハロー友だち!

Offline

 

#9 2011-02-24 23:03:57

kingofdallamas
Scratcher
Registered: 2010-03-07
Posts: 500+

Re: Help me with variables, please

WingsGames wrote:

WingsGames wrote:

The game is now online!

Not anymore, unfortuneatley. The game is totally messed up online. Does anyone know how to fix this?

Hmmm, post it up the game online, so I can check out what's wrong.  smile  And, try uploading the project when you stopped the project at the screen of the variables in it.  big_smile


http://i853.photobucket.com/albums/ab99/Gilgamesh1192/Ninja%20Saga/ElementalJutsus2.gifhttp://i27.photobucket.com/albums/c192/BoomKaTish/GIF/thgfhgfhfhgf.gif
ハロー友だち!

Offline

 

#10 2011-02-25 02:09:27

MisterScratch
Scratcher
Registered: 2011-02-17
Posts: 51

Re: Help me with variables, please

WingsGames wrote:

WingsGames wrote:

The game is now online!

Not anymore, unfortuneatley. The game is totally messed up online. Does anyone know how to fix this?

Some of my games have little quirks wrong with them too. Like in Shoot 'Em Up the first target gives you 2 points instead of one. Also in Moon Defense some of the bullets don't stop when they hit Aliens. Another is in Snake - Super Mario Bros. Style if you play it in flash the pen is too thin and you'll go through it. Generally what I do is I put in the description a part telling people to download the game for it work best. Hope this helps.

Offline

 

#11 2011-02-25 07:12:18

WingsGames
Scratcher
Registered: 2011-02-21
Posts: 500+

Re: Help me with variables, please

Here's the link so you can check the game out: http://scratch.mit.edu/projects/WingsGames/1617433


Are you an aspiring home decorator? If so, please answer my question!

Offline

 

Board footer