| |||||||
Du magst keine Werbung? Wir auch nicht!
Einfach registrieren und die Werbung ist weg. Diese Nachricht sehen nur nicht registrierte Nutzer.
![]() |
| | LinkBack | Themen-Optionen | Ansicht |
| | #1 (permalink) |
| Neuer User Registriert seit: May 2006
Beiträge: 23
|
Moin, ich hab gerade ne Pixel Explosion geschrieben... soll heißen dass sich Kästchen von der Mitte der Stage nach aussen bewegen und dabei größer werden... soweit so gut... momentan wird die ganze Bewegung aller kreise über ein onEnterframe Prozedur gesteuert.... Das Problem ist das die Bewegung manchmal ganz schön ins stottern kommt ... ich hoffe ihr habt nen tipp wie ich die Bewegung flüssiger bekomme. Danke Unbenannt AS: function pixelBG(){ // INIT PIXEL BG _root.pixelBGArr = new Array(); StageW = Stage.width; StageH = Stage.height; pixelBGSpeed = 3; pixelBGSpeedVar = 15; rsizeVar = 40; pixelSize = 60; d=0; //INIT END for(sw=0;sw<StageW/pixelSize;sw++){ for(sh=0;sh<StageH/pixelSize;sh++){ _root.maskBG.attachMovie("pixelBGMC","pixelBGMC"+d ,d); _root.maskBG["pixelBGMC"+d]._x = StageW/2; _root.maskBG["pixelBGMC"+d]._y = StageH/2; _root.maskBG["pixelBGMC"+d]._xscale = 1; _root.maskBG["pixelBGMC"+d]._yscale = 1; _root.pixelBGArr.push({mcName: "pixelBGMC"+d, xziel:sw*pixelSize, yziel: sh*pixelSize, rsize: random(rsizeVar)+100, speed: random(pixelBGSpeedVar)+pixelBGSpeed, ok: false}) d++ } } _root.maskBG.onEnterFrame = function(){ cok = 0; for(i=0;i<_root.pixelBGArr.length;i++){ xok = false; yok = false; _root.maskBG[_root.pixelBGArr[i].mcName]._x += (_root.pixelBGArr[i].xziel - _root.maskBG[_root.pixelBGArr[i].mcName]._x)/_root.pixelBGArr[i].speed; _root.maskBG[_root.pixelBGArr[i].mcName]._y += (_root.pixelBGArr[i].yziel - _root.maskBG[_root.pixelBGArr[i].mcName]._y)/_root.pixelBGArr[i].speed; _root.maskBG[_root.pixelBGArr[i].mcName]._xscale += (_root.pixelBGArr[i].rsize - _root.maskBG[_root.pixelBGArr[i].mcName]._xscale)/_root.pixelBGArr[i].speed; _root.maskBG[_root.pixelBGArr[i].mcName]._yscale += (_root.pixelBGArr[i].rsize - _root.maskBG[_root.pixelBGArr[i].mcName]._yscale)/_root.pixelBGArr[i].speed; if(_root.pixelBGArr[i].xziel >= StageW/2){ if(Math.round(_root.maskBG[_root.pixelBGArr[i].mcName]._x) <= _root.pixelBGArr[i].xziel){ xok=true }; } else{ if(Math.round(_root.maskBG[_root.pixelBGArr[i].mcName]._x) <= _root.pixelBGArr[i].xziel){ xok=true } } if(_root.pixelBGArr[i].yziel >= StageW/2){ if(Math.round(_root.maskBG[_root.pixelBGArr[i].mcName]._y) <= _root.pixelBGArr[i].yziel){ yok=true }; } else{ if(Math.round(_root.maskBG[_root.pixelBGArr[i].mcName]._y) <= _root.pixelBGArr[i].yziel){ yok=true }; } if(xok==true && yok==true){ cok++ trace("COK: "+cok); trace("ARR LENGTH: "+_root.pixelBGArr.length); } if(cok==_root.pixelBGArr.length){ trace("KILL ON ENTER FRAME"); _root["bg"+_root.numOfNewBG].setMask(null); for(i=0;i<_root.pixelBGArr.length;i++){ removeMovieClip(_root.maskBG[_root.pixelBGArr[i].mcName]); } delete _root.pixelBGArr; delete _root.maskBG.onEnterFrame; } } } } |
| | |
| | #2 (permalink) |
| Flashbitch Registriert seit: Oct 2003 Ort: Hannover
Beiträge: 279
|
liegt es wahrscheinlich an deinem mörder array das du on enterframe durchratterst ...
__________________ Fuchtelworld |
| | |
![]() |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
| |