📄 logo.java
字号:
/*GameName:老虎机modfiy date:05-10-25author:关文柏*/import javax.microedition.lcdui.*;public class Logo extends Canvas implements Runnable//{ Main main;// Main instance public volatile Thread thd;//a Thread //public Image f; private int HI; private int WD; public int ff; int gametime; boolean flag; Image tianben; Image yidong; Image hudson; public Logo(Main main) { try { this.main = main; HI = 160;//getHeight(); WD = 128;//getWidth(); ff = 1; gametime = 0; flag=true; //f = Image.createImage("/logo.png"); tianben = Image.createImage("/tianben.png"); yidong = Image.createImage("/yidong.png"); hudson = Image.createImage("/hudson.png"); setFullScreenMode(true);//full screen a(); } catch(Exception e) { e.printStackTrace(); } } public void a() { thd = new Thread(this); thd.start();//start this thread } public void run() { while(flag) { try { gametime++;//control the picture to show use a time's variable repaint(); serviceRepaints(); Thread.sleep(50); } catch(Exception e) { e.printStackTrace(); } } } public void paint(Graphics g1) { switch(ff) { case 1: g1.setColor(0xffffff); g1.fillRect(0, 0, WD, HI); g1.drawImage(yidong, (WD - yidong.getWidth()) / 2, (HI - yidong.getHeight()) / 2, 0); if(gametime > 15) { ff=2; //gametime = 0; } break; case 2: g1.setColor(0xffffff); g1.fillRect(0, 0, WD, HI); g1.drawImage(tianben, (WD - tianben.getWidth()) / 2, (HI - tianben.getHeight()) / 2, 0); if(gametime > 20) { ff=3; gametime = 0; } break; case 3: g1.setColor(0xffffff); g1.fillRect(0, 0, WD, HI); g1.drawImage(hudson, (WD - hudson.getWidth()) / 2, (HI - hudson.getHeight()) / 2, 0); if(gametime > 20) { ff=4; gametime = 0; } break; default: tianben = null; yidong = null; hudson = null; flag=false; System.gc(); main.mc = new MyCanvas(main); Display.getDisplay(main).setCurrent(main.mc); thd=null; break; } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -