I'm making a project right now and I need some help.
I've set it so that when space is pressed, the power (variable) will increase.
But I need to know how to stop the script when I let go of space, so the variable won't change.
Offline
[blocks]<repeat until><not><key[ space ]pressed?>>>
<change{ power }by( 1[/blocks]
~~Scimonster
Offline
Or, better yet,
Forever:
If: Key Space Pressed,
Then: Change Variable X by +1
Else: Stop Script
(Stop script can be found under "Control", near the bottom, and is not "Stop All", just "Stop Script". It's a really useful little block for multi-stage games.)
There. That should do the trick. What are you working on? A car simulation? I've done a ton of those on my computer, if you ever need help on those. I love working with Car Physics.
- 3DBlenderRender
Offline
3DBlenderRender wrote:
Or, better yet,
Forever:
If: Key Space Pressed,
Then: Change Variable X by +1
Else: Stop Script
(Stop script can be found under "Control", near the bottom, and is not "Stop All", just "Stop Script". It's a really useful little block for multi-stage games.)
There. That should do the trick. What are you working on? A car simulation? I've done a ton of those on my computer, if you ever need help on those. I love working with Car Physics.
- 3DBlenderRender
Except that will, as it sounds, stop the script, which we don't want.
Offline
Sorry if I didn't make it very clear, what I really wanted was to make the script so that
when i press SPACE the power will increase by 1
then, once i let go of space, i broadcast something, and stop the script that increases the power
Hope this makes things clearer
Offline
[blocks]
<when[ space ]key pressed>
<repeat until><< <not><key[ space ]pressed?> >>
<change{ power }by( 1
<end>
<broadcast[ something
[/blocks]
Last edited by floppy_gunk (2011-03-18 00:18:53)
Offline