In my game I'm designing, I have four things to choose to do, and I have things repeating until you choose. I want it to stop those things when right, left, up, or down is pressed. However, the "or" boolean operator allows for two exceptions to end repeat until, and I want everything to stop and hide if one of those four is pressed. Is there away to allow four or more exceptions?
Offline
I tried that for every possibility, but you have to press the button multiple times for them all to respond. Any idea on how to fix this?
Offline
If nesting the or blocks like above does not work, upload your project to the scratch website so people can find out what is going wrong.
Paulmedwal
Offline
I'm trying to upload, but it keeps timing out.
Offline
O.K it works now. Search for 3D Adventure in projects.
Offline
The problem is that four different scripts are waiting for the same keyboard input. The easiest way to fix this is to only have one script waiting on the keyboard input and have the other scripts change because of a variable. Check out http://scratch.mit.edu/projects/paulmedwalhelp/9654
After you download it, leave a message so that I can delete the project from the Scratch website.
Paulmedwal
Last edited by paulmedwal (2007-06-02 20:33:36)
Offline
I like your solution, but why don't they all go away at the same time?
I'll probably stick with this, but optimization is nice.
P.S. Why did you make a sprite blue?
Last edited by keviniskool (2007-06-02 20:38:11)
Offline
They don't go away at the same time because of the "glide" block. Repeat until does what is inside of it, and then checks to see whether "press arrow key" = 1. The "press arrow key" variable changes to 1 in the middle of the glide. With my old code, whenever the sprites finish their glide, they disappear.
You can use broadcast blocks and forever loops to make them disappear while gliding. See http://scratch.mit.edu/projects/paulmedwalhelp/9657
Paulmedwal
Last edited by paulmedwal (2007-06-02 20:49:28)
Offline