home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ring.yamanashi.ac.jp/pub/pc/freem/action/
/
action.zip
/
henkyaku1.0.exe
/
henkyaku
/
Program
/
Kernel
/
Lib
/
Satellite.tonyu
< prev
next >
Wrap
Text File
|
2002-05-02
|
1KB
|
58 lines
extends Library;
native _n_getPatColor;
function getPatColor(p) {
return _n_getPatColor (_body,p);
}
native _n_pset;
function pset(x,y,c) {
return _n_pset (_body,x,y,c);
}
function setScale(wx,wy,scx,scy) {
this.wx =wx;
this.wy =wy;
this.scx =scx;
this.scy =scy;
}
function refresh(y,w) {
var x,p;
x=0;
if (! $map) return;
while (w>0) {
p=$map.getAt(wx+x*scx, wy+y*scy);
pset(x,y,getPatColor(p));
w-=1;
x+=1;
}
}
function refreshCharPos() {
var o;
if (!$chars || $chars.size()==0) return;
if (charsC>=$chars.size()) { charsC=0;}
if (rnd(2)==0) col=255-col;
o=$chars.get(charsC);
pset((o.x-wx)/scx,(o.y-wy)/scy,color(col,col,col));
charsC+=1;
}
function refreshEx(wx,wy,scx,scy,fy,ty,w) {
setScale(wx,wy,scx,scy);
while (fy<ty) {
refresh(fy,w);
fy+=1;
refreshCharPos();
}
}
constructor Satellite(){
charsC=0;
col=0;
}
function onLoadPage() {
$satellite=new Satellite();
}