⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 splayer.java

📁 Source code of J2ME game called Action Soccer. Great for used. Already configurations with JBuilder
💻 JAVA
字号:
package com.soccer;

import com.nokia.mid.sound.Sound;
import java.io.InputStream;

public class SPlayer {

  public SPlayer() {
  }

  public static void play(int i) {
    try {
      if (sound[i] != null) {
        sound[i].play(1);
      }
    } catch (Exception exception) {}
  }

  private static final String files[] = {
      "/mclick.wav", "/kick.wav", "/goal.wav"
  };
  private static Sound sound[];

  static {
    byte abyte0[] = new byte[10000];
    sound = new Sound[files.length];
    for (int i = 0; i < files.length; i++) {
      try {
        int j = GameMidlet.midlet.getClass().getResourceAsStream(files[i]).read(
            abyte0);
        byte abyte1[] = new byte[j];
        System.arraycopy(abyte0, 0, abyte1, 0, j);
        sound[i] = new Sound(abyte1, 5);
      } catch (Exception exception) {
        sound[i] = null;
      }
    }

    abyte0 = null;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -