Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 04-07-2005, 13:53   #1 (permalink)
Neuer User
 
Registriert seit: Jun 2005
Beiträge: 7
DRINGEND Hilfe zum Racinggame -Actionscript-

hi leute

bin grad dabei unser Projekt zu dokumentieren (F1^-Racing Game). Nur mein Projektpartner ist im Krankenhaus und ich muss folgenden Actionscriptcode dokumentieren u. vorstellen. Kenn mich da net so aus. Des einzige was ich habe ist folgender Actionscriptcode im MainMovie:

// Action script...

// [Action in Frame 2]
if (_framesloaded < _totalframes)
{
gotoAndPlay(1);
} // end if

// [Action in Frame 3]
function order(a, b)
{
var time1 = Number(a.split(":")[1]);
var time2 = Number(b.split(":")[1]);
if (time1 == 0)
{
time1 = 999;
} // end if
if (time2 == 0)
{
time2 = 999;
} // end if
if (time1 < time2)
{
return(-1);
}
else if (time2 < time1)
{
return(1);
}
else
{
return(0);
} // end if
} // End of the function
function displayQualifying()
{
car1._x = xpos[0];
car1._y = 345;
car2._x = xpos[1];
car2._y = 345;
car3._x = xpos[2];
car3._y = 345;
car4._x = xpos[3];
car4._y = 345;
car1._rotation = 90;
car2._rotation = 90;
car3._rotation = 90;
car4._rotation = 90;
} // End of the function
function displayRace()
{
for (x = 3; x > -1; x--)
{
gpos = thegrid.pop().split(":")[0];
eval("car" + gpos)._x = xpos[x];
eval("car" + gpos)._y = ypos[x];
} // end of for
car1._rotation = 90;
car2._rotation = 90;
car3._rotation = 90;
car4._rotation = 90;
} // End of the function
function destroyCars()
{
_root.car1.removeMovieClip();
_root.car2.removeMovieClip();
_root.car3.removeMovieClip();
_root.car4.removeMovieClip();
} // End of the function
function initDrivers()
{
destroyCars();
if (vspeedguide == 1)
{
driver1 = "s1";
}
else
{
driver1 = "h1";
} // end if
if (vplayers == 2)
{
if (vspeedguide == 1)
{
driver2 = "s2";
}
else
{
driver2 = "h2";
} // end if
}
else
{
driver2 = "ai1";
} // end if
if (vplayers == 2)
{
driver3 = "ai1";
}
else
{
driver3 = "ai2";
} // end if
if (vplayers == 2)
{
drivers = ["Schumi", "Rubens", "Mika", "DC"];
driver4 = "ai3";
}
else
{
drivers = ["Schumi", "Mika", "DC", "Rubens"];
driver4 = "ai4";
} // end if
_root.attachMovie(driver1, "car1", 1);
_root.attachMovie(driver2, "car2", 2);
_root.attachMovie(driver3, "car3", 3);
_root.attachMovie(driver4, "car4", 4);
} // End of the function
function convert(tm)
{
var mns;
var mns2;
var scs;
mns = tm / 60;
mns2 = Math.floor(mns);
scs = (mns - mns2) * 60;
return(mns2 + ":" + String(scs).substr(0, 6));
} // End of the function
function showResults()
{
for (x = 0; x < 4; x++)
{
gdata = thegrid[x].split(":")[1];
gdriver = thegrid[x].split(":")[0];
glap = thegrid[x].split(":")[2];
eval("rs" + (x + 1)) = x + 1 + ". " + drivers[gdriver - 1] + " [" + convert(Number(gdata)) + "] - " + glap + " laps";
} // end of for
} // End of the function

// [Action in Frame 4]
cars = 4;
xpos = [175, 135, 95, 55];
ypos = [335, 355, 335, 355];
vlaps = 10;
vqualifying = 1;
vspeedguide = 2;
vplayers = 1;
destroyCars();
stop();

// [Action in Frame 5]
prevFrame();

// [Action in Frame 6]
initDrivers();
displayQualifying();

// [Action in Frame 22]
starttime = getTimer();

// [Action in Frame 23]
qtime = (getTimer() - starttime) / 1000;
tleft = vqualifying * 60 - qtime;
if (tleft < 0.001000)
{
tleft = 0;
} // end if
tleft = String(tleft) + "000";
timeleft = tleft.substr(0, 6);

// [Action in Frame 24]
if (timeleft != 0)
{
gotoAndPlay(23);
} // end if

// [Action in Frame 25]
thegrid = new Array();
thegrid.push("1:" + car1.fastestlap / 1000 + ":" + car1.lap);
thegrid.push("2:" + car2.fastestlap / 1000 + ":" + car2.lap);
thegrid.push("3:" + car3.fastestlap / 1000 + ":" + car3.lap);
thegrid.push("4:" + car4.fastestlap / 1000 + ":" + car4.lap);
thegrid.sort(order);
showResults();
stop();

// [Action in Frame 26]
initDrivers();
displayRace();
lapsdone = 0;
endrace = 0;
playerlap = "";

// [Action in Frame 42]
starttime = getTimer();

// [Action in Frame 43]
qtime = (getTimer() - starttime) / 1000;
tleft = vqualifying * 30 - qtime;
if (tleft < 0)
{
tleft = 0;
} // end if
timeleft = tleft;

// [Action in Frame 44]
if (endrace < 4)
{
gotoAndPlay(43);
} // end if

// [Action in Frame 45]
thegrid = new Array();
thegrid.push("1:" + car1.racetime / 1000 + ":" + car1.lap);
thegrid.push("2:" + car2.racetime / 1000 + ":" + car2.lap);
thegrid.push("3:" + car3.racetime / 1000 + ":" + car3.lap);
thegrid.push("4:" + car4.racetime / 1000 + ":" + car4.lap);
thegrid.sort(order);
showResults();
stop();

Kann mir einer helfen das zu dokumentieren???? Wäre euch sehr sehr dankbar

Gruss

ENCY
Ency ist offline   Mit Zitat antworten
Alt 04-07-2005, 14:38   #2 (permalink)
helpQLODhelp
 
Benutzerbild von bokel
 
Registriert seit: Feb 2002
Ort: Köln
Beiträge: 8.505
LOL, das ist ja noch Flash 4. Da hättet ihr aber schon genung Zeit gehabt, das mal zu kommentieren Die vorhandenen Kommentare sehen irgendwie nach Decompiler aus, die Fla habt ihr wohl auch nicht mehr, oder?

mfg r.
bokel ist offline   Mit Zitat antworten
Alt 04-07-2005, 15:02   #3 (permalink)
Neuer User
 
Registriert seit: Jun 2005
Beiträge: 7
doch doch...haben halt ne fla erhalten und sollen diese nun dokumentieren....und es als vorlage für ein neues spiel benutzen

fla hier :http://service.gmx.net/mc/6ylXBLHVul...Hp9hnNcDFZGdQT
f1.fla
Ency 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 04:19 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele