我的计数器以恒定速度达到 100。有没有办法提高计数器的速度?
Flash 可以使用三角函数值来影响速度,但我不知道这是否可以即时更改计时器类。
它有几个部分。
(a.) 提高计数器的速度?
(b.) 某些部分的斜坡?
- 有一个范围
- 90-100 开始斜坡
增量三角的任何一个例子都会有帮助
替代文字 http://www.ashcraftband.com/myspace/videodnd/icon10.jpg
我要申请的 TRIG 示例
var xVel:Number = Math.cos(radians) * speed;
var yVel:Number = Math.sin(radians) * speed;
//-------------------------------------------//
return deg * (Math.PI/180);
加速计数器“所有的好例子”
//EVERYONE HELPED "decimals corrected"
var timer:Timer = new Timer(10);
var count:int = 0; //start at -1 if you want the first decimal to be 0
var fcount:int = 0;
timer.addEventListener(TimerEvent.TIMER, incrementCounter);
timer.start();
function incrementCounter(event:TimerEvent) {
count++;
//
fcount=int(count*count/10000);//starts out slow... then speeds up
//
var whole_value:int = int(fcount / 100); //change value
var tenths:int = int(fcount / 10) % 10;
var hundredths:int = int(fcount) % 10;
“感谢您花时间提供帮助”