home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ring.yamanashi.ac.jp/pub/pc/freem/action/
/
action.zip
/
henkyaku1.0.exe
/
henkyaku
/
Program
/
Kernel
/
Util
/
AnimationAdaptor.tonyu
< prev
next >
Wrap
Text File
|
2002-12-23
|
2KB
|
83 lines
extends PlainChar;
/*resvFé¬éóéΘù¥ùR:
an.loop(10,11,2);
an.loop(12,13,2);
an.loop(10,11,2);
é▒éΩé≡ô»é╢âtâîü[âÇé┼Ä└ìsé╡é╜é╞é½üA10-11é╠âAâjâüü[âVâçâôé╠âèâZâbâgé≡ûhé«
*/
constructor AnimationAdaptor(t) {
target=t;
mode=3;
spd=3;
}
function play(ff,tt,s) {
resvF=ff;resvT=tt;resvM=0;
paused=0;
if (s) spd=s;
}
function loop(ff,tt,s) {
resvF=ff;resvT=tt;resvM=1;
paused=0;
if (s) spd=s;
}
function swing(ff,tt,s) {
resvF=ff;resvT=tt;resvM=2;
paused=0;
if (s) spd=s;
}
function update3() {
if (target.isDead()) die();
update();
if (f==resvF) return 0;
f=resvF;t=resvT;mode=resvM;
if (mode!=3 && resvF>=0) target.p=f;
return 1;
}
function stop() {
f=-1;resvF=-2;
resvM=3;
}
function update2(wt) {
while (wt>0) {
if (update3()) return 1;
if (!paused) wt--;
}
return 0;
}
function pause() {
paused=1;
}
function resume() {
paused=0;
}
while (mode>=0) {
while (mode==0) { // play
if (update2(spd)) break;
target.p++;
if (target.p>=t) stop();
}
while (mode==1) { // loop
if (update2(spd)) break;
target.p++;
//print(target.p+"//"+target+"//"+f+"-"+t);
if (target.p>t) target.p=f;
}
while (mode==2) { // swing
if (update2(spd)) break;
if (target.p>=t) swv=-1;
if (target.p<=f) swv=1;
target.p+=swv;
}
while (mode==3) {
if (update3()) break;
}
// print(mode+"<>"+target.p+"/-/"+target+"//"+f+"-"+t);
}