I'm making a project & I can't figure something out. When the sprite touches a red square, the score gets increased by its fuel (it can be from 1-5) and it goes to the next background. But when it touches the red square, it jumps forward several backgrounds & I once got 180 points for one level when my remaining fuel was 4 secs. I have the fuel all figured out, it's just the levels and scoring. Could someone help me out?
Offline
It is probably staying on the red square for long enough for the red square's script to activate multiple times.
Offline
Thought so. But how do I solve the problem? I'm sending a prototype to the Prototypes0 gallery. I have galleries for everything. By the way the red square is part of the stage. I used the touching color block.
Offline
<when green flag clicked>
<forever>
<if> <touching color[ Red]
<broadcast[ Score ]
<when I receive[ Score ]
<change{ Score }by( fuel)
<stop script>
Try this.
Offline
I have it also programmed on the same script to switch the background, so it won't work. Then I changed it so it was 2 messages being sent, but it still wouldn't work.
Offline
I'm not new so I'm here to tell y'all that it's very fun
Offline
Use the <wait until>[/blocks] block.
Offline
I do the same thing as Cough for this issue, as I have it as well. Usually spmething like wait 0.1 seconds is enough, and it isn't noticeable during the game. You may want to move the blacks onto their own script though so that the wait block does not interfere with the rest of the script. On a different note, should this be in All About Scratch or is it ok here?
Offline
Newer guys asking for programming help is usually tolerated here, but yeah in the future you might want to bring your programming issues to the All About Scratch forum. New Scratch Members is mostly filled with people who are just posting "Hello" on every thread in here to raise their post count.
Offline
Cough wrote:
Newer guys asking for programming help is usually tolerated here, but yeah in the future you might want to bring your programming issues to the All About Scratch forum. New Scratch Members is mostly filled with people who are just posting "Hello" on every thread in here to raise their post count.
Yes, that's why I didn't point it out or report it.
Offline
I would just put the "if touching red" in the same script and put "go to x:() y:()" in the if statement, so it has to go to the beginning of the next level before it checks if you are touching again.
Last edited by MoreGamesNow (2011-04-24 20:21:28)
Offline
make the square change position IMMEDIATLY after it changes fuel in the same script
Offline