Ejemplo n.º 1
0
        public Enemy(Vector2DF pos, Player player)
        {
            Position    = pos;
            this.player = player;

            Texture = asd.Engine.Graphics.CreateTexture2D("Resources/Enemy.png");

            Radius = Texture.Size.X / 2.0f;

            //破壊時の効果音を読み込む
            deathSound = asd.Engine.Sound.CreateSoundSource("Resources/Explode.wav", true);
        }
Ejemplo n.º 2
0
        public Enemy(Vector2DF pos, NormalPlayer player)
        {
            Position    = pos;
            this.player = player;

            Texture = asd.Engine.Graphics.CreateTexture2D("Resources/Player2.png");

            CenterPosition = new asd.Vector2DF(Texture.Size.X / 2.0f, Texture.Size.Y / 2.0f);

            Radius = Texture.Size.X / 2.0f;

            //破壊時の効果音を読み込む
            deathSound = asd.Engine.Sound.CreateSoundSource("Resources/Explode.wav", true);

            enemycount++;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// ネイティブのインスタンスからラッパー側のインスタンスを生成する。
        /// </summary>
        /// <param name="o"></param>
        /// <param name="type"></param>
        internal static SoundSource GenerateSoundSource(swig.SoundSource o, GenerationType type)
        {
            if (o == null)
            {
                return(null);
            }
            var p = o.GetPtr();

            var existing = GC.SoundSources.GetObject(p);

            existing = GenerateInternal(existing, o, type);
            if (existing != null)
            {
                return(existing);
            }

            var ret = new SoundSource(o);

            GC.SoundSources.AddObject(p, ret);
            return(ret);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 音を再生する。 
 /// </summary>
 /// <param name="soundSource">音源 </param>
 /// <returns>ID </returns>
 public int Play(SoundSource soundSource)
 {
     var soundSourceCore = soundSource != null ? soundSource.CoreInstance : null;
     return CoreInstance.Play(soundSourceCore);
 }