예제 #1
0
파일: Spring.cs 프로젝트: sinshu/mafia
 public override void CollidedTop(Thing thing)
 {
     if (thing != null && !thing.CanPush)
     {
         thing.Velocity.Y = -4;
     }
     animation = 9;
 }
예제 #2
0
파일: FallBlock.cs 프로젝트: sinshu/mafia
 public override void CollidedBottom(Thing thing)
 {
     base.CollidedBottom(thing);
     if (type == Map.SPIKE_DOWN)
     {
         thing.Damaged(this);
     }
 }
예제 #3
0
파일: Switch.cs 프로젝트: sinshu/mafia
 public override void CollidedTop(Thing thing)
 {
     if (!pressed)
     {
         Game.ToggleDoors();
         pressed = true;
         pressSound = true;
     }
 }
예제 #4
0
파일: MafiaSound.cs 프로젝트: sinshu/mafia
 public void Play(SecondaryBuffer buffer, Thing thing)
 {
     // �V�����X�P�Anull���ǂ����`�F�b�N���Ȃ���Ȃ��Ƃ͉�����
     if (device == null) return;
     if (numChannels == MAX_NUM_CHANNELS) return;
     channels[numChannels] = new GameSoundChannel(buffer.Clone(device), thing);
     channels[numChannels].Buffer.Pan = CalcPan(thing);
     channels[numChannels].Buffer.Volume = CalcVolume(thing);
     channels[numChannels].Buffer.Play(0, BufferPlayFlags.Default);
     numChannels++;
 }
예제 #5
0
파일: ThingList.cs 프로젝트: sinshu/mafia
 private static bool isRemoved(Thing thing)
 {
     return thing.Removed;
 }
예제 #6
0
파일: Map.cs 프로젝트: sinshu/mafia
 public bool IsObstacle(Thing thing, int row, int col)
 {
     if (thing is Lift)
     {
         return this[row, col] != NONE;
     }
     else if (thing is Door)
     {
         return this[row, col] != NONE && this[row, col] != DOOR_SLIDE;
     }
     return this[row, col] != NONE && this[row, col] != LIFT_RETURN;
 }
예제 #7
0
파일: MafiaSound.cs 프로젝트: sinshu/mafia
        private int CalcVolume(Thing thing)
        {
            if (thing == null)
            {
                return (int)Volume.Max;
            }
            Vector v = thing.CenterOnScreen;
            if (0 < v.X && v.X < Mafia.SCREEN_WIDTH && 0 < v.Y && v.Y < Mafia.SCREEN_HEIGHT)
            {
                return 0;
            }

            double range1 = -v.X;
            double range2 = v.X - Mafia.SCREEN_WIDTH;
            double range3 = -v.Y;
            double range4 = v.Y - Mafia.SCREEN_HEIGHT;
            double range = Math.Max(Math.Max(range1, range2), Math.Max(range3, range4));

            int volume = (int)Math.Round(-range * 10000 / Mafia.SOUND_RANGE);
            if (volume < -10000) volume = -10000;
            if (volume > 0) volume = 0;

            return volume;
        }
예제 #8
0
파일: FallBlock.cs 프로젝트: sinshu/mafia
 public override void CollidedRight(Thing thing)
 {
     base.CollidedRight(thing);
     if (type == Map.SPIKE_RIGHT)
     {
         thing.Damaged(this);
     }
 }
예제 #9
0
파일: Thing.cs 프로젝트: sinshu/mafia
 public virtual void CollidedTop(Thing thing)
 {
     if (!thing.CanPush && !Carry.Has(thing))
     {
         Carry.AddThing(thing);
     }
 }
예제 #10
0
파일: Thing.cs 프로젝트: sinshu/mafia
 public virtual void CollidedRight(Thing thing)
 {
 }
예제 #11
0
파일: Thing.cs 프로젝트: sinshu/mafia
 public virtual void CollidedLeft(Thing thing)
 {
 }
예제 #12
0
파일: Thing.cs 프로젝트: sinshu/mafia
 public virtual void CollidedBottom(Thing thing)
 {
 }
예제 #13
0
파일: Thing.cs 프로젝트: sinshu/mafia
 public virtual void CollidBottom(Thing thing)
 {
     Velocity.Y = 0;
 }
