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: 13
Reputation: 226

Post » Wed Dec 13, 2017 11:46 am

Keyboard "Space" key is down, is probably what you're looking for.
B
52
S
21
G
93
Posts: 2,410
Reputation: 55,008

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: 13
Reputation: 226

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
52
S
21
G
93
Posts: 2,410
Reputation: 55,008

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: 13
Reputation: 226

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: 13
Reputation: 226

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
52
S
21
G
93
Posts: 2,410
Reputation: 55,008

Post » Wed Dec 13, 2017 12:41 pm

it work, ty ^^
B
4
Posts: 13
Reputation: 226


Return to How do I....?

Who is online

Users browsing this forum: Cassianno and 3 guests