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

📄 nokiagameeffects.java

📁 j2me游戏代码
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 

import com.nokia.mid.sound.Sound;
import com.nokia.mid.sound.SoundListener;
import com.nokia.mid.ui.DeviceControl;

class NokiaGameEffects
    implements SoundListener
{

    private volatile boolean isPaused;
    private volatile int state;
    private Sound sound;
    private volatile int currentSoundPriority;
    GameMain gameMain;
    String s1;
    String s2;
    String s3;
    String s4;
    String s5;
    String s6;
    String s7;
    String s8;
    String s9;
    String s10;
    String s11;
    String s12;
    String s13;
    String s14;
    String title2;
    String title;

    NokiaGameEffects(GameMain gamemain)
    {
        isPaused = true;
        state = 1;
        sound = null;
        currentSoundPriority = 0;
        s1 = "024A3A59150CB5391550040009205605606E0A348000";
        s2 = "024A3A59150CB539155004000B24830C2502D000";
        s3 = "024A3A59150CB539155004001320A2D027029023025049580000";
        s4 = "024A3A59150CB539155004000D20838824AC0D45116800";
        s5 = "024A3A59150CB53915500400171CA2312144344B230D0000";
        s6 = "024A3A59150CB539155004000B20728A2B131000";
        s7 = "024A3A59150CB539155004000B1C5A04E0836D00";
        s8 = "024A3A59150CB539155004000D1C5A06E0A29030D000";
        s9 = "024A3A59150CB539155004000F1CA27049C81881268000";
        s10 = "024A3A59150CB539155004000F205E06E0A25049780000";
        s11 = "024A3A59150CB539155004001B1CA27423421049889AA288C0C20000";
        s12 = "024A3A804041330DB6A2702B427023049A8800";
        s13 = "024A3A804001924DB66285A856AA2B4274236214591A28E50000";
        s14 = "024A3A804001B20DB6A2B02D149681880000";
        title2 = "024A3A59150CB53915502400FF20718A22C20C26C22C49C428AB0B30830C30830B30AA12718A22C20C26C20C22C49C41A480";
        title = "024A3A59150CB539155004001318A2B02F032C38C36C2EC32800";
        gameMain = gamemain;
    }

    private byte[] byteMake(String s)
    {
        byte abyte0[] = new byte[s.length() / 2];
        for(int i = 0; i < s.length(); i += 2)
        {
            char c = s.charAt(i + 1);
            int j;
            if(c >= '0' && c <= '9')
                j = c - 48;
            else
                j = (c - 65) + 10;
            c = s.charAt(i);
            if(c >= '0' && c <= '9')
                j += (c - 48) * 16;
            else
                j += ((c - 65) + 10) * 16;
            abyte0[i / 2] = (byte)j;
        }

        return abyte0;
    }

    public void soundStateChanged(Sound sound1, int i)
    {
        if(sound1 == sound && i == 1)
        {
            setState(1);
            currentSoundPriority = 0;
        }
    }

    private synchronized void setState(int i)
    {
        state = i;
    }

    private synchronized void setIsPaused(boolean flag)
    {
        isPaused = flag;
    }

    void pause()
    {
        setIsPaused(true);
        if(sound != null)
            sound.stop();
        DeviceControl.stopVibra();
    }

    void resume()
    {
        setIsPaused(false);
    }

    private void playSound(int i, byte abyte0[])
    {
        if(gameMain.soundFlag && i > currentSoundPriority)
            try
            {
                if(sound == null)
                {
                    sound = new Sound(abyte0, 1);
                    sound.setSoundListener(this);
                }
                sound.stop();
                sound.init(abyte0, 1);
                sound.play(1);
                setState(0);
                currentSoundPriority = i;
            }
            catch(Exception exception)
            {
                setState(1);
                currentSoundPriority = 0;
            }
    }

    void eachSound(int i)
    {
        switch(i)
        {
        case 0: // '\0'
            playSound(4 + i, byteMake(s1));
            break;

        case 1: // '\001'
            playSound(4 + i, byteMake(s2));
            break;

        case 2: // '\002'
            playSound(4 + i, byteMake(s3));
            break;

        case 3: // '\003'
            playSound(4 + i, byteMake(s4));
            break;

        case 4: // '\004'
            playSound(4 + i, byteMake(s5));
            break;

        case 5: // '\005'
            playSound(4 + i, byteMake(s6));
            break;

        case 6: // '\006'
            playSound(4 + i, byteMake(s7));
            break;

        case 7: // '\007'
            playSound(4 + i, byteMake(s8));
            break;

        case 8: // '\b'
            playSound(4 + i, byteMake(s9));
            break;

        case 9: // '\t'
            playSound(4 + i, byteMake(s10));
            break;

        case 10: // '\n'
            playSound(4 + i, byteMake(s11));
            break;

        case 11: // '\013'
            playSound(4 + i, byteMake(s12));
            break;

        case 12: // '\f'
            playSound(4 + i, byteMake(s13));
            break;

        case 13: // '\r'
            playSound(4 + i, byteMake(s14));
            break;

        case 14: // '\016'
            playSound(4 + i, byteMake(title));
            break;
        }
    }

    void vibrate()
    {
        try
        {
            DeviceControl.startVibra(100, 200L);
        }
        catch(Exception exception) { }
    }

    void flashLights()
    {
        DeviceControl.flashLights(250L);
    }
}

⌨️ 快捷键说明

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