| |||||||
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) |
| Ein_zelle Registriert seit: Jul 2001 Ort: bochum
Beiträge: 214
| im bogen ticken
hallo, ich habe ein script welches eine kugel immer wieder aufticken lässt. berührt sie den "boden" tickt sie senkrecht wieder in die höhe - ich möchte aber eigentlich - das sie in einem bogen nach rechts tickt, und wenn sie dort auftickt wieder in einem bogen nach links zurück... geht das - wenn wie? MovieClip.prototype.upDown = function(pOben, pUnten, pY, pGravitation) { this.vektor = pY; this.gravitation = pGravitation; this.onEnterFrame = function() { this._y -= this.vektor; if (this._y <= pOben) { this._y = pOben; this.vektor *= -1; this.vektor1 *= -1; } else if (this._y >= pUnten) { this._y = pUnten; } this.vektor *= .96; this.vektor -= this.gravitation; }; }; kugel_mc.upDown(200, 400, 20, 2); ??? _drek
__________________ EndoplasmatischesReticulum www.coded.de |
| | |
| | #3 (permalink) |
| . Registriert seit: May 2003 Ort: bayern
Beiträge: 1.117
|
so in etwa? var ySpeed = 10; var xSpeed = 5; var top = 0+ball._height/2; var bottom = 400-ball._height/2; var left = 0+ball._width/2; var right = 200-ball._width/2; MovieClip.prototype.upDown = function(pY,pX, pGravitation) { this.vektor = pY; this.gravitation = pGravitation; this.onEnterFrame = function() { oldY = this._y; this._y -= this.vektor; this._x += pX; if (this._y <= top) { this._y = top; this.vektor *= -1; } else if (this._y >= bottom) { this._y = bottom; this.vektor *= -1; } if (this._x <= left) { this._x = left; pX *= -1; } else if (this._x >= right) { this._x = right; pX *= -1; } this.vektor *= .97;//.96; pX *= .97; this.vektor -= this.gravitation; //onEnterFrame wird gelöscht //wenn _y wert sich 5* hintereinander //nicht geändert hat if(this._y == oldY)count++; else count = 0; if(count>5){ this.onEnterFrame = null; count = 0; } // }; }; ball.upDown(ySpeed,xSpeed, 2); greetings aus sonnigem bayern |
| | |
![]() |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
| |