home *** CD-ROM | disk | FTP | other *** search
/ ring.yamanashi.ac.jp/pub/pc/freem/action/ / action.zip / baku100.zip / baku100 / Kernel / SpriteChar.tonyu < prev    next >
Text File  |  2002-05-10  |  768b  |  44 lines

  1. extends PlainChar;
  2.  
  3. //native _changeAttr;
  4. //native _inspect;
  5. //native _dynamicInspect;
  6.  
  7. function assignChar() {
  8.    $_Char_seq+=1;
  9.    return ((($_Char_seq-1) % 13)+3);
  10. }
  11.  
  12. function setDefaultProperties(xx,yy) {
  13.    super.setDefaultProperties(xx,yy);
  14.    p=assignChar();
  15.    changeAttr("p",p);
  16. }
  17.  
  18.  
  19. constructor SpriteChar(xx,yy,pp,ff){
  20.  super(xx,yy);
  21.  p=pp;
  22.  f=ff;
  23. }
  24.  
  25. function getWidth() {
  26.   var r;r=native_getPWidth(p);
  27.   if (r>24) return r*0.8;
  28.   return r*0.66;
  29. }
  30. function getHeight() {
  31.   var r;r=native_getPHeight(p);
  32.   if (r>24) return r*0.8;
  33.   return r*0.66;
  34. }
  35.  
  36. function draw() {
  37.     drawSprite(x,y,p,f,zOrder);
  38.     super.draw();
  39. }
  40.  
  41. function newAnimation() {
  42.    return appear(new AnimationAdaptor(this));
  43. }
  44. while(1) {update();}