How do I - If Then Else

Get help using Construct 2

Post » Sat Feb 07, 2015 2:03 am

If you are using it to set gravity to a constant number then you don't need to set it every tick. Key is down and else will run every tick. That's why I suggested using key pressed key released. that way gravity is only set once when true. You could have gravity at 5 default to start the game that way its already 5 before your user has to press and release a key. Then on key press it will change to 0.
B
31
S
7
G
2
Posts: 100
Reputation: 2,485

Post » Sat Feb 07, 2015 7:31 am

You should do what I do now. Make a global variable for each key your game uses and when the appropriate key is down for each variable constantly add 1 to it until the button is released then put the variable back to 0. Then all you do is if you want to test if a key was only pressed and not held down, you check if the variable = 1. Anything greater than 0 and 1 is holding down the button.
B
36
S
9
G
1
Posts: 208
Reputation: 3,319

Post » Sat Feb 07, 2015 9:45 am

blackcrypt try this demo
You do not have the required permissions to view the files attached to this post.
B
226
S
31
G
14
Posts: 1,899
Reputation: 38,302

Post » Sat Feb 07, 2015 11:04 pm

Thanks guys, but this already got fixed - see last entry on page one!

Image

But if you are in a helping frame of mind I have another topic that seems to be invisible to most forumgoers...

viewtopic.php?f=147&t=123925
Image
B
14
S
3
G
1
Posts: 61
Reputation: 993

Previous

Return to How do I....?

Who is online

Users browsing this forum: fierce25 and 8 guests