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

#1 2012-07-03 19:08:50

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Help with Variables

The Problem
Well, anyway, I have a project, here.  As you can see, if you try to fire anything other than the small shell, it automaticly changes the shell type to the Small Shell.  I have tried to debug it, but I can't find the source of this problem.  Could anybody help me with this? 


How to run the project:
As it's not finished, i haven't included instuctions.  The button currently outlined in yellow is the artillery shell you are going to fire.  Click on a shell button to buy one of them. 

If anybody could do this, I will be very grateful and give them credit.


http://i47.tinypic.com/2iaa73k.png

Offline

 

#2 2012-07-03 19:17:52

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Help with Variables

Ok, I found it. Its the bullet sprite's script. You have

if <<(shell) = (2)> and <(shells) > (0)>>
do stuff
else
set [shell v] to (1)
end
Imagine the shell variable is 3. The above boolean is false, right? So the "else" portion of the script is activated, setting the shell back to 1.

Do this
if <(shell) = (2)>
if <(shells) > (0)>
do stuff
else
set [shell v] to (1)
end
end
Hope this helps.

Last edited by Wes64 (2012-07-03 19:18:38)


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#3 2012-07-03 19:20:34

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: Help with Variables

Okay! Thanks so much!


http://i47.tinypic.com/2iaa73k.png

Offline

 

Board footer