有悔棋功能的五子棋c语言代码,有保存读取悔棋功能的五子棋.doc

有保存读取悔棋功能的五子棋

制作拖动鼠标产生水纹动画的制作

1、导入一张合适的图片到库中

2、在库中刚导入的图片上点击右键。点击“链接”,再按下图设置链接属性。

3、新建一个空影片剪辑元件,且将其放入主场景中,命名为:mcaa.

4、在主场景第一帧写上如下代码:

var surface1 = flash.display.BitmapData.loadBitmap("surface",0);

var bounds = new flash.geom.Rectangle(0, 0, 456, 356);

var origin = new flash.geom.Point();

var matrix = new flash.geom.Matrix();

var matrix2 = new flash.geom.Matrix();

matrix2.a = matrix2.d = 2;

var wave = new flash.filters.ConvolutionFilter(3, 3, [1, 1, 1, 1, 1, 1, 1, 1, 1], 9, 0);

var damp = new flash.geom.ColorTransform(0, 0, 9.960937E-001, 1, 0, 0, 2, 0);

var water = new flash.filters.DisplacementMapFilter(result2, origin, 4, 4,48,48);

attachMovie("mcaa","mcaa",-1700)

//mcaa._width=456

//mcaa._height=356

//var mcaa:MovieClip = this.createEmptyMovieClip("mcaa",0);

mcaa.attachBitmap(output, 0)//this.getNextHighestDepth());

//attachBitmap(output, 0);

var ms = getTimer();

var frame = 0;

var mouseDown = false;

onMouseDown = function ()

{

mouseDown = true;

};

onMouseUp = function ()

{

onEnterFrame();

mouseDown = false;

};

onEnterFrame = function ()

{

if (mouseDown)

{

var _loc2 = _xmouse / 2;

var _loc1 = _ymouse / 2;

source.setPixel(_loc2 + 1, _loc1,;

source.setPixel(_loc2 - 1, _loc1,;

source.setPixel(_loc2, _loc1 + 1,;

source.setPixel(_loc2, _loc1 - 1,;

source.setPixel(_loc2, _loc1,;

} // end if

result.applyFilter(source, bounds, origin, wave);

result.draw(result, matrix, null, "add");

result.draw(buffer, matrix, null, "difference");

result.draw(result, matrix, damp);

result2.draw(result, matrix2, null, null, null, true);

output.applyFilter(surface1, new flash.geom.Rectangle(0, 0, 456, 356), origin, water);

buffer = source;

source = result.clone();

};

updateAfterEvent();

主场景第二帧代码

fscommand("allowscale", "false");

_bu=1

_root.plabu=1

主场景第三代码

l1 = _framesloaded;

l2 = _totalframes;

if (l1 == l2)

{

gotoAndPlay(10);

} // end

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值