예제 #14
0
파일: ThingList.cs 프로젝트: sinshu/mafia
 public bool Has(Thing thing)
 {
     return list.IndexOf(thing) != -1;
 }
예제 #15
0
파일: ThingList.cs 프로젝트: sinshu/mafia
 public void AddThing(Thing thing)
 {
     list.Add(thing);
 }
예제 #16
0
파일: FallBlock.cs 프로젝트: sinshu/mafia
 public override void CollidedTop(Thing thing)
 {
     base.CollidedTop(thing);
     if (type != Map.SPIKE_DOWN)
     {
         if (!falling)
         {
             falling = true;
             fallSound = true;
         }
     }
 }
예제 #17
0
파일: FallBlock.cs 프로젝트: sinshu/mafia
 public override void Damaged(Thing thing)
 {
     if (damaged) return;
     damaged = true;
     for (int i = 0; i < 8; i++)
     {
         Game.AddThingInGame(new Tiun(Game, Position, i, 2, 16, Tiun.MOKU));
     }
     Remove();
 }
예제 #18
0
파일: Thing.cs 프로젝트: sinshu/mafia
 public virtual void CollidRight(Thing thing)
 {
     Velocity.X = 0;
 }
예제 #19
0
파일: FallBlock.cs 프로젝트: sinshu/mafia
 public override void CollidedLeft(Thing thing)
 {
     base.CollidedLeft(thing);
     if (type == Map.SPIKE_LEFT)
     {
         thing.Damaged(this);
     }
 }
예제 #20
0
파일: Thing.cs 프로젝트: sinshu/mafia
 public virtual void CollidTop(Thing thing)
 {
     Velocity.Y = 0;
 }
예제 #21
0
파일: GameScene.cs 프로젝트: sinshu/mafia
 public void AddThingInGame(Thing thing)
 {
     addThings.AddThing(thing);
 }
예제 #22
0
파일: Thing.cs 프로젝트: sinshu/mafia
 public virtual void Damaged(Thing thing)
 {
 }
예제 #23
0
파일: MafiaSound.cs 프로젝트: sinshu/mafia
 private int CalcPan(Thing thing)
 {
     if (thing == null)
     {
         return (int)Pan.Center;
     }
     double pan = (thing.CenterOnScreen.X - Mafia.SCREEN_WIDTH / 2) * 10000 / (Mafia.SCREEN_WIDTH * 4);
     if (Math.Abs(pan) > 10000)
     {
         pan = Math.Sign(pan) * 10000;
     }
     return (int)Math.Round(pan);
 }
예제 #24
0
파일: Thing.cs 프로젝트: sinshu/mafia
 protected bool IsNotCarry(Thing thing)
 {
     return !(thing.Bottom == Top && thing.Left < Right && Left < thing.Right && thing.IsObstacle);
 }
예제 #25
0
파일: Thing.cs 프로젝트: sinshu/mafia
 protected bool Overlapped(Thing thing)
 {
     return Left < thing.Right && thing.Left < Right && Top < thing.Bottom && thing.Top < Bottom;
 }
예제 #26
0
파일: Thing.cs 프로젝트: sinshu/mafia
 protected bool Overlapped(Thing thing, int depth)
 {
     return Left + depth < thing.Right && thing.Left + depth < Right && Top + depth < thing.Bottom && thing.Top + depth < Bottom;
 }
예제 #27
0
 public GameSoundChannel(SecondaryBuffer buffer, Thing thing)
 {
     Buffer = buffer;
     Thing = thing;
 }
예제 #28
0
파일: Box.cs 프로젝트: sinshu/mafia
 public override void CollidBottom(Thing thing)
 {
     base.CollidBottom(thing);
     LandState = ON_GROUND;
 }
예제 #29
0
파일: Coin.cs 프로젝트: sinshu/mafia
 public override void CollidLeft(Thing thing)
 {
 }
예제 #30
0
파일: Player.cs 프로젝트: sinshu/mafia
 public override void Damaged(Thing thing)
 {
     Animation = 0;
     if (!missed)
     {
         missed = true;
         for (int i = 0; i < 8; i++)
         {
             Game.AddThingInGame(new Tiun(Game, Position, i, 2, 64, Tiun.TIUN));
             Game.AddThingInGame(new Tiun(Game, Position, i, 4, 64, Tiun.TIUN));
         }
         tiunSound = true;
     }
 }