作者abwsc01029 (翘屁)
看板Flash
标题[问题] 制作拼图游戏...期末作业
时间Fri Dec 30 00:49:12 2011
我用count做累计
可是宣告
if (count >= 5)
{
gotoAndStop(4);
只要一直用滑鼠点物件超过规定的次数就会跳出去关卡
这是我的程式↓
var xx, yy, c, id;
this.onEnterFrame = function()
{
if (c >= 0)
{
eval("s" + id)._x = eval("s" + id)._x + xx;
eval("s" + id)._y = eval("s" + id)._y + yy;
c--;
}
};
P1.onPress = function()
{
this.startDrag(true);
};
P1.onRelease = function()
{
stopDrag();
if (this.hitTest(S1))
{
count++;
this._x = S1._x;
this._y = S1._y;
}
};
P2.onPress = function()
{
this.startDrag(true);
};
P2.onRelease = function()
{
this.stopDrag();
if(this.hitTest(S2))
{
this._x=S2._x;
this._y=S2._y;
}
else
{
c=10;
xx=(xx-this._x)/10;
yy=(yy-this._y)/10;
}
};
P3.onPress = function()
{
this.startDrag(true);
};
P3.onRelease = function()
{
stopDrag();
if (this.hitTest(S3))
{
count++;
this._x = S3._x;
this._y = S3._y;
}
};
P4.onPress = function()
{
this.startDrag(true);
};
P4.onRelease = function()
{
stopDrag();
if (this.hitTest(S4))
{
count++;
this._x = S4._x;
this._y = S4._y;
}
};
P5.onPress = function()
{
this.startDrag(true);
};
P5.onRelease = function()
{
stopDrag();
if (this.hitTest(S5))
{
count++;
this._x = S5._x;
this._y = S5._y;
}
};
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 223.142.175.34