39th Day a fun-android game jerk Off (iii) plane bullets

Source: Internet
Author: User

August 7, light rain. "The crow cries scattered Yu ping empty, a pillow new cool a fan." Sleep autumn, no place, full-scale Indus Moon Ming. "

The previous article has allowed the plane to move freely with the finger , this post loads bullets and sound and background music.

Some of the functions to be used in this article are explained:

First, the cocos2d sound, background music functions are as follows:

1,soundengine.sharedengine (). PlaySound (Context ctxt, int Res Id, boolean loop)

Used to play background music.

2, Soundengine.sharedengine (). Playeffect (Context app,int resId)

for playing sound effects , such as bullets shooting, collisions, explosions and other musical effects .

3 . SoundEngine.sharedEngine().realesAllSounds();

       SoundEngine.sharedEngine().realesAllEffects();      清理所有的音效-Clean everything up

 SoundEngine.purgeSharedEngine();

         Turn off the sound system completely - completely Shut down the sound system

        二、单线程的定时器schedule

       schedule(String selector,float interval)

       第二个参数的意思是,每隔多少秒执行一次函数,记住,单位是秒。


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.