倒计时和生命点,as3
如何准确计数?我的游戏有一个基于时间的通过或失败场景。 我需要一个可以在 ActionScript 中运行的方程式。
“在 30 秒内开始逃跑,否则会损失 600 点生命值” ...您只能看到生命点
的读数,但时间需要准确
我不喜欢这个,这只是一个例子
var CURRENTCOUNT:int = 0;
var EQUA:int;
//WHERE I WANT TO PUT LINEAR EQUATION
EQUA = 34;//<==EQUATION GOES HERE???
var SPEED:int;
SPEED = EQUA;
var COUNTDOWN:Number = 600;
var COUNTUP:Number = 0;
//TIMER
var myTimer:Timer = new Timer(SPEED,600);
myTimer.addEventListener(TimerEvent.TIMER,someFunction);
myTimer.start();
//INCREMENTING++
function someFunction(event:TimerEvent) {
//COUNTDOWN stops count going down, COUNTUP stops count going up
CURRENTCOUNT = COUNTDOWN - myTimer.currentCount + COUNTUP;
//Testing with only a text string to rule out cashing issues
tx.text = String (Math.abs (CURRENTCOUNT));
}
我已经尝试过这个
SPEED=DISTANCE/TIME
代替 currentCount
,但它不再准确。它增加了
//VoVf
V++;
COUNT = V*V/X;
30 秒加速和 600-0 生命点以及我想解释的计数,因为它不是时钟。是通过还是失败。他们看着生命渐渐远去。
生命计数的描述。死亡场景拿着蒸汽朋克风格的计时器或仪表并大笑:
- 玩家有很多秒的时间来逃脱'30秒
- 生命计数显示玩家损失的总生命'600
- 玩家可以选择更多的力量或更多的生命如果他们活着出来
How do I get accurate counting? My game has is a pass or fail scenario based on time.
I need an equation that will work in ActionScript.
'Commence escape within 30 sec or lose 600 life points'
...you see only readout of lifepoints
, but time needs to be accurate
I'm not attached to this, it's just an example
var CURRENTCOUNT:int = 0;
var EQUA:int;
//WHERE I WANT TO PUT LINEAR EQUATION
EQUA = 34;//<==EQUATION GOES HERE???
var SPEED:int;
SPEED = EQUA;
var COUNTDOWN:Number = 600;
var COUNTUP:Number = 0;
//TIMER
var myTimer:Timer = new Timer(SPEED,600);
myTimer.addEventListener(TimerEvent.TIMER,someFunction);
myTimer.start();
//INCREMENTING++
function someFunction(event:TimerEvent) {
//COUNTDOWN stops count going down, COUNTUP stops count going up
CURRENTCOUNT = COUNTDOWN - myTimer.currentCount + COUNTUP;
//Testing with only a text string to rule out cashing issues
tx.text = String (Math.abs (CURRENTCOUNT));
}
I've tried this
SPEED=DISTANCE/TIME
In place of currentCount
, but it's not any more accurate. It adds acceleration
//VoVf
V++;
COUNT = V*V/X;
30 seconds and 600-0 lifepoints and counting I wanted to explain, because it's not a clock. It's pass or fail. They look at there life drifting away.
Description of lifecount. Scene with Death holding a steampunk style timer or gauge and laughing:
- Player has so many seconds to escape '30 seconds
- Lifecount displays loss of players total life '600
- Player can choose between more power or more life if they make it out alive
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些链接可以解释。他们讨论了增量时间并解释了对于准确计数和评分有用的想法。我希望这能让您开始。
http://www.emanueleferonato.com/2007/02/19 /flash-simple-timercountdown/
http://www.allquests.com/question/2589182/如何暂停游戏.html
http://www.kongregate.com/forums/4/topics/1773
http://www.kirupa.com/forum/archive/ index.php/t-286177.html
These links can explain. They go over delta time and explain ideas useful for accurate counting and scoring. I hope this gets you started.
http://www.emanueleferonato.com/2007/02/19/flash-simple-timercountdown/
http://www.allquests.com/question/2589182/how-to-pause-game.html
http://www.kongregate.com/forums/4/topics/1773
http://www.kirupa.com/forum/archive/index.php/t-286177.html