Menu

마우스에서 벌레가..

2016. 5. 26. 12:45

안개핑 Swish study

 

 

 

 

마우스로 긁어보세요

 

 

mousetrailer에_들어가는_액션

Fol
--------------------------- onSelfEvent (rollOver) { Follower.startDragLocked(); Follower.dragging = true; Follower.oldx = _X; Follower.oldy = _Y; } onSelfEvent (rollOut) { stopDrag(); Follower.dragging = false; } -------------- Blob --------------- onEnterFrame(includingFirstFrame) { _X += v; v += a; a += aa; _alpha -= dalpha; } -------------- Follower -------------- onLoad () { _parent.BlobMoving.Blob.v = 0; _parent.BlobMoving.Blob.a = 0; _parent.BlobMoving.Blob.aa = 0; _parent.BlobMoving.Blob.dalpha = 0; _parent.BlobMoving.Blob._alpha = 0; _parent.BlobMoving.Blob._visible = false; oldx = 0; oldy = 0; dragging = false; depth = 1; } onEnterFrame(includingFirstFrame) { if (dragging) { if (oldx != 0 && oldy != 0) { dx = Math.abs(_X-oldx)/2; dy = Math.abs(_Y-oldy)/2; if (dx || dy) { dmin = Math.min(dx,dy)+1; dmax = Math.max(dx,dy)+1; while (dmax/dmin < 2) { dmax *= 2; } while (dmax>20) { dmin /= 2; dmax /= 2; } _parent.BlobMoving.duplicateSprite("Blob" add depth,depth); ("../Blob"+depth)._X = _X; ("../Blob"+depth)._Y = _Y; ("../Blob"+depth)._rotation = Math.random()*360; ("../Blob"+depth+"/Blob")._xscale = dmax; ("../Blob"+depth+"/Blob")._yscale = dmin; ("../Blob"+depth+"/Blob")._alpha = 100; ("../Blob"+depth+"/Blob")._visible = true; ("../Blob"+depth+"/Blob").v = 0; ("../Blob"+depth+"/Blob").a = 0; ("../Blob"+depth+"/Blob").aa = 0.1; ("../Blob"+depth+"/Blob").dalpha = 1; depth = depth < 20 ? depth+1 : 1; } } oldx = _X; oldy = _Y; } } ---------------------

.

'Swish study' 카테고리의 다른 글

물방울3  (0) 2016.05.26
mask-slide  (0) 2016.05.26
마우스를 따라다니는 글자  (0) 2016.05.26
마우스를 따라다니는 물고기  (0) 2016.05.26
Random-Motion  (0) 2016.05.26