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

#1 2011-12-07 04:02:12

alisonwong7
New Scratcher
Registered: 2011-12-07
Posts: 2

Urgent School Project Due Soon!

I need some help figuring out how to get the point and live variables to change. My game is a memory game, where the player has to remember the food items on the shopping list and then catch the right food in the cart. If they catch the right food, I want a point to be added, but if they catch the wrong food I want a live to be lost. I am wondering how this coding is possible. I have attached the link below and if you could take a look and help me out this would be greatly appreciated. Please comment with any suggestions. Thank you!

http://scratch.mit.edu/projects/alisonwong7/2200334

Offline

 

#2 2011-12-07 05:19:51

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Urgent School Project Due Soon!

Here's a clickable link to make it easier for people to check out your project:

http://scratch.mit.edu/projects/alisonwong7/2200334

This would be a good application to use a List.  Under the Variables tab, you have the option "Make a list".  I'd make it for All Sprites and call it something like Shopping List.  Delete all items from it at the start of the project and add the three things you are looking for when they are randomly picked, such as "Bread", "Cheese", "Cherries" or whatever. 

Each item that is to be dropped picks a costume and assigns a local variable (this sprite only) called maybe "Me" with the name of the food that it is going to be.  Then, have the dropped objects that hit the cart check to see if they are on the list with the

<Shopping List contains "Me">

block and assign points or lives lost accordingly.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2011-12-08 22:42:00

alisonwong7
New Scratcher
Registered: 2011-12-07
Posts: 2

Re: Urgent School Project Due Soon!

This is a good idea and it would probably work well for my game, but now I don't think that this is the main thing I am doing wrong. I have posted a more updated version "Cart Catcher updated". The point variable is now working, however, the live variable is not. Every time I get the right food a point will be added however, lives are still being lost. As well as this, every time a food is caught a different amount of lives are lost, usually 5,4 or 3. I would like only one life to be lost.

Please download my game and help me find the error in my coding! This would be much appreciated!!

link: http://scratch.mit.edu/projects/alisonwong7/2204500

Sorry if this link is not the right one.

Offline

 

#4 2011-12-08 23:11:24

Venazard
Scratcher
Registered: 2009-12-15
Posts: 100+

Re: Urgent School Project Due Soon!

Well, for one, the food that comes down are too close together and come down at the same time. You might want to time them differently to make it easier to catch the correct food. That is probably why it is losing 5 lives at a time. Try spreading them out more and see if that helps.


http://nitrostudios.weebly.com/uploads/6/8/1/2/6812574/1323469851.png

Offline

 

#5 2011-12-09 10:54:59

rabbit1131
Scratcher
Registered: 2009-10-16
Posts: 1000+

Re: Urgent School Project Due Soon!

That took me forever... TONES of scripts you have there! But I managed to fix some of it.
Here is the revised project


The Intergalactic Adventures of Revesilia! I hope you will partake in this gigantic undertaking, to build the sequel to the hit map The Adventures of Revesilia! The Intergalactic Adventures of Revesilia Map Builders Application thread! http://internetometer.com/image/35004.png

Offline

 

#6 2011-12-09 18:50:19

fuz50
Scratcher
Registered: 2008-09-19
Posts: 100+

Re: Urgent School Project Due Soon!

I tried your game, and it was very fun! In your project notes, you added that your live variables are still not working, and I definitely see that. I think you might have a script that goes similarly to...

[blocks]<when green flag clicked>
<forever>
<if><touching[ your sprite]>
<change{ lives }by( -1)>
<end>
<end>[/blocks]

This is a common error with variables that I often have a lot. This script repeatedly changes your lives -1 because it's still touching that sprite, even if it looks like a short amount of time.

Try adding a block like [blocks]<wait until<<  <not> <touching[  >>>[/blocks] so that this won't happen. (after the change lives block)

Last edited by fuz50 (2011-12-09 18:51:18)


http://img10.imageshack.us/img10/7404/cooltext529102298.jpg
http://siggen.toontown-click.de/sig1.pnghttp://siggen.toontown-click.de/sig2.png

Offline

 

Board footer