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,442

Post » Thu Sep 06, 2012 2:44 am

add 0.1 to variable ;)
ImageImageImageImage
B
147
S
58
G
38
Posts: 2,557
Reputation: 32,526

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: 960
Reputation: 11,125

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
62
S
22
G
14
Posts: 1,481
Reputation: 16,400

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
258
S
90
G
48
Posts: 7,084
Reputation: 62,904

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,442


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Baidu [Spider], OddConfection, SpyDaniel and 1 guest