How do I do a while correctly

Get help using Construct 2

Post » Wed Dec 13, 2017 11:40 am

sorry, this was already say but im stuck ^^"
I just want to shoot in continu when I press "space" but I do a infinty while, can anyone help me?
Image
B
4
Posts: 10
Reputation: 220

Post » Wed Dec 13, 2017 11:46 am

Keyboard "Space" key is down, is probably what you're looking for.
B
48
S
19
G
86
Posts: 2,293
Reputation: 50,965

Post » Wed Dec 13, 2017 11:54 am

whell, I don't really get how while work, I first think to add a action in while whith keyboard but keyboard doesn't exist in "action".. so I don't get it ^^"
how do whe do a while exactly? can you send me an exemple ?
B
4
Posts: 10
Reputation: 220

Post » Wed Dec 13, 2017 12:01 pm

Cannot send an example for several hours as in work but what I am saying is you don't need to use while here, the keyboard action 'key is down' basically means 'while the key is pressed down then do this'. That's what you want to happen, shoot while the key is pressed down? 'On key pressed' is just a one time trigger on initial key press.
B
48
S
19
G
86
Posts: 2,293
Reputation: 50,965

Post » Wed Dec 13, 2017 12:04 pm

oh ! thanks a lot ^^
just a last thing, did you know how to do a cooldown with this XD
B
4
Posts: 10
Reputation: 220

Post » Wed Dec 13, 2017 12:05 pm

oh ! thanks a lot ^^
just a last thing, did you know how to do a cooldown because I have a big ray of bullets XD
B
4
Posts: 10
Reputation: 220

Post » Wed Dec 13, 2017 12:28 pm

Yeah I can't see C2 right now to test it but it'll be combining 'key is down' with the system action every X seconds. So while space is down > add condition every 0.5 seconds spawn the bullet. Whatever time interval you need for the game.
B
48
S
19
G
86
Posts: 2,293
Reputation: 50,965

Post » Wed Dec 13, 2017 12:41 pm

it work, ty ^^
B
4
Posts: 10
Reputation: 220


Return to How do I....?

Who is online

Users browsing this forum: 1ByteUniverse and 13 guests