[ascoders] Re: AW: Re: "perfekte" bewegung

  • From: Volker Kreß <kress@xxxxxxxxxx>
  • To: ascoders@xxxxxxxxxxxxx
  • Date: Thu, 11 Sep 2003 13:50:08 +0200

wo ist denn das Problem?
volker

Am Donnerstag, 11.09.03 um 13:02 Uhr schrieb MaKru:

Hallo,

Kann mir evtuell jemand ein kurzes Beispiel zur Anwendung des Scripts von
Volker geben? Ich bekomme es nicht zum laufen....


Gruss
Mathias
----- Original Message -----
From: "Volker Kreß" <kress@xxxxxxxxxx>
To: <ascoders@xxxxxxxxxxxxx>
Sent: Thursday, July 17, 2003 5:25 PM
Subject: [ascoders] Re: AW: Re: "perfekte" bewegung


Als loops kannste dann eigene schreiben oder z.b die von robert penner
etc nehmen

Am Donnerstag, 17.07.03 um 16:34 Uhr schrieb Jursa, Jan (init):

Wow.
Vielen Dank.
Schaue ich mir gleich an.
Grüsse,
jan



-----Ursprüngliche Nachricht-----
Von: Volker Kreß [mailto:kress@xxxxxxxxxx]
Gesendet: Donnerstag, 17. Juli 2003 15:49
An: ascoders@xxxxxxxxxxxxx
Betreff: [ascoders] Re: "perfekte" bewegung



LoopObjs = {};

  AddLoopObj = function  (obj) {
  _root.LoopObjs[obj] = obj;
     };

MovieClip.prototype.LoopObj = function  (Func, funcArgm) {
         if (this.lo_Action != true) {
this.____count = 0;
             _root.addLoopObj(this);
            this.FuncArray = new Array ();
            this.ArgmArray = new Array ();
            this.ArgmArray[this.____count] = funcArgm;
            this.FuncArray[this.____count] = this.Func;
            this.Func = _root[Func];

            this.funcArgm = funcArgm;
            this.lo_Action = true;
            this.vorhanden = true
         } else {
this.____count++
             this.funcArray[this.____count] = _root[Func];
             this.ArgmArray[this.____count] = funcArgm;
               }
     };

MovieClip.prototype.killLoop = function () {


if (this.____count == 0) { delete _root.LoopObjs[this]; delete this.funcArgm; delete this.Func; //this.FuncArray = null delete this.FuncArray; // this.ArgmArray = null delete this.ArgmArray; delete this.____count; this.lo_Action = false;


} else { this.ArgmArray.shift(); this.FuncArray.shift(); this.Func = this.funcArray[0]; this.funcArgm = this.ArgmArray[0];

this.____count--
          }
     }
MovieClip.prototype.killAllLoops = function(){
this.killLoop(this)
this.____count = 0
}
MovieClip.prototype.ArgmSplit = function  (Argm) {
        var Argm = Argm.split(",");

         return (Argm);
     }


FrameLoopObj = function () {


         for  (My_obj in LoopObjs) {
         LoopObjs[My_obj].Func(LoopObjs[My_obj].funcArgm);
         if (! LoopObjs[My_obj].vorhanden) delete
loopObjs[my_obj]

         }
     }




MoveTo = function (funcArgm) {


// _x,_y,speed

         var x = funcArgm[0];
         var y = funcArgm[1];
         var delta = funcArgm[2];
         var distX = x - this._x;
         var distY = y - this._y;

         var dist = Math.sqrt((distX * distX) + (distY * distY));
         if (delta < dist) {
             var dx = (distX / dist) * delta;
             var dy = (distY / dist) * delta;
         } else {
             var dx = distX;
             var dy = distY;
             this.killLoop(this)

          }
         this._x  = (this._x + dx);
         this._y  = (this._y + dy);

}


this.createEmptyMovieClip("looper",-1000); looper.onEnterFrame = this.FrameLoopObj();


// is zwar schon ein paar Jahre alt aber damit mache ich immer noch alle Bewegungen


Volker



Am Donnerstag, 17.07.03 um 15:37 Uhr schrieb Jursa, Jan (init):


Hi leute,

jedesmal wenn ich eine zB. horizontale Bewegung scripte, ärger ich
mich über
das unbefriedigende ergebnis:

irgendwie ist die bewegung nicht wirklich "flüssig". Ab und an sind
ganz
seltsame Ruckler drinn (in Abhängigkeit des Rechners auf dem ich
teste)...es
ist einfach NIE PERFEKT ;-)

egal ob ich es so versuche:

function moveTest() {
test_mc._x-=.5;
}
this.onEnterFrame=moveTest;

oder diese richtung gehe

function moveTest() {
test_mc._x++;
}
var intervalTest = setInterval(moveTest, 10);


was habt ihr für lösungen die wirklich guuuut mooooven ?


grüsse,
jan


------------------------------------------------------ Archiv : //www.freelists.org/archives/ascoders/ Optionen : //www.freelists.org/list/ascoders ------------------------------------------------------

------------------------------------------------------ Archiv : //www.freelists.org/archives/ascoders/ Optionen : //www.freelists.org/list/ascoders ------------------------------------------------------ ------------------------------------------------------ Archiv : //www.freelists.org/archives/ascoders/ Optionen : //www.freelists.org/list/ascoders ------------------------------------------------------

------------------------------------------------------ Archiv : //www.freelists.org/archives/ascoders/ Optionen : //www.freelists.org/list/ascoders ------------------------------------------------------


------------------------------------------------------ Archiv : //www.freelists.org/archives/ascoders/ Optionen : //www.freelists.org/list/ascoders ------------------------------------------------------

Mit freundlichen Grüßen aus Wuppertal

Volker Kreß

/------------------------------------------------
uscreen gmbh
Volker Kreß
Tel. 0202.244988-20
Fax. 0202.244988-11
www.uscreen.de
kress@uscreen

/-----------------------------------------------
/ T E S T E N  S I E  S I T E F R U I T
/------------------------------------------------
http://asp.siteFruit.net
Login: demo
Passwort: demo
-----------------------------------------------/

------------------------------------------------------
Archiv   : //www.freelists.org/archives/ascoders/
Optionen : //www.freelists.org/list/ascoders
------------------------------------------------------

Other related posts: