0 Favourites

# Autorunner - Gradually reduce number/speed.

• 4 posts
• Hi all,

I'm making an Auto runner, the way it works at the moment is, the bullet speed of all the platforms etc are set to a global variable called "Speed". this starts at 300 and is set to increase by X every X seconds, so say you've been playing for a while and your speed is up to 400 then you end up bumping into an enemy I want it to slow down back to 300 but not instantly, I want it to slow down gradually.

The only way I can think of doing this is using System > Wait .2 secondsish > Set "speed". About 15 times or so to simulate the gradual reduction but this seems a bit stupid and I'm wondering if anyone knows of another way to do it?

Thanks,

• You need a flag variable for when you want the speed to be increased or decreased. So for example:

Every X seconds

---->Slow = 0

--------->Set Bullet.Speed to Bullet.Speed + X

---->Slow =1

--------->Set Bullet.Speed to Bullet.Speed - X

Bullet.Speed = 300 (You might want to make it <= because its not guaranteed you'll land on 300 exactly depending how much you are adding)

---->Set Slow = 0

Then just set Slow to 1 when you want time to slow down.

• ## Buy Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• You need a flag variable for when you want the speed to be increased or decreased. So for example:

Every X seconds

---->Slow = 0

--------->Set Bullet.Speed to Bullet.Speed + X

---->Slow =1

--------->Set Bullet.Speed to Bullet.Speed - X

Bullet.Speed = 300 (You might want to make it <= because its not guaranteed you'll land on 300 exactly depending how much you are adding)

---->Set Slow = 0

Then just set Slow to 1 when you want time to slow down.

Is there a way you can create a screencap of what this is supposed to look like in the events list? That would be the easiest way to understand this, for I also want to know how this works.

• 4 posts