The short answer: the "When space key pressed" inside of the bullet launches the vitamin. The "When I receive step" makes the vitamin move when it has been launched. Launch = 0 means that it is inside of the cart...Launch = 1 means that it is outside of the cart
Inside of Scratch, click the vitamin in the Sprite list...I will talk you through the code..."when i receive Left pill" first checks to see if the vitamin has been launched (no longer attached to the cart), if it hasn't it will move left, with the rest of the cart. Right pill works the same way. The "When green flag" code basically says if the vitamin is touching a hamburger or the edge, it should go to where the cart is, and say that it is not launched any more. When the space key is pressed, if the game has not ended, then it "launches" the vitamin. For the "When I receive step",if the vitamin has been launched, the vitamin changes its y position by 20 (going farther up on the screen)...Lastly "fruittouched" sees if the vitamin is touching the fruit. If it is, the vitamin moves back to the location of the cart. (Making the fruit disappear is a more complicated process)...As you can probably tell, I'm a programmer, not a graphics person.
Maybe this is a question i should ask in the Forum, but I am a right brained animator and programming baffles me. I downloaded your great Food War game and I am trying to figure out which code applies to the shooting of the vitamin.
junk food the good guys?...while that may feel good, it doesn't encourage you to eat healthily...this is one of those "public service announcements" that ppl generally ignore :-) ...so eat fruit
Nice way to use a classic video game (space invaders) for inspiration to make a game with a message. Let's both make games with a similar message of avoiding junk food but use a different classic game for inspiration: Frogger.
Download "Food War"(22 sprites and 138 scripts) and open it in Scratch
Project Notes
Left and Right arrows: Move tank... Spacebar: Shoot vitamins... Avoid the cookies... Don't shoot the fruit, they are there to defend you from the unhealthy food
Comments
You need to be logged in to post comments
Add a Comment
tag anything u c with "waffles"
(view all replies)Comment Reply
oops, i messed up on the project notes, they are fixed now
(view all replies)Comment Reply
That is so cool! Why are the cookies there to help you, though?
(view all replies)Comment Reply
u should make a faster shot
(view all replies)Comment Reply
The short answer: the "When space key pressed" inside of the bullet launches the vitamin. The "When I receive step" makes the vitamin move when it has been launched. Launch = 0 means that it is inside of the cart...Launch = 1 means that it is outside of the cart
(view all replies)Comment Reply
Inside of Scratch, click the vitamin in the Sprite list...I will talk you through the code..."when i receive Left pill" first checks to see if the vitamin has been launched (no longer attached to the cart), if it hasn't it will move left, with the rest of the cart. Right pill works the same way. The "When green flag" code basically says if the vitamin is touching a hamburger or the edge, it should go to where the cart is, and say that it is not launched any more. When the space key is pressed, if the game has not ended, then it "launches" the vitamin. For the "When I receive step",if the vitamin has been launched, the vitamin changes its y position by 20 (going farther up on the screen)...Lastly "fruittouched" sees if the vitamin is touching the fruit. If it is, the vitamin moves back to the location of the cart. (Making the fruit disappear is a more complicated process)...As you can probably tell, I'm a programmer, not a graphics person.
(view all replies)Comment Reply
Maybe this is a question i should ask in the Forum, but I am a right brained animator and programming baffles me. I downloaded your great Food War game and I am trying to figure out which code applies to the shooting of the vitamin.
(view all replies)Comment Reply
GO FRUIT... GREAT MESSAGE PAUL!!!
(view all replies)Comment Reply
junk food the good guys?...while that may feel good, it doesn't encourage you to eat healthily...this is one of those "public service announcements" that ppl generally ignore :-) ...so eat fruit
(view all replies)Comment Reply
Hey paul its me. How about making Junk food the good guys.
(view all replies)Comment Reply
Nice way to use a classic video game (space invaders) for inspiration to make a game with a message. Let's both make games with a similar message of avoiding junk food but use a different classic game for inspiration: Frogger.
(view all replies)Comment Reply