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
15
G
11
Posts: 243
Reputation: 9,492

Post » Thu Sep 06, 2012 2:44 am

add 0.1 to variable ;)
ImageImageImageImage
B
156
S
64
G
41
Posts: 2,589
Reputation: 34,603

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
37
S
11
G
6
Posts: 962
Reputation: 11,254

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
64
S
22
G
14
Posts: 1,482
Reputation: 16,457

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
276
S
103
G
84
Posts: 7,289
Reputation: 83,098

Post » Fri Sep 07, 2012 9:26 pm

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


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest