Visualizzazione dei risultati da 1 a 4 su 4

Discussione: Ridurre il codice

  1. #1

    Ridurre il codice

    Ciao ragazzi,
    volevo sapere se questo script che crea l'effetto molla, si poteva ridurre.
    onClipEvent (load) {
    acc = 2;
    iner = 1.5;
    colore = new Color(azienda);
    lunablu._alpha = 0;
    }
    onClipEvent (enterFrame) {
    if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
    colore.setRGB(0x3398C3);
    if (lunablu._alpha<=100) {
    lunablu._alpha += 5;
    }
    finex = 190;
    finey = 190;
    iniziox = this._xscale;
    inizioy = this._yscale;
    velocx = (velocx+(finex-iniziox)/acc)/iner;
    velocy = (velocy+(finex-inizioy)/acc)/iner;
    this._xscale += velocx;
    this._yscale += velocy;
    } else {
    colore.setRGB(0xffffff);
    if (lunablu._alpha>=0) {
    lunablu._alpha -= 5;
    }
    finex = this._xscale;
    finey = this._yscale;
    velocx = (velocx+(finex-100)/acc)/iner;
    velocy = (velocy+(finey-100)/acc)/iner;
    this._xscale -= velocx;
    this._yscale -= velocy;
    }
    }
    ciao

  2. #2
    codice:
    onClipEvent (load) { 
    acc = 2; 
    iner = 1.5; 
    } 
    onClipEvent (enterFrame) { 
    if (this.hitTest(_root._xmouse, _root._ymouse, true)) {  
    finex = 190; 
    finey = 190; 
    iniziox = this._xscale; 
    inizioy = this._yscale; 
    velocx = (velocx+(finex-iniziox)/acc)/iner; 
    velocy = (velocy+(finex-inizioy)/acc)/iner; 
    this._xscale += velocx; 
    this._yscale += velocy; 
    } else {  
    finex = this._xscale; 
    finey = this._yscale; 
    velocx = (velocx+(finex-100)/acc)/iner; 
    velocy = (velocy+(finey-100)/acc)/iner; 
    this._xscale -= velocx; 
    this._yscale -= velocy; 
    } 
    }
    ti piace kosì ?

  3. #3
    Partendo da questo che hai fatto, non si può ridurlo ancora?
    ciao

  4. #4
    codice:
    onClipEvent (load) { 
    acc = 2; 
    iner = 1.5; 
    } 
    onClipEvent (enterFrame) {  
    iniziox = this._xscale; 
    inizioy = this._yscale; 
    velocx = (velocx+(finex-iniziox)/acc)/iner; 
    velocy = (velocy+(finex-inizioy)/acc)/iner; 
    this._xscale += velocx; 
    this._yscale += velocy; 
    }
    onClipEvent (mouseMove) {
    if(this.hitTest(_root._xmouse, _root._ymouse)) {
    finex = 190; 
    finey = 190; 
    }else{
    finex = 100;
    finey = 100;}
    }

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.