亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? nokiagameeffects.java

?? J2ME MIDP_Example_Applications
?? JAVA
字號:
// Copyright 2003 Nokia Corporation.
//
// THIS SOURCE CODE IS PROVIDED 'AS IS', WITH NO WARRANTIES WHATSOEVER,
// EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY, FITNESS
// FOR ANY PARTICULAR PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE
// OR TRADE PRACTICE, RELATING TO THE SOURCE CODE OR ANY WARRANTY OTHERWISE
// ARISING OUT OF ANY PROPOSAL, SPECIFICATION, OR SAMPLE AND WITH NO
// OBLIGATION OF NOKIA TO PROVIDE THE LICENSEE WITH ANY MAINTENANCE OR
// SUPPORT. FURTHERMORE, NOKIA MAKES NO WARRANTY THAT EXERCISE OF THE
// RIGHTS GRANTED HEREUNDER DOES NOT INFRINGE OR MAY NOT CAUSE INFRINGEMENT
// OF ANY PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OWNED OR CONTROLLED
// BY THIRD PARTIES
//
// Furthermore, information provided in this source code is preliminary,
// and may be changed substantially prior to final release. Nokia Corporation
// retains the right to make changes to this source code at
// any time, without notice. This source code is provided for informational
// purposes only.
//
// Nokia and Nokia Connecting People are registered trademarks of Nokia
// Corporation.
// Java and all Java-based marks are trademarks or registered trademarks of
// Sun Microsystems, Inc.
// Other product and company names mentioned herein may be trademarks or
// trade names of their respective owners.
//
// A non-exclusive, non-transferable, worldwide, limited license is hereby
// granted to the Licensee to download, print, reproduce and modify the
// source code. The licensee has the right to market, sell, distribute and
// make available the source code in original or modified form only when
// incorporated into the programs developed by the Licensee. No other
// license, express or implied, by estoppel or otherwise, to any other
// intellectual property rights is granted herein.


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


// Nokia GameEffects provides a 'Nokia device specific' implementation
// of game effects such as vibration, flashing lights and
// playing game sounds.

