How do I Increase Speed of an Object Every.X secs

Get help using Construct 2

Post » Wed Sep 03, 2014 2:05 pm

I have a wall in my game that moves along the screen, right now i'm using 6 events system-wait X secs - object - increase speed to get the wall up to speed.

Is there a way i can get the same affect with a single event?

If someone could point me to a tutorial or explain it, i'd be greatly appreciative.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Wed Sep 03, 2014 3:16 pm

Make a variable called something like wallspeed and make the event. So instead of setting up something like every tick set wall.x-60*dt you can change the "60" and put your variable there. So you'll get every tick set wall.x-wallspeed*dt.

Then you can make something like every x seconds add 10 to the wallspeed variable and the speed will then increase on the wall.

Hope you understand :P
B
55
S
24
G
13
Posts: 767
Reputation: 12,575

Post » Wed Sep 03, 2014 4:28 pm

system every x seconds - wall set speed to wall.speed+10

you could ofcourse clamp this to have a maximum speed
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Sep 03, 2014 5:07 pm

Hey thanks for the replies. I'll try to wrap my head around *dt. May come in handy later.

How would i increase the speed over a distance of pixels instead of time? As in every 500 pixels increase speed by 20?

Again, thanks for the replies.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 52 guests