Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 28-09-2003, 09:55   #1 (permalink)
Trainman
 
Benutzerbild von Hamster2k
 
Registriert seit: Sep 2001
Ort: Wien, Österreich
Beiträge: 1.324
FormGenerator [MX] [pure AS]

Ist schon länger her, dass ich das gebastelt hab. Ich finde aber, es sieht nicht schlecht aus. Ist in keiner Weise Performanceoptimiert.
Verbesserungen und Kritik erwünscht
Copy&Paste:
ActionScript:
  1. MovieClip.prototype.polygon = function(ox, oy, r, s) {
  2.     var rad = Math.PI*2, step = rad/s;
  3.     this.moveTo(ox+r, oy);
  4.     while (s--) {
  5.         this.lineTo(ox+r*Math.cos(rad-step*s), oy+r*Math.sin(rad-step*s));
  6.     }
  7. };
  8. Color.random = function() {
  9.     var a = random(0xffffff)+1;
  10.     return "0x"+a.toString(16);
  11. };
  12. MovieClip.prototype.polyShape = function(ox, oy, r, s, c) {
  13.     this.lineStyle(0, 0x000000, 0);
  14.     this.beginFill(c, 100);
  15.     this.polygon(ox, oy, r, s);
  16.     this.polygon(ox, oy, r*0.6, s);
  17.     this.endFill();
  18. };
  19. function randPoly() {
  20.     var mc = this.createEmptyMovieClip("mc"+d, d++), r, angle;
  21.     mc._x = _xmouse;
  22.     mc._y = _ymouse;
  23.     mc.polyShape(0, 0, random(maxR-1)+1, random(maxS-3)+3, Color.random());
  24.     mc.xSpeed = (!(random(2)) ? -1 : 1)*random(maxXSpeed);
  25.     mc.ySpeed = (!(random(2)) ? -1 : 1)*random(maxYSpeed);
  26.     mc.rotSpeed = (!(random(2)) ? -1 : 1)*rotSpeed;
  27.     mc.onEnterFrame = function() {
  28.         if (this._xscale>0) {
  29.             this._xscale -= scaleSpeed;
  30.             this._yscale -= scaleSpeed;
  31.             this._rotation -= this.rotSpeed;
  32.             this._alpha -= scaleSpeed;
  33.             this._x += this.xSpeed;
  34.             this._y += this.ySpeed;
  35.             this.ySpeed += grav;
  36.             this.xSpeed *= reibung;
  37.         } else {
  38.             this.removeMovieClip();
  39.             mcs--;
  40.         }
  41.     };
  42.     mcs++;
  43. }
  44. function init() {
  45.     if (!inited) {
  46.         inited = true;
  47.         scaleSpeed = 3;
  48.         rotSpeed = 6;
  49.         maxS = 6;
  50.         maxR = 50;
  51.         maxXSpeed = 10;
  52.         maxYSpeed = 10;
  53.         grav = 1;
  54.         reibung = 0.9;
  55.         d = mcs=0;
  56.         _quality = "low";
  57.         this.onMouseMove = randPoly;
  58.     }
  59. }
  60. init();
MfG
__________________
So much to learn and so little time.

Ich liebe dieses Forum!!
Hamster2k ist offline   Mit Zitat antworten
Alt 28-09-2003, 10:16   #2 (permalink)
...
 
Registriert seit: Oct 2002
Ort: Nürnberg
Beiträge: 3.611
klasse, gefaellt mir *daumenhoch*
performence is auch kein problem (laptop 550Mhz win xp)
thorben.schmitt ist offline   Mit Zitat antworten
Alt 28-09-2003, 21:24   #3 (permalink)
Steffen G.
 
Benutzerbild von Tschdaeff
 
Registriert seit: Aug 2001
Ort: Ba-Wü
Beiträge: 4.123
jooo sieht echt super aus performance ist auch ok...

super script!!!

cu mfg
Tschdaeff
__________________
mod@
www.flashbattle.de
www.steffen-guse.de
------------------------------------

Tschdaeff ist offline   Mit Zitat antworten
Alt 29-09-2003, 06:52   #4 (permalink)
_//\\#//\\_
 
Benutzerbild von warrantmaster
 
Registriert seit: Jan 2003
Beiträge: 7.060
nice !
warrantmaster ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 12:02 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele