Stairs.java
上传用户:qinghua
上传日期:2022-06-06
资源大小:523k
文件大小:1k
源码类别:

J2ME

开发平台:

Java

  1. import javax.microedition.midlet.*;
  2. import javax.microedition.lcdui.*;
  3. class Stairs{
  4. public int stairpanxright,stairpanxleft;
  5. int updw;
  6. Stairs(int panxright,int panxleft,int updw){
  7. stairpanxleft = panxleft;
  8. this.updw = updw;
  9. stairpanxright = panxright;
  10. }
  11. public void drawStair(Graphics g,int strx,int stry)   
  12.     {   
  13.              
  14.      if(updw == 1 ){
  15.              for(int i=0;i<4;i++)
  16.                    g.drawImage(HauntedCastle.miStairup,strx+HauntedCastle.panx+(i*25),stry-(i*23),Graphics.TOP|Graphics.LEFT); 
  17.             }                                     
  18.             if (updw == 2)
  19.             {
  20.              for(int i=0;i<4;i++)
  21.                    g.drawImage(HauntedCastle.miStairdown,strx+HauntedCastle.panx-(i*24),stry-(i*23),Graphics.TOP|Graphics.LEFT); 
  22.             }
  23.     
  24.     }
  25. }