class NokiaGameEffects
    extends GameEffects
{
    private volatile boolean isPaused = true;
    private Sound sound = null;
    private volatile int currentPriority = 0;

    // The sound byte arrays are in 'Smart Messaging' ringing tone format.

    // Bullet 'ringing tone' sound effect
    private final static byte[] BULLET_SOUND_BYTES =
    {
        (byte)0x02, (byte)0x4A, (byte)0x3A, (byte)0x80,
        (byte)0x40, (byte)0x00, (byte)0xF3, (byte)0x48,
        (byte)0x22, (byte)0xC3, (byte)0x4C, (byte)0x35,
        (byte)0x02, (byte)0xAC, (byte)0x22, (byte)0xC0,
        (byte)0x00
    };

    // Base explosion 'ringing tone' sound effect
    private final static byte[] BASE_EXPLODE_SOUND_BYTES =
    {
        (byte)0x02, (byte)0x4A, (byte)0x3A, (byte)0x80,
        (byte)0x40, (byte)0x01, (byte)0x52, (byte)0x48,
        (byte)0x2D, (byte)0x02, (byte)0x71, (byte)0x49,
        (byte)0x18, (byte)0x20, (byte)0xD4, (byte)0x12,
        (byte)0x72, (byte)0x00, (byte)0x00
    };

    // Block explosion 'ringing tone' sound effect
    private final static byte[] BLOCK_EXPLODE_SOUND_BYTES =
    {
        (byte)0x02, (byte)0x4A, (byte)0x3A, (byte)0x80,
        (byte)0x40, (byte)0x00, (byte)0xD2, (byte)0xC8,
        (byte)0x31, (byte)0x03, (byte)0x90, (byte)0x23,
        (byte)0x12, (byte)0xB0, (byte)0x00
    };

    // The 'game over' music played when the player looses.
    // It is from the old tune "Loch Lomond", starting at the
    // notes for the verse "Oh, you'll take the high road ...".
    // It is defined as a 'ringing tone' byte arrary.
    private final static byte[] PLAYER_LOST_MUSIC_BYTES =
    {
        (byte)0x02, (byte)0x4A, (byte)0x3A, (byte)0x80,
        (byte)0x40, (byte)0x06, (byte)0xB2, (byte)0x08,
        (byte)0x22, (byte)0x82, (byte)0xC8, (byte)0x2C,
        (byte)0xC3, (byte)0x0C, (byte)0x34, (byte)0x83,
        (byte)0x4C, (byte)0x30, (byte)0xC2, (byte)0xC8,
        (byte)0x2C, (byte)0xC2, (byte)0x6C, (byte)0x22,
        (byte)0x82, (byte)0x2C, (byte)0x2A, (byte)0xC2,
        (byte)0xC8, (byte)0x2C, (byte)0xC2, (byte)0xCC,
        (byte)0x2C, (byte)0x83, (byte)0x4C, (byte)0x49,
        (byte)0x16, (byte)0x13, (byte)0x21, (byte)0x14,
        (byte)0x10, (byte)0x81, (byte)0x14, (byte)0x13,
        (byte)0x41, (byte)0x36, (byte)0x11, (byte)0x62,
        (byte)0x0D, (byte)0x20, (byte)0xD3, (byte)0x12,
        (byte)0x45, (byte)0x88, (byte)0x38, (byte)0xC3,
        (byte)0x4C, (byte)0x30, (byte)0xC2, (byte)0xCC,
        (byte)0x26, (byte)0x82, (byte)0x2C, (byte)0x26,
        (byte)0xC2, (byte)0xD0, (byte)0x2C, (byte)0xD3,
        (byte)0x50, (byte)0x49, (byte)0x16, (byte)0x93,
        (byte)0x41, (byte)0x16, (byte)0x20, (byte)0xD3,
        (byte)0x0C, (byte)0x10, (byte)0xB1, (byte)0x00,
        (byte)0x00
    };

    // This 'game over' music is played when the player wins.
    // It is from the old tune "Yankee Doodle", starting at
    // the notes for the verse "Yankee Doodle keep it up, Yankee
    // Doodle dandy ...". It is defined as a 'ringing tone' byte arrary.
    private final static byte[] PLAYER_WON_MUSIC_BYTES =
    {
        (byte)0x02, (byte)0x4A, (byte)0x3A, (byte)0x80,
        (byte)0x40, (byte)0x04, (byte)0x11, (byte)0xE8,
        (byte)0x2C, (byte)0xD3, (byte)0x10, (byte)0x2C,
        (byte)0xC2, (byte)0x6C, (byte)0x2C, (byte)0xC3,
        (byte)0x0C, (byte)0x34, (byte)0xC2, (byte)0xCC,
        (byte)0x2A, (byte)0xD2, (byte)0xD0, (byte)0x2A,
        (byte)0xC2, (byte)0x6C, (byte)0x22, (byte)0xD2,
        (byte)0x70, (byte)0x2A, (byte)0xC2, (byte)0x0C,
        (byte)0x2C, (byte)0xD3, (byte)0x10, (byte)0x2C,
        (byte)0xC2, (byte)0x6C, (byte)0x2C, (byte)0xC3,
        (byte)0x0C, (byte)0x34, (byte)0xC2, (byte)0xCC,
        (byte)0x2A, (byte)0xC3, (byte)0x4C, (byte)0x30,
        (byte)0xC3, (byte)0x8C, (byte)0x34, (byte)0x83,
        (byte)0x4C, (byte)0x00
    };


    NokiaGameEffects()
    {
    }


    // Game Settings methods

    boolean hasSoundCapability()
    {
        return true;
    }


    boolean hasVibrationCapability()
    {
        return true;
    }


    // Game Effects methods

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


    void pause()
    {
        setIsPaused(true);

        if (sound != null)
        {
            sound.stop();
        }

        DeviceControl.stopVibra();
    }


    void resume()
    {
        // Note: The 'Game Settings' may change during a pause.
        // In general, one might need to handle that during the resume.
        // But we don't need to do anything to handle that before resuming
        // because any sound or vibration that were in progress just
        // before pausing were cancelled when pause() was called,
        // and any 'Game Settings' changes will take effect after the resume.

        setIsPaused(false);
    }


    private void playSound(int priority, byte[] bytes)
    {
        if (!isPaused && hasSoundCapability() && Settings.getUseSound())
        {
            try
            {
                if (sound == null || sound.getState() != Sound.SOUND_PLAYING)
                {
                    sound = new Sound(bytes, Sound.FORMAT_TONE);
                    sound.setGain(128);
                    sound.play(1); // loop = 1
                    currentPriority = priority;
                }
                else
                {
                    // A sound exists in the SOUND_PLAYING state.

                    if (priority > currentPriority)
                    {
                        sound.stop();
                        sound.init(bytes, Sound.FORMAT_TONE);
                        sound.play(1); // loop = 1
                        currentPriority = priority;
                    }
                    // else
                    //   The last sound is still playing and has a higher
                    //   priority than this play request, so we let the
                    //   last sound continue to play and ignore this play
                    //   request. We don't queue this play request for playing
                    //   after the last one finishes, as that might sound
                    //   funny to the user. (The sounds should match visual
                    //   events occurring in the game). In a fast moving
                    //   game, new play requests are likely to occur
                    //   continuously and frequently (e.g. 'fire a bullet'
                    //   noise), so we can cautiously drop a few play
                    //   requests when it is sensible to do so.
                }
            }
            catch (Exception e)
            {
                currentPriority = 0; // allow any new request to play
            }
        }
    }


    void playBullet()
    {
        // Lowest priority game sound

        playSound(1, BULLET_SOUND_BYTES);
    }


    void playBlockExplosion()
    {
        // Higher priority game sound

        playSound(2, BLOCK_EXPLODE_SOUND_BYTES);
    }


    void playBaseExplosion()
    {
        // Highest priority game sound

        playSound(3, BASE_EXPLODE_SOUND_BYTES);
    }


    void playGameOverMusic(boolean hasPLAYER_WON)
    {
        // The 'game over' music must have a higher priority
        // than any game sound.
        if (hasPLAYER_WON)
        {
            playSound(4, PLAYER_WON_MUSIC_BYTES);
        }
        else
        {
            playSound(4, PLAYER_LOST_MUSIC_BYTES);
        }
    }


    void vibrate()
    {
        if (Settings.getUseVibration())
        {
            try
            {
                // Vibrate at 100% for 300 milli-seconds.
                DeviceControl.startVibra(100, 300);
            }
            catch (Exception e)
            {
                // An IllegalStateException is thrown if the device doesn't
                // have vibration support, or is in it's battery charging
                // station, etc. We can't do anything, so just ignore it.
            }
        }
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91丨九色丨尤物| 精品一区二区影视| 久久久久一区二区三区四区| 欧美亚洲一区二区在线观看| 成人动漫中文字幕| 国产精品99久久久久久似苏梦涵 | 欧美日韩国产一级二级| 99re亚洲国产精品| 99久久99精品久久久久久 | 又紧又大又爽精品一区二区| 亚洲欧洲无码一区二区三区| 亚洲国产成人私人影院tom | 日本乱码高清不卡字幕| 在线视频中文字幕一区二区| 一本一道波多野结衣一区二区| 不卡区在线中文字幕| 色欧美片视频在线观看在线视频| 97精品国产露脸对白| 欧美在线高清视频| 制服丝袜亚洲网站| 亚洲精品一区二区三区香蕉| 久久精品一区二区| 亚洲男人的天堂av| 日韩精品福利网| 国产麻豆精品一区二区| 波多野结衣精品在线| 欧美三级在线播放| 精品久久国产97色综合| 中文乱码免费一区二区| 亚洲一区在线观看视频| 精品一区二区在线视频| 99v久久综合狠狠综合久久| 欧美日韩一二三| 国产婷婷色一区二区三区| 亚洲日本在线观看| 日精品一区二区三区| 国产成人aaaa| 91精品国产欧美一区二区| 久久精品人人做人人爽人人| 一区二区三区毛片| 美国十次综合导航| jlzzjlzz国产精品久久| 日韩三级在线免费观看| 国产精品美日韩| 日本va欧美va精品发布| www.久久久久久久久| 欧美一级一区二区| 亚洲少妇最新在线视频| 久久精品国产网站| 欧美怡红院视频| 国产精品毛片高清在线完整版| 亚洲第一福利一区| 成人免费视频一区| 欧美sm美女调教| 亚洲一区中文日韩| 99久久综合精品| 2017欧美狠狠色| 日韩不卡一区二区三区| 91影视在线播放| 国产欧美一区在线| 精品一二线国产| 91精品国产91久久久久久一区二区| 久久久91精品国产一区二区精品| 日韩av电影免费观看高清完整版在线观看| aaa欧美日韩| 国产精品三级av| 国产电影精品久久禁18| 久久久高清一区二区三区| 老司机免费视频一区二区| 欧美日韩一区二区三区不卡 | 欧美伊人精品成人久久综合97| 中文字幕av在线一区二区三区| 国产毛片精品一区| 久久精品在线观看| 国产精品一区免费在线观看| 久久久亚洲高清| 国产乱码一区二区三区| 久久精品人人做人人爽97| 激情久久五月天| 日韩欧美国产小视频| 亚洲综合成人在线视频| 国产精品一二三四| 精品久久久久久久一区二区蜜臀| 婷婷久久综合九色国产成人| 91网上在线视频| 中文字幕日韩欧美一区二区三区| 国产在线一区二区综合免费视频| 欧美福利电影网| 天堂久久久久va久久久久| 欧美成人精品3d动漫h| 青椒成人免费视频| 91精品国产综合久久久久久久| 亚洲一区在线观看视频| 欧美自拍偷拍一区| 亚洲自拍欧美精品| 色又黄又爽网站www久久| 日韩一区欧美小说| 一本色道久久综合亚洲精品按摩| 中文字幕亚洲综合久久菠萝蜜| 国产精品一区专区| 欧美激情一区二区| 成人精品视频网站| 亚洲婷婷综合久久一本伊一区 | 在线观看亚洲精品视频| 亚洲乱码国产乱码精品精98午夜 | 一区二区在线看| 欧美视频在线播放| 亚洲成人福利片| 在线成人小视频| 美女在线观看视频一区二区| 久久亚洲精品国产精品紫薇| 国产高清在线观看免费不卡| 精品国产不卡一区二区三区| 北条麻妃一区二区三区| 亚洲激情图片一区| 欧美人体做爰大胆视频| 日韩国产欧美在线视频| 久久先锋影音av| jizzjizzjizz欧美| 亚洲蜜臀av乱码久久精品| 色婷婷av一区二区三区gif| 国产一区二区三区免费在线观看| 国产精品美女久久久久久久久 | 麻豆成人免费电影| 国产精品三级在线观看| 欧洲精品一区二区| 美女脱光内衣内裤视频久久影院| 久久久精品一品道一区| 色av综合在线| 精品在线一区二区三区| 综合欧美一区二区三区| 欧美成人精品二区三区99精品| 成人性生交大片免费看在线播放| 一区二区三区在线视频观看| 91精品国产手机| caoporen国产精品视频| 日本不卡一区二区三区| 日韩欧美精品在线视频| 国产成人av电影在线播放| 午夜精品福利视频网站| 国产精品每日更新在线播放网址| 欧美日韩视频在线第一区 | 成人午夜视频福利| 亚洲成人综合视频| 国产三级精品三级| 欧美精选在线播放| aaa国产一区| 国产最新精品免费| 亚洲一卡二卡三卡四卡五卡| 中国av一区二区三区| 精品日韩成人av| 欧美影视一区在线| 99视频国产精品| 国产成人精品三级麻豆| 蜜臀va亚洲va欧美va天堂| 青草国产精品久久久久久| 亚洲美女视频在线| 国产精品视频一二三| 久久久综合激的五月天| 日韩丝袜美女视频| 制服丝袜在线91| 欧美videofree性高清杂交| 91极品美女在线| 福利91精品一区二区三区| 极品美女销魂一区二区三区| 美女一区二区在线观看| 日日夜夜精品视频天天综合网| 中文字幕一区二区三区精华液 | 免费观看一级特黄欧美大片| 亚洲国产成人91porn| 亚洲激情男女视频| 亚洲欧美日韩国产一区二区三区| 欧美国产日韩一二三区| 久久精品人人做人人爽人人| 久久综合一区二区| 久久午夜电影网| 久久亚洲影视婷婷| 国产亚洲精品aa| 国产精品午夜免费| 国产日韩三级在线| 中文字幕不卡一区| 亚洲欧洲av一区二区三区久久| 国产精品久久99| 综合婷婷亚洲小说| 亚洲精品国产a久久久久久| 亚洲欧美偷拍卡通变态| 亚洲精品亚洲人成人网| 亚洲狠狠爱一区二区三区| 综合欧美亚洲日本| 一级日本不卡的影视| 亚洲电影一区二区| 美腿丝袜在线亚洲一区| 国产高清亚洲一区| 国产剧情一区二区| 欧美性xxxxxxxx| 欧美zozo另类异族| 国产精品九色蝌蚪自拍| 亚洲精品ww久久久久久p站| 日韩高清不卡一区二区三区| 久久国内精品视频|