Home › Forums › Algemene discussies › Het grote: Wat zit er onder CTRL+V Topic
- Dit onderwerp bevat 1,578 reacties, 51 deelnemers, en is laatst geüpdatet op 14 jaren, 2 maanden geleden door Z@3 Redrum..
- AuteurBerichten
- 11/02/2009 22:40 om 22:40 #525194
NecroVisioN English Demo 12/02/2009 16:15 om 16:15 #52519516/02/2009 10:12 om 10:12 #525196package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
import flash.filters.ColorMatrixFilter;
public class BloodEffect extends Sprite
{
private var timer:Timer;
private var fadeTimer:Timer;
private var drops:Array;
private var oldPaths:Array;
private var bmd:BitmapData;
private var bitmap:Bitmap;
private var dropPath:Sprite;
private var fadeColorMatrix:ColorMatrixFilter;
private var dropPathRect:Rectangle = new Rectangle(0, 0, 10, 1024);
private var dropPathPoint:Point = new Point(0, 0);
private var transBD:BitmapData = new BitmapData(10, 1024, true, 0x000000);
public function BloodEffect()
{
// define the fading color matrix – reduce Red, subtract Alpha
var matrix:Array = new Array();
matrix = matrix.concat([.96, 0, 0, 0, 0]);
matrix = matrix.concat([0, 1, 0, 0, 0]);
matrix = matrix.concat([0, 0, 1, 0, 0]);
matrix = matrix.concat([0, 0, 0, 1, -5]);
fadeColorMatrix = new ColorMatrixFilter(matrix);
// init the droplets
drops = new Array();
for (var i:Number = 0; i < 10; i++) { var s:Sprite = new Sprite(); var bd:BitmapData = new BitmapData(10, 1024, true, 0x000000); var b:Bitmap = new Bitmap(bd); drops.push([s, bd, b]); } oldPaths = new Array(); addEventListener(Event.ADDED_TO_STAGE, addedToStage); } public function addedToStage(e:Event):void { // draw the droplet path graphic dropPath = new Sprite(); dropPath.graphics.beginFill(0xAA0000, 0.4) dropPath.graphics.drawCircle(0, 0, 5); dropPath.graphics.endFill(); dropPath.graphics.beginFill(0xFFFFFF, .
; dropPath.graphics.drawCircle(-2, 0, 1.5);
// draw blood droplets
for each (var array:Array in drops)
{
var s:Sprite = array[0] as Sprite;
var bd:BitmapData = array[1] as BitmapData;
var b:Bitmap = array[2] as Bitmap;
s.graphics.beginFill(0xAA0000);
s.graphics.drawCircle(0, 0, 7);
s.graphics.endFill();
s.graphics.beginFill(0xAA0000);
s.graphics.moveTo(-7, 0);
s.graphics.curveTo(-8, -8, -4, -16);
s.graphics.curveTo(0, -20, 4, -16);
s.graphics.curveTo(8, -8, 7, 0);
s.graphics.endFill();
var flare:Sprite = new Sprite();
flare.graphics.beginGradientFill(GradientType.RADIAL, [0xCC0000, 0xCC0000], [1, 0], [0, 15]);
flare.x = -3;
flare.y = -4;
flare.graphics.drawCircle(0, 0,
; flare.graphics.endFill();
s.addChild(flare);
s.x = stage.stageWidth * Math.random();
s.y = -80 * Math.random();
addChild(s);
b.x = s.x – 5;
addChildAt(b, this.getChildIndex(s));
}
// init motion timer – fired every 50ms
timer = new Timer(50);
timer.addEventListener(TimerEvent.TIMER, onTick);
timer.start();
// init fade timer – fired every 1000ms
fadeTimer = new Timer(1000);
fadeTimer.addEventListener(TimerEvent.TIMER, onFadeTick);
fadeTimer.start();
}
public function onTick(e:TimerEvent):void
{
for each (var array:Array in drops)
{
var s:Sprite = array[0] as Sprite;
var bd:BitmapData = array[1] as BitmapData;
// move the droplet down 2px
s.y += 2;
var matrix:Matrix = new Matrix(1, 0, 0, 1, 5, s.y);
// copy the path graphic to this BitmapData obj
bd.draw(dropPath, matrix);
// send the droplet back to the top if its off the screen
if (s.y > stage.stageHeight + 30)
{
s.x = stage.stageWidth * Math.random();
s.y = -80 * Math.random();
makeNewPath(array);
}
}
}
public function makeNewPath(array:Array):void
{
var s:Sprite = array[0] as Sprite;
var bd:BitmapData = array[1] as BitmapData;
var b:Bitmap = array[2] as Bitmap;
// send the drop back to the top layer
setChildIndex(s, numChildren – 1);
// push the path to the ‘old paths’ list
oldPaths.push([bd, b, 0]);
// make a fresh path BitmapData and Bitmap obj
var bd2:BitmapData = new BitmapData(10, 1024, true, 0x000000);
var b2:Bitmap = new Bitmap(bd2);
// replace the old BitmapData and Bitmap objs (path graphics) with the new ones
b2.x = s.x – 5;
addChildAt(b2, this.getChildIndex(s) – 1);
array[1] = bd2;
array[2] = b2;
}
public function onFadeTick(e:TimerEvent):void
{
// apply the color matrix filter
for each (var array:Array in drops)
{
var s:Sprite = array[0] as Sprite;
var bd:BitmapData = array[1] as BitmapData;
bd.applyFilter(bd, dropPathRect, dropPathPoint, fadeColorMatrix);
}
// decay the old paths for some time, and cleanup – super hacky
for (var i:Number = 0; i < oldPaths.length; i++) { var bd2:BitmapData = oldPaths
[0] as BitmapData;var b2:Bitmap = oldPaths
[1] as Bitmap;var t:Number = oldPaths
[2] as Number;if (t > 30)
{
removeChild(b2);
bd2.dispose();
oldPaths.splice(i, 1);
}
else
{
bd2.applyFilter(bd2, dropPathRect, dropPathPoint, fadeColorMatrix);
oldPaths
[2]++;}
}
}
}
}
16/02/2009 10:16 om 10:16 #52519718/02/2009 06:22 om 06:22 #525198Logitech 19/02/2009 22:24 om 22:24 #525199ServerName=Dedifrag.com | [C=80FFFF]x. [C=0000A0]sFx 19/02/2009 22:49 om 22:49 #525200XCMlive 20/02/2009 13:14 om 13:14 #525201TODAY at 13:07 You have been paid!
The amount paid was: $40.80 (minus $0.80 of fees)
20/02/2009 14:04 om 14:04 #525202http://www.evilgamerz.com/screens/buffer.php?pic=12418” target=”_blank”>http://www.evilgamerz.com/screens/buffer.php?pic=12418” width=”160″ height=”100″ border=”0″> 20/02/2009 15:40 om 15:40 #525203Voltrix wrote:TODAY at 13:07
You have been paid!
The amount paid was: $40.80 (minus $0.80 of fees)
welke site? neo vraagt toch geen fees?20/02/2009 15:43 om 15:43 #525204voor paypall wel 21/02/2009 11:51 om 11:51 #525205Guerrilla 21/02/2009 12:07 om 12:07 #525206Niks duss…. Btw Z@3 bij jouw zit er vaak wel iets interessants onder crtl+V (verdacht zelfs soms…)
Houdt het ontopic aub.
21/02/2009 12:53 om 12:53 #52520723/02/2009 10:40 om 10:40 #525208Je laatste score voor de toets is 51,3%. Daarmee voldoe je nog niet aan de eis van 55%. Je zult de toets dus nog een keer moeten herkansen.
- AuteurBerichten
- Je moet ingelogd zijn om een antwoord op dit onderwerp te kunnen geven.