Effecting Timescale / Slow motion with Axel

Discuss suggestions to improve the Axel library.

Effecting Timescale / Slow motion with Axel

Postby benje » Tue Jan 29, 2013 5:20 am

Hi there,
Does Axel have any built-in methods for creating slow-motion during a game ?

I've been going through the source and can't find any reference to a timescale variable or anything like that. Flixel has the FlxG.timeScale value that achieves this functionality, and I think it would be really cool if Axel did also! See flixel reference > http://flixel.org/docs/org/flixel/FlxG.html#timeScale

If this isn't currently possible, would you please mind pointing me in the right direction so I can implement my own ?

Many thanks
benje
Private
 
Posts: 2
Joined: Tue Jan 29, 2013 5:14 am

Re: Effecting Timescale / Slow motion with Axel

Postby Arkeus » Tue Jan 29, 2013 10:31 am

Currently not supported, but quick and easy to add in.

If you open up Ax.as in the latest version, you can change line 559 from:

dt = then == 0 ? 0 : (now - then) / 1000;

To:

dt = then == 0 ? 0 : (now - then) / 1000 * timescale;

And then just add

public static var timescale:Number = 1;

To the top of the same file.
Image
User avatar
Arkeus
Site Admin
 
Posts: 363
Joined: Mon Mar 26, 2012 12:43 am

Re: Effecting Timescale / Slow motion with Axel

Postby benje » Fri Feb 01, 2013 5:21 am

Thank you Arkeus, this did the job perfectly. :D
benje
Private
 
Posts: 2
Joined: Tue Jan 29, 2013 5:14 am


Return to Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest

cron