Variable helping

Your browser needs java to view projects. Click here to install Java.

user_icon pedroskivich shared it 2 years, 3 months ago
104 views, 1 tagger, 1 person loves it, 13 downloads
Add to my favorites?
Flag as inappropriate?

Comments

You need to be logged in to post comments

Add a Comment

 
Aikidoboy Aikidoboy 2 years ago

pretty cool!

pedroskivich pedroskivich 2 years, 3 months ago

The variable for ammo makes it a lot simpler because if you used a sprites costumes you would have to have color sensing to tell what it was because there is no <if costume = > Variables save a lot of time and clutter from your projects though. About the targets disappearing I don't know why I did that. I guess I'll mod it and replace this version. I couldn't quite understand what you said about the directions but the difference between the scratch direction and my variable is: The scratch one can't have to do with 2 sprites so it would only do the laser however with a variable you can have the machine set the direction and the laser use it.

Larry828 Larry828 2 years, 3 months ago

The most complicated part for me is the use of the variable "direction". I downloaded your demo and made a second copy where I added the Scratch Motion expression (direction) to the screen. (Of course, it always says the same thing as your "direction" variable on screen.) But (direction) only says which way the laser is pointed right now, but you want the laser beam to travel in the right path WHICHEVER way the laser is pointed....hence the variable? (I haven't been able to think of another way to tell the beam which way to go.) Ever since I noticed variables in peoples' projects I've been trying to think of a coding situation where I would HAVE to use a variable...and this may be one. For the "ammo" one could use a sprite with 6 costumes: 5,4,3,2,1,0.) The "will drive" fuel situation could, I think, also be represented by a sprite whose size steadily decreases until it's gone.) But the direction of the beam seems to need a variable. Is this true? [Is there a glitch in the demo? When I press "1" to enable the laser to move, all the targets disappear. In my second copy I disabled those commands for the targets and it seems to work fine.] Thanks for such a thought-provoking demo project!!

pedroskivich pedroskivich 2 years, 3 months ago

Thanks

Jens Jens* 2 years, 3 months ago

an excellent variable demo!

Please Wait...