Increase variable Slower

Get help using Construct 2

Post » Thu Sep 06, 2012 12:48 am

Hi i have my game setup so that when you hold theleft mouse button down it adds 1 to a variable called Power and the longer you hold the left mouse in the more power you have, which works fine, but how do i slow it down the power goes up to fast, so say it adds 1 to the power every 0.2 seconds..?
B
40
S
14
G
11
Posts: 243
Reputation: 9,432

Post » Thu Sep 06, 2012 2:44 am

add 0.1 to variable ;)
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Thu Sep 06, 2012 3:41 am

Or do a While conditions are true - Left key is down,
Every 0.2 second, add 1.
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Thu Sep 06, 2012 8:09 am

mouse button is down -> add 5*dt to power

will progresively add 5 to power per second so 1 per 0.2 seconds
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu Sep 06, 2012 9:10 am

Delta-time and framerate independence, an important tutorial to check out.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Fri Sep 07, 2012 9:26 pm

Thanks for the replies, i'll check the tutorial as well.
B
40
S
14
G
11
Posts: 243
Reputation: 9,432


Return to How do I....?

Who is online

Users browsing this forum: DemantDigitalArt and 27 guests