震撼~!25行AS3的效果
[i=s] 本帖最后由 hanxingdd 于 2009-5-21 20:40 编辑 [/i]下面的FLASH动画全部完全就由25行AS代码实现的....
[swf]http://bbs.jcwcn.com/attachments/month_0905/0905211927f51579bebd808435.swf[/swf]
代码:
[code][SWF(width=800,height=450,backgroundColor=0xE8F0F8,frameRate=25)]
stage.align=StageAlign.TOP;
stage.scaleMode=StageScaleMode.NO_BORDER;
var n:int = 32, m:int = 32, vertices:Vector.<Number> = new Vector.<Number>(),indices:Vector.<int> = new Vector.<int>(),uvtData:Vector.<Number> = new Vector.<Number>(), projectedVerts:Vector.<Number> = new Vector.<Number>(n*m*4), perlinTerrain:BitmapData =new BitmapData(n,m,false),heightGradient:BitmapData = new BitmapData(288,2,false,0xE8F0F8), newBitmap:BitmapData = heightGradient.clone(),perlinPoint:Point = new Point(),i:int, j:int, ii:int=0, ij:int, ix:Number, iy:Number, tmp:Number, phase:Number=0.0, projectionMatrix:Matrix3D,rotAngle:Number = 0.25*Math.PI;
heightGradient.setVector( new Rectangle(0, 0, heightGradient.width, 1), Vector.<uint>([0xebe9da, 0xebe1db, 0xe9e9da, 0xebe3cf, 0xe9ebce, 0xebe9cd, 0xe9e9cd, 0xe3e1cb, 0xebe3ca, 0xe3e9c9, 0xe1e9cb, 0xe1e9cf, 0xe3e3cf, 0xe1e3c5, 0xe9ebc5, 0xebe3c3, 0xe1ebc3, 0xebe3ca, 0xe1dfcb, 0xebdfca, 0xe1ddbf, 0xe1ddbf, 0xe1dbbf, 0xe3dbbe, 0xe3dbbb, 0xebdaba, 0xe3dfb9, 0xebdfba, 0xe9d5b7, 0xebddbe, 0xe1dbbf, 0xe1dbb7, 0xebd3bf, 0xe3dab6, 0xe3dab4, 0xebdbbd, 0xe1d3bf, 0xe9d3b4, 0xe9dbb6, 0xebdbb5, 0xe9d2b6, 0xe9dbbd, 0xe3dbb5,0xebdabe,0xebd2b6, 0xe9dab6, 0xe1d3bd, 0xebd2b5, 0xe3d2bc, 0xdbcaaf, 0xd5caa7, 0xcfbb9e, 0xcbb39c, 0xc3aa8e, 0xbda28d, 0xbf9a7c, 0xb39a74, 0xab8b6d, 0xa5826c, 0x9f7b5d, 0x997255, 0x9b6b4d, 0x8d624e, 0x875a3c, 0x875a3c, 0x885b3f, 0x8b5d3e, 0x8a5f3f, 0x8b5e48, 0x8c5f41, 0x8d604a, 0x8e6143, 0x8f6a4f, 0x92634f, 0x91644f, 0x926547, 0x936f48, 0x9e6f49, 0x9f684a, 0x96694b, 0x966b4b, 0x936f49, 0x8c6f4f, 0x876b47, 0x82634b, 0x7d5f4b, 0x7a5f3f, 0x735b3d, 0x6e5b3b, 0x6b5f3b, 0x6c5f37, 0x5f5335, 0x5a5933, 0x574f33,0x5a4d2f,0x4b4b2d,0x4b4b2d,0x4b4b2d,0x4f472f,0x474d2f,0x43432d,0x41492f,0x3f3f2d,0x3d3d2d, 0x3b3b2d, 0x393b2f, 0x37372d, 0x3f372d, 0x33332d, 0x3b332d, 0x2f2f2f, 0x2f2d2f, 0x2d2d2f, 0x2c302c, 0x2b332b, 0x2a3e2a, 0x2b3b2b, 0x2a3e29, 0x2f3f2f, 0x264a27, 0x274f25, 0x24482f, 0x2b4b23, 0x224f2a, 0x215121, 0x2a5622, 0x1f5f1f, 0x1e5a1f, 0x1e5b1f, 0x225b23, 0x265f2c, 0x2a5d27, 0x2e5e2b, 0x3a5f2f, 0x3e683b, 0x3a6933, 0x3e6a3e, 0x42633b, 0x4e643f, 0x4a6f3f, 0x4e674a, 0x5a6745, 0x5e6848, 0x5a6b4b, 0x5a694b, 0x5a6f57, 0x5a7f5f, 0x5a7b62, 0x5a8162, 0x5a8768, 0x5a8f70, 0x5a9374, 0x729970, 0x6F9f62, 0x72ad60, 0x7aab6f, 0x95Ab80,0x6ed5de, 0x5acbdb, 0x5abdcb, 0x5ac3db, 0x5ebbcf, 0x5abbcf, 0x4eabc9, 0x4aabcf, 0x5eabd3, 0x4a93c0, 0x3e8bbd, 0x3a8bba, 0x3e7bb7, 0x3273b6, 0x2e6bb1, 0x2a6bae, 0x3e6bbb, 0x2a5baa, 0x1e4ba7, 0x1e4baf, 0x1e4baa, 0x1e4b9f, 0x1e4a9e, 0x1e4799, 0x1e4696, 0x1e4f9b, 0x1e4f90, 0x1e4b8d, 0x1e4a8b, 0x1e498f, 0x1e4887, 0x1e3f89, 0x1e3f7f, 0x1e3f7b, 0x1e3f7a, 0x1e3e79, 0x1f3f78, 0x203e7a,0x2b3c7a,0x223c79,0x2b3d79,0x2e3f79,0x2d3d79,0x263c7a,0x273d79,0x283e78,0x293e78, 0x2a3d78, 0x2b3c7a, 0x2c3d7b, 0x2d3d78, 0x2f3f78, 0x2e3d7b, 0x2b3e7b, 0x2a3f79, 0x294978, 0x2a4b7a, 0x27427a, 0x264b79, 0x2d447a, 0x2c4d7b, 0x2b4f7a, 0x2a4778, 0x294879, 0x204979, 0x1f4b79, 0x1e4b7b, 0x1e4b79, 0x1e4d79, 0x1e4d7a, 0x1e4f7b, 0x1e4f7d, 0x1e587d, 0x1e537f, 0x1e537f, 0x1e5b81, 0x1e5489, 0x1e5d8b, 0x1e5f83, 0x1e5f85, 0x1e5985, 0x1e5b8f, 0x1e5b87, 0x1e5a8f, 0x1e5a86, 0x1e5e85, 0x1e5f8d, 0x1e5283, 0x1e5b8a, 0x1e4e8b, 0x1e4d8a, 0x1e4b7f, 0x1e4a7e, 0x1e477f, 0x1e457f, 0x1e437b, 0x1e407a, 0x1e3e79, 0x1e3d7a, 0x1e3c78, 0x2b477f, 0x3a5b8f, 0x455d8f, 0x5a6a96, 0x5f7b9b, 0x6e7eaa, 0x798ba9, 0x8694b1, 0x939fb7, 0xaaabbe, 0xadbfc7, 0xbac2cd, 0xcfcbd3, 0xdcd6db, 0xebebeb, 0xe9e3e1, 0xe0e3e8, 0xdfdfdf, 0xdedfde, 0xdddfdd, 0xdcdddf, 0xdbdbdb, 0xdadbda, 0xd9dbd9, 0xd8d9d8, 0xdfd7d7, 0xdedede, 0xd7dddd, 0xd4d6dd, 0xd3d3db, 0xdad2d2]));
x=stage.stageWidth/2.0;
y=stage.stageHeight/2.0;
for (i = 0; i != n; i++) {
for (j = 0; j != m; j++) {
vertices.push((ix= 1.0001 - i / (n - 1))+(iy= j/(m-1)-1.0),0.0,ix-iy,iy+ix,-0.2, ix-iy );
uvtData.push( j / m, 0.9 * (tmp=Math.max(1.0 - j / m, 1.0 - i / n)), 1.0, 0.99, tmp, 1.0);
}
}
for (i=0; i!=n-1; i++) {
for (j=0; j!=m-1; j++) {
indices.push(ii,ii+m+m+2,ii+2,ii+m+m, ii+m+m +2, ii ,++ii,ii+2 ,ii+m+m+2 ,ii+m+m , ii , (ii++)+m+m + 2);
}
ii+=2;
}
addEventListener(Event.ENTER_FRAME, function update(e:Event = null, ii:int=0):void {;
perlinTerrain.perlinNoise(n, m, 5, 11, false, true, 4, false, [ perlinPoint = new Point( perlinPoint.x -= 0.5 * Math.sin(rotAngle = (15.0 * rotAngle + Math.max(-0.5, Math.min((tmp = 0.5*Math.PI * ((i = perlinTerrain.getPixel(n - 3, m - 1) + perlinTerrain.getPixel(n - 2, m - 1)) - 0x70) / (i - (perlinTerrain.getPixel(n - 1, m - 3) + perlinTerrain.getPixel(n - 1, m - 2)) +0.01) ),2.0))) / 16.0),perlinPoint.y -= 0.5 * Math.cos(rotAngle)),perlinPoint, perlinPoint, perlinPoint, perlinPoint]);
ij = ( (ij = perlinTerrain.getPixel(n - 1, m - 1)) > 128) ? 128-20 : ij -20;
tmp = 1.0 / (1.2 + Math.sin(0.333*(phase += 0.02)));
for (i=0 ; i!=n; i++) for (j = 0 ; j != m; j++) {;
vertices[ii + 1] = Math.min(0.1,Math.pow((uvtData[ii] = perlinTerrain.getPixel(i, j) / 0xFF),tmp) - Math.pow(ij / 0xFF, tmp)) ;
uvtData[ii + 3] = 1.0 - (0.15+0.05*Math.cos(phase)) * uvtData[(ii += 6)-6];
};
(projectionMatrix = new PerspectiveProjection().toMatrix3D()).appendRotation(-12.0 * (rotAngle-Math.PI/4) / Math.PI, Vector3D.Z_AXIS);
Utils3D.projectVectors(projectionMatrix, vertices,projectedVerts, uvtData);
newBitmap.applyFilter(heightGradient, heightGradient.rect,new Point(), new ColorMatrixFilter([1.0, tmp=0.2+0.25*Math.cos(phase), tmp, 0, -tmp*(0xF0+0xF8),tmp*=1.0,1.0,tmp, 0, -tmp*(0xE8+0xF8),tmp*=0.7,tmp,1.0, 0, -tmp*(0xE8+0xF0),0.0, 0.0, 0.0, 1.0, 0.0]));
graphics.clear();
graphics.beginBitmapFill(newBitmap, null, false, true);;
graphics.drawTriangles(projectedVerts,indices,uvtData, TriangleCulling.POSITIVE);
} );
[/code]
点击漂下的物块...
[swf]http://bbs.jcwcn.com/attachments/month_0905/090521192736f5ea7fef9e1748.swf[/swf] jc:qiang 射击游戏代码:[code][SWF(width=800,height=800,backgroundColor=0x000000,frameRate=24)]
stage.align=StageAlign.TOP_LEFT;
stage.scaleMode=StageScaleMode.NO_SCALE;
// 25 lines begins here!
//1
var data:Object = {so:SharedObject.getLocal("invaders"), txt:addChild(new TextField()) as TextField, canShoot:true, time:0, prevTime:0, prevShootTime:0, tempx:0, score:0, lives:10, holder:addChild(new Sprite()) as Sprite, _p:new Dictionary(), bmp:addChild(new Bitmap(new BitmapData(800, 800, true, 0))) as Bitmap};
//2
(data.turret = addChild(new Sprite()) as Sprite).graphics.drawGraphicsData(Vector.<IGraphicsData>([new GraphicsStroke(1, true, "normal", "square", "miter", 8, new GraphicsSolidFill(0x333333)), new GraphicsSolidFill(0xCCCCCC), new GraphicsPath(Vector.<int>([1,3,3,3,3,3,3,3,3]),Vector.<Number>([0, -10, 5, -10, 7.5, -7.5, 10, -5, 10, 0, 10, 5, 7.5, 7.5, 5, 10, 0, 10, -5, 10, -7.5, 7.5, -10, 5, -10, 0, -10, -5, -7.5, -7.5, -5, -10, 0, -10]), GraphicsPathWinding.NON_ZERO), new GraphicsSolidFill(0xCCCCCC), new GraphicsPath(Vector.<int>([1,2,2,2,2]),Vector.<Number>([-1, -4, 15, -4, 15, 4, -1, 4, -1, -4]), GraphicsPathWinding.NON_ZERO), new GraphicsEndFill()]));
//3
(data.terrain = addChild(new Sprite()) as Sprite).graphics.drawGraphicsData(Vector.<IGraphicsData>([new GraphicsSolidFill(0xFFFFFF),new GraphicsPath(Vector.<int>([1,2,2,2,2,2,2,2,2,2,2,2]),Vector.<Number>([0, 790, 100, 780, 200, 785, 300, 775, 400, 795, 500, 780, 600, 760, 700, 780, 800, 780, 800, 800, 0, 800, 0, 790]), GraphicsPathWinding.NON_ZERO), new GraphicsStroke(1, true, "normal", "square", "miter", 8, new GraphicsSolidFill(0x333333)), new GraphicsSolidFill(0xCCCCCC),new GraphicsPath(Vector.<int>([1,2,2,2,2]),Vector.<Number>([380, 785, 420, 785, 420, 800, 380, 800, 380, 785]), GraphicsPathWinding.NON_ZERO), new GraphicsEndFill()]));
//4
stage.addEventListener(MouseEvent.CLICK, function():void { (data.lives > 0 && data.canShoot) ? emit("r", { x:400, y:795, r:data.turret.rotation } ) : (data.lives <= 0) ? data.time = data.score = int(!Boolean(data.lives = 10)) : null; } );
//5
stage.addEventListener(Event.ENTER_FRAME, function():void {;
//6
data.turret.transform.matrix = new Matrix(data.turret.scaleX * Math.cos((Math.atan2(data.turret.y - stage.mouseY, data.turret.x - stage.mouseX) * 360 / (Math.PI * 2) - 180) * Math.PI / 180), (data.turret.scaleY) * Math.sin((Math.atan2(data.turret.y - stage.mouseY, data.turret.x - stage.mouseX) * 360 / (Math.PI * 2) - 180) * Math.PI / 180), -(data.turret.scaleY) * Math.sin((Math.atan2(data.turret.y - stage.mouseY, data.turret.x - stage.mouseX) * 360 / (Math.PI * 2) - 180) * Math.PI / 180), data.turret.scaleX * Math.cos((Math.atan2(data.turret.y - stage.mouseY, data.turret.x - stage.mouseX) * 360 / (Math.PI * 2) - 180) * Math.PI / 180), 400, 785);
//7
data.bmp.bitmapData.applyFilter(data.bmp.bitmapData, data.bmp.bitmapData.rect, new Point(), new flash.filters.ColorMatrixFilter([0.93, 0, 0, 0, 0, 0, 0.85, 0, 0, 0, 0, 0, 0.9, 0, 0, 0, 0, 0, .9, 0]));
//8
for each (var p:Object in data._p) {;
//9
((data.time - p.tS) > p.lS) ? delete data._p[data.holder.removeChild(p.t)] : (p.type == "ship" && data.terrain.hitTestPoint(p.t.x, p.t.y, true) && (data.time - p.tS) < p.lS) ? p.lS = ((data.lives - 1) < 0 ? data.lives = 0 : data.lives -= 1) : null;
//10
for (var i:int=1; i <= (((p.type == "r" || p.type == "ship") && ((data.time - p.tS) > p.lS)) ? 20 : (p.type == "r") ? 1 : 0); i++) emit((p.type == "r" || p.type == "ship") && ((data.time - p.tS) > p.lS) ? "s2" : "s", {x:p.t.x, y:p.t.y}, (p.type == "r") ? 0xF7AC00 : (p.type == "ship") ? p.color : NaN);
//11
p.v = { x:p.v.x * ((p.type == "s") ? 0.99 : (p.type == "s2") ? 0.91 : 1), y:(p.v.y + ((p.type == "r") ? 0.35 : (p.type == "s") ? -0.03 : (p.type == "r" ) ? 0.2 : 0)) * ((p.type == "s") ? 0.99 : (p.type == "s2") ? 0.91 : 1) };
//12
p.t.transform.matrix = new Matrix((p.t.scaleX * ((p.type == "r") ? 0.98 : (p.type == "s") ? 1.02 : (p.type == "ship") ? 1 : 0.9)) * Math.cos(Math.atan2(p.v.y, p.v.x)), (p.t.scaleY * ((p.type == "r") ? 0.98 : (p.type == "s") ? 1.02 : (p.type == "ship") ? 1 : 0.9)) * Math.sin(Math.atan2(p.v.y, p.v.x)), -((p.t.scaleY * ((p.type == "r") ? 0.98 : (p.type == "s") ? 1.02 : (p.type == "ship") ? 1 : 0.9)) * Math.sin(Math.atan2(p.v.y, p.v.x))), (p.t.scaleX * ((p.type == "r") ? 0.98 : (p.type == "s") ? 1.02 : (p.type == "ship") ? 1 : 0.9)) * Math.cos(Math.atan2(p.v.y, p.v.x)), p.t.x + p.v.x, p.t.y + p.v.y);
//13
data.bmp.bitmapData.draw(p.t, new Matrix(p.t.scaleX * Math.cos(Math.atan2(p.v.y, p.v.x)), p.t.scaleY * Math.sin(Math.atan2(p.v.y, p.v.x)), -(p.t.scaleY * Math.sin(Math.atan2(p.v.y, p.v.x))), p.t.scaleX * Math.cos(Math.atan2(p.v.y, p.v.x)), p.t.x, p.t.y), new ColorTransform(1, 1, 1, 0.98));
//14
for each (var p2:Object in data._p) if ((p.type == "r") ? (p2.type == "ship" && p.t.hitTestObject(p2.t)) ? Boolean(p2.lS = p.lS = (((data.score + 1) > int(data.so.data.score)) ? (data.so.data.score = (data.score += 1)) : (data.score += 1))) : false : false) break; };
//15
data.txt.htmlText = (data.lives > 0 ) ? "<br/><font face='_sans' color='#ffffff' size='25'><b><i> Invaders!</i></b><font face='_sans' color='#eeeeee' size='20'><br/> Lives: " + data.lives + " | Score: " + data.score + " | <b>High Score: " + int(data.so.data.score) + "</b></font>" : "<br/><font face='_sans' color='#ffffff' size='25'><b><i> Invaders!</i></b><font face='_sans' color='#eeeeee' size='20'><br/> Lives: " + data.lives + " | Score: " + data.score + " | <b>High Score: " + int(data.so.data.score) + "</b></font><br/><br/><br/><br/><br/><br/><br/><p align='center'><font face='_sans' color='#ff0000' size='40'><b>GAME OVER!</b></font><br/><br/><font face='_sans' color='#eeeeee' size='20'>- Click again to restart game -</font></p>";
//16
if(data.lives <= 0 ) data.so.flush();
//17
((data.time = getTimer()) < 1500) ? stage.mouseChildren = data.txt.selectable = !(data.txt.multiline = Boolean(data.txt.height = data.txt.width = 800)) : ((data.time - data.prevTime) >= 2000 && data.lives > 0) ? emit("ship", { x:(Math.random() * 775) + 20, y:0 } ) : null;
//18
if ((data.time - data.prevShootTime) >= 1000) data.canShoot = true; } );
//19
function emit(type:String, pt:Object, color:Number = NaN):void {
//20
(type == "ship") ? data.prevTime = data.time : (type == "r") ? data.canShoot = !Boolean(data.prevShootTime = data.time) : null;
//21
var p:Object = {type:type, tS:data.time, t:data.holder.addChild(new Sprite()), color:(type == "r") ? 0xF7AC00 : Math.random() * 0xFFFFFF, lS:(type == "ship") ? 50000 : (type == "r") ? 3500 : (type == "s") ? 1660 : 1300, v:(type == "ship") ? {x:0, y:5 + .3 * (data.score)} : (type == "r") ? {x:27 * Math.cos((pt.r * Math.PI / 180)), y:27 * Math.sin((pt.r * Math.PI / 180))} : (type == "s") ? {x:Math.random() * (0.25 - -0.25) + -0.25, y:0} : {x:(data.tempx = (Math.random() * (20 - 10) + 10)) * Math.cos((Math.random()*360) * (180 / Math.PI)), y:data.tempx * Math.sin((Math.random()*360) * (180 / Math.PI))}};
//22
p.t.graphics.drawGraphicsData(Vector.<IGraphicsData>([(type == "ship") ? new GraphicsSolidFill(p.color, 0.5) : (type == "s") ? new GraphicsGradientFill("radial", [0xFFFFFF, 0xFFFFFF], [0.1, 0.012], [0, 255], new Matrix(0.023, 0, 0, 0.023)) : (type == "r") ? new GraphicsGradientFill("radial", [0xFFFFFF, 0xFFFFFF, p.color, p.color], [1, 1, 0.25, 0.25], [0, 150, 151, 255], new Matrix(0.0213, 0, 0, 0.0024, 0, 0)) : new GraphicsGradientFill("radial", [0xFFFFFF, 0xFFFFFF, color, color], [0.5, 0.5, 0.075, 0.075], [0, 150, 151, 255], new Matrix(0.0213, 0, 0, 0.0024, 0, 0)), (type == "ship") ? new GraphicsPath(Vector.<int>([2, 2, 2, 2, 2, 2, 2]), Vector.<Number>([0, 5, 0, 10, 5, 20, 10, 10, 10, 5, 5, -5, 0, 5])) : (type == "s") ? new GraphicsPath(Vector.<int>([1,3,3,3,3]), Vector.<Number>([0, -10, 10, -10, 10, 0, 10, 10, 0, 10, -10, 10, -10, 0, -10, -10, 0, -10])) : new GraphicsPath(Vector.<int>([1,3,3,3,3]), Vector.<Number>([-21, -5.5, 21, -5.5, 21, 0, 21, 0, 0, 5.5, -21, 5.5, -21, 0, -21, -5.5, 0, 0])), new GraphicsEndFill()]));
//23
p.t.transform.matrix = new Matrix(((type == "r" || type == "ship") ? 1 : (type == "s") ? Math.random() * (0.5 - 0.25) + 0.25 : Math.random() * (2.3 - 1.5) + 1.5), 0, 0, ((type == "r" || type == "ship") ? 1 : (type == "s") ? Math.random() * (0.5 - 0.25) + 0.25 : Math.random() * (2.3 - 1.5) + 1.5), pt.x, pt.y);
//24
data._p[p.t]=p;
}
//25
// Free!
// 25 lines ends here![/code] [i=s] 本帖最后由 hanxingdd 于 2009-5-21 19:46 编辑 [/i]
11代码
[code][SWF(width=800,height=800,backgroundColor=0x000000,frameRate=24)]
stage.align=StageAlign.TOP_LEFT;
stage.scaleMode=StageScaleMode.NO_SCALE;
// 25 lines begins here!
var objects:Vector.<Vector3D> = new Vector.<Vector3D>();
var particles:Array = new Array();
for (var j:Number=0; j<2*Math.PI; j+=2*Math.PI/3) {
objects.push(new Vector3D(400+100*Math.cos(j),400+100*Math.sin(j),10));
}//objects.push(new Vector3D(300,400,10),new Vector3D(500,400,10));
//for(var p1=0;p1<800;p1+=50) for(var p2=0;p2<800;p2+=50) particles.push(new Array(new Point(p1,p2),new Point(0,0),true));
function update(p:Array, i:int, v:Array):void {
graphics.moveTo(p[0].x,p[0].y);
for each (var o:Vector3D in objects) {
var ang:Number=Math.atan2(p[0].y-o.y,p[0].x-o.x);
var dis:Number=Point.distance(p[0],new Point(o.x,o.y));
if (dis<o.z*.1) {
p[2]=false;
}
p[1] = p[1].add(new Point(o.z*Math.cos(ang)/(dis*dis/10),o.z*Math.sin(ang)/(dis*dis/10)));
}
if (p[1].length>10||p[0].x>800||p[0].x<0||p[0].y>800||p[0].y<0) {
p[2]=false;
}
p[0]=p[0].subtract(p[1]);
if (p[2]!=false) {
graphics.lineTo(p[0].x,p[0].y);
}
}
stage.addEventListener(MouseEvent.MOUSE_DOWN,function(event:MouseEvent) {;
objects.push(new Vector3D(event.stageX,event.stageY,0)); });
stage.addEventListener(MouseEvent.MOUSE_UP ,function(event:MouseEvent) {;
objects[objects.length-1].z = Point.distance(new Point(event.stageX,event.stageY),new Point(objects[objects.length-1].x,objects[objects.length-1].y)); });
addEventListener("enterFrame",function() {;
graphics.clear();
graphics.lineStyle(1,uint("0xffffff"));
for each(var o:Vector3D in objects) graphics.drawCircle(o.x,o.y,.25*o.z);
for(var i:uint=particles.length; i<1000; i=particles.length) particles.push(new Array(new Point(Math.random()*700+50,Math.random()*700+50),new Point(0,0),true));
particles.forEach(update);
particles = particles.filter(function(p:Array, i:int, v:Array) {return p[2];}); });
// 25 lines ends here![/code] 在确强大啊 确实强大 楼主传个原文件给学习下,代码复制后出现报错。
1084: 语法错误: identifier 应在 lessthan 之前。 实在强大!这些代码是用在什么版本上的? 三个源文件...用的CS4版本... CS3里也是AS3,为什么会报错?而在CS4里却正常!不理解。 谢谢楼主 [quote]CS3里也是AS3,为什么会报错?而在CS4里却正常!不理解。
[size=2][color=#999999]sunshijiu 发表于 2009-5-21 21:03[/color] [url=http://bbs.jcwcn.com/redirect.php?goto=findpost&pid=5427609&ptid=246865][img]http://bbs.jcwcn.com/images/common/back.gif[/img][/url][/size][/quote]
难道说CS4用的AS3与CS3有所不同,我在CS3上试了几次都报错,向楼主要了原文件复制代码到CS3上还是报错。 不知道哦...我电脑上没装CS3...没试过.... 好强大的代码 [b] [url=http://bbs.jcwcn.com/redirect.php?goto=findpost&pid=5427123&ptid=246865]1#[/url] [i]hanxingdd[/i] [/b]
jc:qiang 悍 代码很强大. jc:yun好强喔,视觉效果真好~ 狂顶 真是太厉害了! 好強的as 厉害呀!{:1_176:} 楼主 太强大了 额...............
页:
[1]
