Ciao ho questo prototipo per il moto elastico
Ora sapendo che la formula del moto decellerato ècodice:MovieClip.prototype.elastic = function(x, y, acc, inrz) { var spostamento_x = 0; var spostamento_y = 0; var checkpos = Array(); var remember = 1; this.onEnterFrame = function() { spostamento_x = (spostamento_x + (x - this._x) /acc) / inrz; spostamento_y = (spostamento_y + (y - this._y) / acc) / inrz; this._x += spostamento_x; this._y += spostamento_y; if( checkpos[remember-1] == (this._x+this._y) ) { remember = 1; delete this.onEnterFrame; } else { checkpos[remember] = (this._x+this._y); remember++; } } }
Qualcuno sarebbe in grado di convertirmi il prototype sopra per il moto decellerato?codice:spostamento = (fine - inizio)/frame


Rispondi quotando
