【发布时间】:2015-10-31 12:42:03
【问题描述】:
我在网上找到了这段代码。但我不完全确定这意味着什么。这是为了创造一个弹跳球。我只是不确定在这种情况下会说什么。
是关于物体的速度还是它会在舞台上出现的位置?您能否添加一个//评论以获得简要说明。提前谢谢!
if ( this.x >= nStageWidth - 10 )
{
this.x = nStageWidth - 10;
nSpeedX *= -1;
}
else if ( this.x <= 10 )
{
this.x = 10;
nSpeedX *= -1;
}
if ( this.y >= nStageHeight - 10 )
{
this.y = nStageHeight - 10;
nSpeedY *= -1;
}
else if ( this.y <= 10 )
{
this.y = 10;
nSpeedY *= -1;
}
【问题讨论】:
标签: actionscript-3 flash