俄罗斯方块是一款经典的小游戏,本例利用ActionScript将其在Flash中实现出来。游戏中共有7种形状的方块,它们出现并下落的顺序是随机的,与传统的俄罗斯方块一样,这里也有下一个要下落的方块的提示。当前方块停止下落时,判断得分,继续出现下一个方块。此外,还可以通过单击按钮调节方块下落速度。
制作方法分析
制作方块游戏要求的方面比较多,下面对重要的部分予以介绍。
1. 随机产生方块
要随机产生方块自然要用到随机数,这里在每种形状方块的影片剪辑的链接标识符中加入代表方块形状的序号,根据产生的随机数决定产生哪种形状的方块。由于既要产生当前方块,又要产生下一个要下落的方块,因此需要使用两个变量来存放随机数。
2. 对方块进行控制
方块在下落过程中可以进行左移、右移、加速下落和旋转,这些都可以通过键盘进行控制。由于方块在EnterFrame事件中下落,会造成速度快得无法接受的结果,因此在EnterFrame事件中使用一个变量进行计数,当计数变量达到某一值时才令方块下落。这样出使得可以通过调整计数变量的最大值来控制方块的下落速度。
3. 方块停止检测
当方块下落(或左移、右移)到边界或其他方块位置,不能再移动时,方块停止运动。这就需要对方块应该在何处停止进行判断。由于在一行填满时需要清除该行方块,因此在方块停止下落时应该使用独立的方块单元代替当前方块。为了更便于对一行是否填满进行检测,定义了一个二维数组,数组的每个元素代表游戏界面中一个特定的位置,因此只需要判断对应于某位置的数组元素的值就可以知道该位置是否有方块存在。无论是在方块停止检测还是在是否得分的计算上,这个数组都发挥了巨大的作用。
4. 得分计算
和传统的俄罗斯方块一样,如果一次清除的行数越多,得分就应该越高。这个比较容易,只需在已经得分的情况下再进行一次得分判断,以此类推,每次得分判断成功都可以得到更高的分数。在得分的情况下需要做两件事情,一是清除得分行的方块,二是将该行以上的方块都向下移动一行的距离。当然,在清除和移动方块位置的同时需要相应地改变数组元素的值。
制作过程
下面首先制作游戏中需要用到的方块。
(1)按【Ctrl+F8】键创建一个名为“方块”的影片剪辑元件并进入编辑。
(2)使用文本工具绘制一个10×10的矩形,其笔触颜色为#333333,填充颜色为#999999,将其左上角对齐元件中心。
(3)创建影片剪辑元件“形状1”~“形状7”,分别使用与步骤(2)中相同的笔触颜色和填充颜色绘制不同形状的方块,其中构成这些方块的小方块的大小都为10×10。
(4)在“库”面板的元件“方块”上单击鼠标右键,在弹出的快捷菜单中选择“链接”命令,打开“链接属性”对话框,为其添加链接,并将链接标识符设置为“square”。
(5)单击 按钮完成设置。
(6)在“库”面板的元件“形状1”上单击鼠标右键,在弹出的快捷菜单中选择“链接”命令,在打开的“链接属性”对话框中为其添加链接,将其链接标识符设置为“shape1”。
(7)按照与步骤(6)相似的方法将元件“形状1”~“形状7”的链接标识符设置为“shape1”~“shape7”。
1.2.2 制作按钮
该游戏用到的按钮主要有:控制方块下落速度的按钮,跳出游戏的按钮和重新开始游戏的按钮。
(1)按【Ctrl+F8】键创建一个名为“加速”的按钮元件并进入编辑。
(2)在按钮的“弹起”帧绘制一个黄色三角形,然后在“指针经过”帧插入一个关键帧,将三角形的颜色改成红色。
(3)创建一个名为“减速”的按钮元件并进入编辑。
(4)在按钮的“弹起”帧和“指针经过”帧绘制图形。
(5)创建一个名为“跳出”的按钮元件并进入编辑。
(6)在元件“跳出”的“弹起”、“指针经过”和“点击”帧插入关键帧,并绘制图形。
(7)创建一个名为“重新开始-按钮”的按钮元件,设计其“弹起”、“指针经过”和“点击”帧。
(8)创建一个名为“重新开始-剪辑”的影片剪辑元件,将按钮元件“重新开始-按钮”拖放到其元件中心。
1.2.3 设计界面
下面为方块游戏设计界面。
(1)创建一个影片剪辑元件“水平边界”,在其中绘制一条长度为240px的水平直线,将其对齐元件中心。
(2)创建一个影片剪辑元件“竖直边界”,在其中绘制一条长度为400px的竖直直线,将其对齐元件中心。
(3)创建一个影片剪辑元件“界面”,使用矩形工具绘制一个240×400的渐变色矩形。
(4)使用矩形工具绘制一个160×300的白色矩形,将其放置到渐变色矩形中。
(5)选中白色矩形,按【Delete】键将其删除,使渐变色矩形呈挖空状态。
(6)新建一个图层,在其中添加制作好的按钮。
(7)再添加两个动态文本框。
(8)将显示为“4”的动态文本变量设置为“v”。
(9)将显示为“00000”的动态文本变量设置为“score”。
(10)回到主场景,将背景大小设置为240×400,背景颜色设置为#CCCCCC。
(11)在第2帧插入空白关键帧,将元件“水平边界”拖放到场景中,将其实例命名为“base”。
(12)将元件“竖直边界”拖出两个到场景中,将左边的实例命名为“left”,将右边的实例命名为“right”。其中,实例“left”的x坐标为35,实例“right”的x坐标为205。
(13)将元件“界面”拖放到第2帧的场景中,在“属性”面板中将其实例命名为“top”。
(14)在第3帧插入空白关键帧,将元件“重新开始-剪辑”拖放到场景中。
1.2.4 添加程序代码
该游戏用到的代码稍稍有些复杂,下面进行逐一添加。
(1)选中主时间轴中的第1帧,按【F9】键打开其“动作”面板,在其中添加如下代码:
function hitothers(xx, yy, num, rot) { switch (num) { case 1 : switch (rot) { case 0 : x1 = (xx-40)/10-1; y1 = (330-yy)/10+1; x2 = (xx-40)/10; y2 = (330-yy)/10+1; x3 = (xx-40)/10+1; y3 = (330-yy)/10+1; x4 = (xx-40)/10; y4 = (330-yy)/10; break; case 90 : x1 = (xx-40)/10; y1 = (330-yy)/10+1; x2 = (xx-40)/10; y2 = (330-yy)/10; x3 = (xx-40)/10; y3 = (330-yy)/10-1; x4 = (xx-40)/10-1; y4 = (330-yy)/10; break; case 180 : x1 = (xx-40)/10; y1 = (330-yy)/10; x2 = (xx-40)/10-1; y2 = (330-yy)/10; x3 = (xx-40)/10-2; y3 = (330-yy)/10; x4 = (xx-40)/10-1; y4 = (330-yy)/10+1; break; case -90 : x1 = (xx-40)/10-1; y1 = (330-yy)/10+2; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; x3 = (xx-40)/10; y3 = (330-yy)/10+1; x4 = (xx-40)/10-1; y4 = (330-yy)/10; break; } break; case 2 : switch (rot) { case 0 : x1 = (xx-40)/10-2; y1 = (330-yy)/10+1; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; x3 = (xx-40)/10; y3 = (330-yy)/10+1; x4 = (xx-40)/10+1; y4 = (330-yy)/10+1; break; case 90 : x1 = (xx-40)/10; y1 = (330-yy)/10+2; x2 = (xx-40)/10; y2 = (330-yy)/10+1; x3 = (xx-40)/10; y3 = (330-yy)/10; x4 = (xx-40)/10; y4 = (330-yy)/10-1; break; case 180 : x1 = (xx-40)/10-2; y1 = (330-yy)/10; x2 = (xx-40)/10-1; y2 = (330-yy)/10; x3 = (xx-40)/10; y3 = (330-yy)/10; x4 = (xx-40)/10+1; y4 = (330-yy)/10; break; case -90 : x1 = (xx-40)/10-1; y1 = (330-yy)/10+2; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; x3 = (xx-40)/10-1; y3 = (330-yy)/10; x4 = (xx-40)/10-1; y4 = (330-yy)/10-1; break; } break; case 3 : x1 = (xx-40)/10-1; y1 = (330-yy)/10+1; x2 = (xx-40)/10; y2 = (330-yy)/10+1; x3 = (xx-40)/10; y3 = (330-yy)/10; x4 = (xx-40)/10-1; y4 = (330-yy)/10; break; case 4 : switch (rot) { case 0 : x1 = (xx-40)/10-1; y1 = (330-yy)/10+1; x2 = (xx-40)/10; y2 = (330-yy)/10+1; x3 = (xx-40)/10; y3 = (330-yy)/10; x4 = (xx-40)/10+1; y4 = (330-yy)/10; break; case 90 : x1 = (xx-40)/10; y1 = (330-yy)/10+1; x2 = (xx-40)/10; y2 = (330-yy)/10; x3 = (xx-40)/10-1; y3 = (330-yy)/10; x4 = (xx-40)/10-1; y4 = (330-yy)/10-1; break; case 180 : x1 = (xx-40)/10-2; y1 = (330-yy)/10+1; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; x3 = (xx-40)/10-1; y3 = (330-yy)/10; x4 = (xx-40)/10; y4 = (330-yy)/10; break; case -90 : x1 = (xx-40)/10-1; y1 = (330-yy)/10; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; x3 = (xx-40)/10; y3 = (330-yy)/10+1; x4 = (xx-40)/10; y4 = (330-yy)/10+2; break; } break; case 5 : switch (rot) { case 0 : x1 = (xx-40)/10-2; y1 = (330-yy)/10; x2 = (xx-40)/10-1; y2 = (330-yy)/10; x3 = (xx-40)/10-1; y3 = (330-yy)/10+1; x4 = (xx-40)/10; y4 = (330-yy)/10+1; break; case 90 : x1 = (xx-40)/10-1; y1 = (330-yy)/10+2; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; x3 = (xx-40)/10; y3 = (330-yy)/10+1; x4 = (xx-40)/10; y4 = (330-yy)/10; break; case 180 : x1 = (xx-40)/10-1; y1 = (330-yy)/10; x2 = (xx-40)/10; y2 = (330-yy)/10; x3 = (xx-40)/10; y3 = (330-yy)/10+1; x4 = (xx-40)/10+1; y4 = (330-yy)/10+1; break; case -90 : x1 = (xx-40)/10-1; y1 = (330-yy)/10+1; x2 = (xx-40)/10-1; y2 = (330-yy)/10; x3 = (xx-40)/10; y3 = (330-yy)/10; x4 = (xx-40)/10; y4 = (330-yy)/10-1; break; } break; case 6 : switch (rot) { case 0 : x1 = (xx-40)/10-1; y1 = (330-yy)/10+1; x2 = (xx-40)/10-1; y2 = (330-yy)/10; x3 = (xx-40)/10; y3 = (330-yy)/10; x4 = (xx-40)/10+1; y4 = (330-yy)/10; break; case 90 : x1 = (xx-40)/10; y1 = (330-yy)/10+1; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; x3 = (xx-40)/10-1; y3 = (330-yy)/10; x4 = (xx-40)/10-1; y4 = (330-yy)/10-1; break; case 180 : x1 = (xx-40)/10-2; y1 = (330-yy)/10+1; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; x3 = (xx-40)/10; y3 = (330-yy)/10+1; x4 = (xx-40)/10; y4 = (330-yy)/10; break; case -90 : x1 = (xx-40)/10-1; y1 = (330-yy)/10; x2 = (xx-40)/10; y2 = (330-yy)/10; x3 = (xx-40)/10; y3 = (330-yy)/10+1; x4 = (xx-40)/10; y4 = (330-yy)/10+2; break; } break; case 7 : switch (rot) { case 0 : x1 = (xx-40)/10-2; y1 = (330-yy)/10; x2 = (xx-40)/10-1; y2 = (330-yy)/10; x3 = (xx-40)/10; y3 = (330-yy)/10; x4 = (xx-40)/10; y4 = (330-yy)/10+1; break; case 90 : x1 = (xx-40)/10-1; y1 = (330-yy)/10+2; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; x3 = (xx-40)/10-1; y3 = (330-yy)/10; x4 = (xx-40)/10; y4 = (330-yy)/10; break; case 180 : x1 = (xx-40)/10-1; y1 = (330-yy)/10; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; x3 = (xx-40)/10; y3 = (330-yy)/10+1; x4 = (xx-40)/10+1; y4 = (330-yy)/10+1; break; case -90 : x1 = (xx-40)/10-1; y1 = (330-yy)/10+1; x2 = (xx-40)/10; y2 = (330-yy)/10+1; x3 = (xx-40)/10; y3 = (330-yy)/10; x4 = (xx-40)/10; y4 = (330-yy)/10-1; break; } break; } if ((_root.box[y1][x1] == 1) || (_root.box[y2][x2] == 1) || (_root.box[y3][x3] == 1) || (_root.box[y4][x4] == 1)) { _root.hit = true; } else { _root.hit = false; } } function attachsquares(xx, yy, num, rot) { switch (num) { case 1 : switch (rot) { case 0 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-10; _root["w"+_root.iii]._y = _root.currentmove._y-10; x1 = (xx-40)/10-1; y1 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x; _root["w"+(_root.iii+1)]._y = _root.currentmove._y-10; x2 = (xx-40)/10; y2 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x+10; _root["w"+(_root.iii+2)]._y = _root.currentmove._y-10; x3 = (xx-40)/10+1; y3 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x; _root["w"+(_root.iii+3)]._y = _root.currentmove._y; x4 = (xx-40)/10; y4 = (330-yy)/10; break; case 90 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x; _root["w"+_root.iii]._y = _root.currentmove._y-10; x1 = (xx-40)/10; y1 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x; _root["w"+(_root.iii+1)]._y = _root.currentmove._y; x2 = (xx-40)/10; y2 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x; _root["w"+(_root.iii+2)]._y = _root.currentmove._y+10; x3 = (xx-40)/10; y3 = (330-yy)/10-1; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+3)]._y = _root.currentmove._y; x4 = (xx-40)/10-1; y4 = (330-yy)/10; break; case 180 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x; _root["w"+_root.iii]._y = _root.currentmove._y; x1 = (xx-40)/10; y1 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+1)]._y = _root.currentmove._y; x2 = (xx-40)/10-1; y2 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x-20; _root["w"+(_root.iii+2)]._y = _root.currentmove._y; x3 = (xx-40)/10-2; y3 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+3)]._y = _root.currentmove._y-10; x4 = (xx-40)/10-1; y4 = (330-yy)/10+1; break; case -90 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-10; _root["w"+_root.iii]._y = _root.currentmove._y-20; x1 = (xx-40)/10-1; y1 = (330-yy)/10+2; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+1)]._y = _root.currentmove._y-10; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x; _root["w"+(_root.iii+2)]._y = _root.currentmove._y-10; x3 = (xx-40)/10; y3 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+3)]._y = _root.currentmove._y; x4 = (xx-40)/10-1; y4 = (330-yy)/10; break; } break; case 2 : switch (rot) { case 0 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-20; _root["w"+_root.iii]._y = _root.currentmove._y-10; x1 = (xx-40)/10-2; y1 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+1)]._y = _root.currentmove._y-10; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x; _root["w"+(_root.iii+2)]._y = _root.currentmove._y-10; x3 = (xx-40)/10; y3 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x+10; _root["w"+(_root.iii+3)]._y = _root.currentmove._y-10; x4 = (xx-40)/10+1; y4 = (330-yy)/10+1; break; case 90 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x; _root["w"+_root.iii]._y = _root.currentmove._y-20; x1 = (xx-40)/10; y1 = (330-yy)/10+2; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x; _root["w"+(_root.iii+1)]._y = _root.currentmove._y-10; x2 = (xx-40)/10; y2 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x; _root["w"+(_root.iii+2)]._y = _root.currentmove._y; x3 = (xx-40)/10; y3 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x; _root["w"+(_root.iii+3)]._y = _root.currentmove._y+10; x4 = (xx-40)/10; y4 = (330-yy)/10-1; break; case 180 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-20; _root["w"+_root.iii]._y = _root.currentmove._y; x1 = (xx-40)/10-2; y1 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+1)]._y = _root.currentmove._y; x2 = (xx-40)/10-1; y2 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x; _root["w"+(_root.iii+2)]._y = _root.currentmove._y; x3 = (xx-40)/10; y3 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x+10; _root["w"+(_root.iii+3)]._y = _root.currentmove._y; x4 = (xx-40)/10+1; y4 = (330-yy)/10; break; case -90 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-10; _root["w"+_root.iii]._y = _root.currentmove._y-20; x1 = (xx-40)/10-1; y1 = (330-yy)/10+2; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+1)]._y = _root.currentmove._y-10; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+2)]._y = _root.currentmove._y; x3 = (xx-40)/10-1; y3 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+3)]._y = _root.currentmove._y+10; x4 = (xx-40)/10-1; y4 = (330-yy)/10-1; break; } break; case 3 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-10; _root["w"+_root.iii]._y = _root.currentmove._y-10; x1 = (xx-40)/10-1; y1 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x; _root["w"+(_root.iii+1)]._y = _root.currentmove._y-10; x2 = (xx-40)/10; y2 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x; _root["w"+(_root.iii+2)]._y = _root.currentmove._y; x3 = (xx-40)/10; y3 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+3)]._y = _root.currentmove._y; x4 = (xx-40)/10-1; y4 = (330-yy)/10; break; case 4 : switch (rot) { case 0 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-10; _root["w"+_root.iii]._y = _root.currentmove._y-10; x1 = (xx-40)/10-1; y1 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x; _root["w"+(_root.iii+1)]._y = _root.currentmove._y-10; x2 = (xx-40)/10; y2 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x; _root["w"+(_root.iii+2)]._y = _root.currentmove._y; x3 = (xx-40)/10; y3 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x+10; _root["w"+(_root.iii+3)]._y = _root.currentmove._y; x4 = (xx-40)/10+1; y4 = (330-yy)/10; break; case 90 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x; _root["w"+_root.iii]._y = _root.currentmove._y-10; x1 = (xx-40)/10; y1 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x; _root["w"+(_root.iii+1)]._y = _root.currentmove._y; x2 = (xx-40)/10; y2 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+2)]._y = _root.currentmove._y; x3 = (xx-40)/10-1; y3 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+3)]._y = _root.currentmove._y+10; x4 = (xx-40)/10-1; y4 = (330-yy)/10-1; break; case 180 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-20; _root["w"+_root.iii]._y = _root.currentmove._y-10; x1 = (xx-40)/10-2; y1 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+1)]._y = _root.currentmove._y-10; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+2)]._y = _root.currentmove._y; x3 = (xx-40)/10-1; y3 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x; _root["w"+(_root.iii+3)]._y = _root.currentmove._y; x4 = (xx-40)/10; y4 = (330-yy)/10; break; case -90 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-10; _root["w"+_root.iii]._y = _root.currentmove._y; x1 = (xx-40)/10-1; y1 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+1)]._y = _root.currentmove._y-10; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x; _root["w"+(_root.iii+2)]._y = _root.currentmove._y-10; x3 = (xx-40)/10; y3 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x; _root["w"+(_root.iii+3)]._y = _root.currentmove._y-20; x4 = (xx-40)/10; y4 = (330-yy)/10+2; break; } break; case 5 : switch (rot) { case 0 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-20; _root["w"+_root.iii]._y = _root.currentmove._y; x1 = (xx-40)/10-2; y1 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+1)]._y = _root.currentmove._y; x2 = (xx-40)/10-1; y2 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+2)]._y = _root.currentmove._y-10; x3 = (xx-40)/10-1; y3 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x; _root["w"+(_root.iii+3)]._y = _root.currentmove._y-10; x4 = (xx-40)/10; y4 = (330-yy)/10+1; break; case 90 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-10; _root["w"+_root.iii]._y = _root.currentmove._y-20; x1 = (xx-40)/10-1; y1 = (330-yy)/10+2; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+1)]._y = _root.currentmove._y-10; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x; _root["w"+(_root.iii+2)]._y = _root.currentmove._y-10; x3 = (xx-40)/10; y3 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x; _root["w"+(_root.iii+3)]._y = _root.currentmove._y; x4 = (xx-40)/10; y4 = (330-yy)/10; break; case 180 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-10; _root["w"+_root.iii]._y = _root.currentmove._y; x1 = (xx-40)/10-1; y1 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x; _root["w"+(_root.iii+1)]._y = _root.currentmove._y; x2 = (xx-40)/10; y2 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x; _root["w"+(_root.iii+2)]._y = _root.currentmove._y-10; x3 = (xx-40)/10; y3 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x+10; _root["w"+(_root.iii+3)]._y = _root.currentmove._y-10; x4 = (xx-40)/10+1; y4 = (330-yy)/10+1; break; case -90 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-10; _root["w"+_root.iii]._y = _root.currentmove._y-10; x1 = (xx-40)/10-1; y1 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+1)]._y = _root.currentmove._y; x2 = (xx-40)/10-1; y2 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x; _root["w"+(_root.iii+2)]._y = _root.currentmove._y; x3 = (xx-40)/10; y3 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x; _root["w"+(_root.iii+3)]._y = _root.currentmove._y+10; x4 = (xx-40)/10; y4 = (330-yy)/10-1; break; } break; case 6 : switch (rot) { case 0 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-10; _root["w"+_root.iii]._y = _root.currentmove._y-10; x1 = (xx-40)/10-1; y1 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+1)]._y = _root.currentmove._y; x2 = (xx-40)/10-1; y2 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x; _root["w"+(_root.iii+2)]._y = _root.currentmove._y; x3 = (xx-40)/10; y3 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x+10; _root["w"+(_root.iii+3)]._y = _root.currentmove._y; x4 = (xx-40)/10+1; y4 = (330-yy)/10; break; case 90 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x; _root["w"+_root.iii]._y = _root.currentmove._y-10; x1 = (xx-40)/10; y1 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+1)]._y = _root.currentmove._y-10; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+2)]._y = _root.currentmove._y; x3 = (xx-40)/10-1; y3 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+3)]._y = _root.currentmove._y+10; x4 = (xx-40)/10-1; y4 = (330-yy)/10-1; break; case 180 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-20; _root["w"+_root.iii]._y = _root.currentmove._y-10; x1 = (xx-40)/10-2; y1 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+1)]._y = _root.currentmove._y-10; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x; _root["w"+(_root.iii+2)]._y = _root.currentmove._y-10; x3 = (xx-40)/10; y3 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x; _root["w"+(_root.iii+3)]._y = _root.currentmove._y; x4 = (xx-40)/10; y4 = (330-yy)/10; break; case -90 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-10; _root["w"+_root.iii]._y = _root.currentmove._y; x1 = (xx-40)/10-1; y1 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x; _root["w"+(_root.iii+1)]._y = _root.currentmove._y; x2 = (xx-40)/10; y2 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x; _root["w"+(_root.iii+2)]._y = _root.currentmove._y-10; x3 = (xx-40)/10; y3 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x; _root["w"+(_root.iii+3)]._y = _root.currentmove._y-20; x4 = (xx-40)/10; y4 = (330-yy)/10+2; break; } break; case 7 : switch (rot) { case 0 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-20; _root["w"+_root.iii]._y = _root.currentmove._y; x1 = (xx-40)/10-2; y1 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+1)]._y = _root.currentmove._y; x2 = (xx-40)/10-1; y2 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x; _root["w"+(_root.iii+2)]._y = _root.currentmove._y; x3 = (xx-40)/10; y3 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x; _root["w"+(_root.iii+3)]._y = _root.currentmove._y-10; x4 = (xx-40)/10; y4 = (330-yy)/10+1; break; case 90 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-10; _root["w"+_root.iii]._y = _root.currentmove._y-20; x1 = (xx-40)/10-1; y1 = (330-yy)/10+2; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+1)]._y = _root.currentmove._y-10; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+2)]._y = _root.currentmove._y; x3 = (xx-40)/10-1; y3 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x; _root["w"+(_root.iii+3)]._y = _root.currentmove._y; x4 = (xx-40)/10; y4 = (330-yy)/10; break; case 180 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-10; _root["w"+_root.iii]._y = _root.currentmove._y; x1 = (xx-40)/10-1; y1 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x-10; _root["w"+(_root.iii+1)]._y = _root.currentmove._y-10; x2 = (xx-40)/10-1; y2 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x; _root["w"+(_root.iii+2)]._y = _root.currentmove._y-10; x3 = (xx-40)/10; y3 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x+10; _root["w"+(_root.iii+3)]._y = _root.currentmove._y-10; x4 = (xx-40)/10+1; y4 = (330-yy)/10+1; break; case -90 : _root.attachMovie("square", "w"+_root.iii, 100+_root.iii); _root["w"+_root.iii]._x = _root.currentmove._x-10; _root["w"+_root.iii]._y = _root.currentmove._y-10; x1 = (xx-40)/10-1; y1 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+1), 100+_root.iii+1); _root["w"+(_root.iii+1)]._x = _root.currentmove._x; _root["w"+(_root.iii+1)]._y = _root.currentmove._y-10; x2 = (xx-40)/10; y2 = (330-yy)/10+1; _root.attachMovie("square", "w"+(_root.iii+2), 100+_root.iii+2); _root["w"+(_root.iii+2)]._x = _root.currentmove._x; _root["w"+(_root.iii+2)]._y = _root.currentmove._y; x3 = (xx-40)/10; y3 = (330-yy)/10; _root.attachMovie("square", "w"+(_root.iii+3), 100+_root.iii+3); _root["w"+(_root.iii+3)]._x = _root.currentmove._x; _root["w"+(_root.iii+3)]._y = _root.currentmove._y+10; x4 = (xx-40)/10; y4 = (330-yy)/10-1; break; } break; } _root.box[y1][x1] = 1; _root.box[y2][x2] = 1; _root.box[y3][x3] = 1; _root.box[y4][x4] = 1; _root.iii += 4; judgescore(); } function judgescore() { if (_root.box[29][6] == 1 || _root.box[29][7] == 1 || _root.box[29][8] == 1 || _root.box[29][9] == 1 || _root.box[29][10] == 1) { nextFrame(); } _root.fill1 = -1; _root.fill2 = -1; _root.fill3 = -1; _root.fill4 = -1; for (var m = 0; m<=29; m++) { _root.gain = true; for (var n = 0; n<=15; n++) { if (_root.box[m][n] == 0) { _root.gain = false; } } if (_root.gain == true) { _root.fill1 = m; } } if (_root.fill1 != -1) { _root.top.score = Number(_root.top.score)+100; for (var z = 0; z<=_root.iii; z++) { if (_root["w"+z]._y == 330-_root.fill1*10) { _root["w"+z].removeMovieClip(); } } for (var z = 0; z<=_root.iii; z++) { if (_root["w"+z]._y<330-_root.fill1*10) { _root["w"+z]._y += 10; } } for (var c = _root.fill1; c<=28; c++) { for (var d = 0; d<=15; d++) { _root.box[c][d] = _root.box[c+1][d]; } } for (var m = 0; m<=29; m++) { _root.gain = true; for (var n = 0; n<=15; n++) { if (_root.box[m][n] == 0) { _root.gain = false; } } if (_root.gain == true) { _root.fill2 = m; } } if (_root.fill2 != -1) { _root.top.score = Number(_root.top.score)+200; for (var z = 0; z<=_root.iii; z++) { if (_root["w"+z]._y == 330-_root.fill2*10) { _root["w"+z].removeMovieClip(); } } for (var z = 0; z<=_root.iii; z++) { if (_root["w"+z]._y<330-_root.fill2*10) { _root["w"+z]._y += 10; } } for (var c = _root.fill2; c<=28; c++) { for (var d = 0; d<=15; d++) { _root.box[c][d] = _root.box[c+1][d]; } } for (var m = 0; m<=29; m++) { _root.gain = true; for (var n = 0; n<=15; n++) { if (_root.box[m][n] == 0) { _root.gain = false; } } if (_root.gain == true) { _root.fill3 = m; } } if (_root.fill3 != -1) { _root.top.score = Number(_root.top.score)+300; for (var z = 0; z<=_root.iii; z++) { if (_root["w"+z]._y == 330-_root.fill3*10) { _root["w"+z].removeMovieClip(); } } for (var z = 0; z<=_root.iii; z++) { if (_root["w"+z]._y<330-_root.fill3*10) { _root["w"+z]._y += 10; } } for (var c = _root.fill3; c<=28; c++) { for (var d = 0; d<=15; d++) { _root.box[c][d] = _root.box[c+1][d]; } } for (var m = 0; m<=29; m++) { _root.gain = true; for (var n = 0; n<=15; n++) { if (_root.box[m][n] == 0) { _root.gain = false; } } if (_root.gain == true) { _root.fill4 = m; } } if (_root.fill4 != -1) { _root.top.score = Number(_root.top.score)+400; for (var z = 0; z<=_root.iii; z++) { if (_root["w"+z]._y == 330-_root.fill4*10) { _root["w"+z].removeMovieClip(); } } for (var z = 0; z<=_root.iii; z++) { if (_root["w"+z]._y<330-_root.fill4*10) { _root["w"+z]._y += 10; } } for (var c = _root.fill4; c<=28; c++) { for (var d = 0; d<=15; d++) { _root.box[c][d] = _root.box[c+1][d]; } } } } } } _root.fill1 = -1; _root.fill2 = -1; _root.fill3 = -1; _root.fill4 = -1; } |
stop(); _root.restart.removeMovieClip(); _root.currentshape = 0; _root.iii = 1; _root.fall = true; _root.wait = 0; _root.v = 6-Number(_root.top.v); _root.hit = false; _root.top.duplicateMovieClip("top", 99999); _root.top.score = 0; _root.ran1 = random(7)+1; _root.box = new Array(); for (var i = 0; i<=29; i++) { _root.box[i] = new Array(); for (var j = 0; j<=15; j++) { _root.box[i][j] = 0; } } Key.addListener(_root); _root.onKeyDown = function() { if (Key.getCode() == Key.LEFT) { _root.currentmove._x -= 10; hitothers(_root.currentmove._x, _root.currentmove._y, _root.ran, _root.currentmove._rotation); if (_root.currentmove.hitTest(_root.left) || _root.hit == true) { _root.currentmove._x += 10; } } else if (Key.getCode() == Key.RIGHT) { _root.currentmove._x += 10; hitothers(_root.currentmove._x, _root.currentmove._y, _root.ran, _root.currentmove._rotation); if (_root.currentmove.hitTest(_root.right) || _root.hit == true) { _root.currentmove._x -= 10; } } else if (Key.getCode() == Key.DOWN) { _root.fall = false; _root.currentmove._y += 10; hitothers(_root.currentmove._x, _root.currentmove._y, _root.ran, _root.currentmove._rotation); if (_root.currentmove.hitTest(_root.base) || _root.hit == true) { _root.currentmove._y -= 10; attachsquares(_root.currentmove._x, _root.currentmove._y, _root.ran, _root.currentmove._rotation); removeMovieClip(_root.currentmove); _root.currentshape = 0; } _root.fall = true; } else if (Key.getCode() == Key.UP) { _root.currentmove._rotation += 90; hitothers(_root.currentmove._x, _root.currentmove._y, _root.ran, _root.currentmove._rotation); if (_root.currentmove.hitTest(_root.right) || _root.currentmove.hitTest(_root.left) || _root.hit == true) { _root.currentmove._rotation -= 90; } } }; _root.onEnterFrame = function() { if (_root.currentshape == 0) { _root.ran = _root.ran1; _root.attachMovie("shape"+_root.ran, "currentmove", 100); _root.currentmove._x = 120; _root.currentmove._y = 40; _root.currentshape = _root.ran; _root.currentmove.onEnterFrame = function() { if (_root.fall == true) { if (_root.wait == _root.v) { this._y += 10; _root.wait = 0; } else { _root.wait++; } } }; _root.ran1 = random(7)+1; _root.attachMovie("shape"+_root.ran1, "nextmove", 100001); _root.nextmove._x = 200; _root.nextmove._y = 20; } hitothers(_root.currentmove._x, _root.currentmove._y, _root.ran, _root.currentmove._rotation); if ((_root.hit == true || _root.currentmove.hitTest(_root.base)) && (_root.fall == true)) { _root.currentmove._y -= 10; attachsquares(_root.currentmove._x, _root.currentmove._y, _root.ran, _root.currentmove._rotation); removeMovieClip(_root.currentmove); _root.currentshape = 0; } }; |
on (release) { if (_root.top.v<6) { _root.top.v = Number(_root.top.v)+1; } _root.wait = 0; _root.v = 6-Number(_root.top.v); } |
on (release) { if (_root.top.v>1) { _root.top.v = Number(_root.top.v)-1; } _root.wait = 0; _root.v = 6-Number(_root.top.v); } |
on (release) { removeMovieClip(_root.currentmove); _root.nextFrame(); } |
stop(); |
onClipEvent (enterFrame) { this.duplicateMovieClip("restart", 100000); } |
on (release) { for (var del = 0; del<=_root.iii; del++) { _root["w"+del].removeMovieClip(); } for (var p = 0; p<=39; p++) { for (var q = 0; q<=25; q++) { _root.box[p][q] = 0; } } _root.gotoAndStop(2); } |