コード例 #1
0
ファイル: ObjDisplay.cs プロジェクト: ingex0/smarttank
        public IGameObj CreateInstance(Vector2 pos)
        {
            IGameObj result = CreateInstance();

            result.Pos = pos;
            return(result);
        }
コード例 #2
0
 void phiUpdater_OnOverlap(IGameObj sender, CollisionResult result, GameObjInfo objB)
 {
     if (OnOverlap != null)
     {
         OnOverlap(this, result, objB);
     }
 }
コード例 #3
0
        public void SetObj(IGameObj obj)
        {
            this.obj           = obj;
            this.properityList = new ProperityList(obj);

            this.DataSource = properityList.List;
        }
コード例 #4
0
            public ProperityList(IGameObj obj)
            {
                this.obj = obj;
                list     = new List <Element>();

                UpdateList();
            }
コード例 #5
0
ファイル: WarShip.cs プロジェクト: ingex0/smarttank
 void phisicalUpdater_OnOverlap(IGameObj Sender, CollisionResult result, GameObjInfo objB)
 {
     if (OnOverLap != null)
     {
         InfoRePath.CallEvent(this.mgPath, "OnOverlap", OnOverLap, this, result, objB);
     }
 }
コード例 #6
0
ファイル: WarShip.cs プロジェクト: ingex0/smarttank
 public void CallOnOverlap(IGameObj Sender, CollisionResult result, GameObjInfo objB)
 {
     if (OnOverLap != null)
     {
         OnOverLap(Sender, result, objB);
     }
 }
コード例 #7
0
ファイル: WarShip.cs プロジェクト: ingex0/smarttank
 public void CallOnCollied(IGameObj Sender, CollisionResult result, GameObjInfo objB)
 {
     if (OnCollied != null)
     {
         OnCollied(Sender, result, objB);
     }
 }
コード例 #8
0
 void phiUpdater_OnCollied(IGameObj Sender, CollisionResult result, GameObjInfo objB)
 {
     if (onCollided != null)
     {
         onCollided(this, result, objB);
     }
 }
コード例 #9
0
ファイル: WarShip.cs プロジェクト: ingex0/smarttank
 void phisicalUpdater_OnCollied(IGameObj Sender, CollisionResult result, GameObjInfo objB)
 {
     if (OnCollied != null)
     {
         InfoRePath.CallEvent(this.mgPath, "OnCollied", OnCollied, this, result, objB);
     }
 }
コード例 #10
0
ファイル: StarwarLogic.cs プロジェクト: ingex0/smarttank
        void WarShip_OnCollied(IGameObj Sender, CollisionResult result, GameObjInfo objB)
        {
            if (objB.ObjClass == "WarShipShell")
            {
                WarShip ship = (WarShip)Sender;
                ship.BeginStill();
                if (PurviewMgr.IsMainHost)
                {
                    ship.HitByShell();
                }
                ship.Vel = result.NormalVector * SpaceWarConfig.ShellSpeed;

                SyncShipScoreHp(ship, false);
            }
            else if (objB.ObjClass == "WarShip")
            {
                WarShip ship   = (WarShip)Sender;
                Vector2 newVel = CalMirrorVel(ship.Vel, result.NormalVector);
                ship.Vel = newVel;
                ship.BeginStill();
            }
            else if (objB.ObjClass == "Rock")
            {
                WarShip ship   = (WarShip)Sender;
                Vector2 newVel = CalMirrorVel(ship.Vel, result.NormalVector);
                ship.Vel = newVel;
                ship.BeginStill();
            }
        }
コード例 #11
0
ファイル: StarwarLogic.cs プロジェクト: ingex0/smarttank
        void Shell_onCollided(IGameObj Sender, CollisionResult result, GameObjInfo objB)
        {
            if (objB.ObjClass == "WarShip")
            {
                if (PurviewMgr.IsMainHost)
                {
                    WarShipShell shell = Sender as WarShipShell;
                    WarShip      firer = shell.Firer as WarShip;
                    if (objB.Script != firer.ObjInfo.Script)
                    {
                        (shell.Firer as WarShip).Score += SpaceWarConfig.ScoreByHit;
                        SyncShipScoreHp(shell.Firer as WarShip, true);
                    }
                }

                sceneMgr.DelGameObj("shell", Sender.Name);
                new ShellExplodeBeta(Sender.Pos, ((ShellNormal)Sender).Azi);

                Quake.BeginQuake(10, 50);
                Sound.PlayCue("EXPLO1");
            }
            else
            {
                WarShipShell shell = (WarShipShell)Sender;
                shell.MirrorPath(result);

                //
                //BroadcastObjPhiStatus(shell, true);
            }
        }
コード例 #12
0
ファイル: ProperityEditer.cs プロジェクト: ingex0/smarttank
            public ProperityList ( IGameObj obj )
            {
                this.obj = obj;
                list = new List<Element>();

                UpdateList();
            }
コード例 #13
0
ファイル: Judge.cs プロジェクト: raphaklaus/code-dojo-csharp
        public string doJudge(string param1, string param2)
        {
            rock = new RockWin();
            paper = new PaperWin();
            scissors = new ScissorsWin();
            draw = new DrawGame();

            rock.next = paper;
            paper.next = scissors;
            scissors.next = draw;

            result = rock.doWin(param1, param2);

            return result;

            // Let's try to leave this kind of practice away...
            // Vamos tentar deixar esse tipo de prática de lado...

            //if (param1 == param2)
            //{
            //    return "Draw";
            //}

            //if (param1 == "Rock" && param2 == "Paper")
            //{
            //    return "Rock wins.";
            //}

            //if (param1 == "Rock" && param2 == "Scissors")
            //{
            //    return "Scissors wins.";
            //}
        }
コード例 #14
0
        // Kershove!
        public override void OnCollide(IGameObj o, GameState g)
        {
            Vector2d force = Vector2d.NormalizeFast(Vel);

            force = Vector2d.Multiply(force, 300);
            o.Push(force);
            base.OnCollide(o, g);
        }
コード例 #15
0
 void Shell_onOverlap(IGameObj Sender, CollisionResult result, GameObjInfo objB)
 {
     if (objB.ObjClass == "Border")
     {
         NiceShootSum = Math.Max(0, NiceShootSum - 10);
     }
     //camera.Focus( tank );
 }
コード例 #16
0
 void phiUpdater_OnCollied(IGameObj Sender, CollisionResult result, GameObjInfo objB)
 {
     if (onCollided != null)
     {
         //onCollided( this, result, objB );
         InfoRePath.CallEvent(this.MgPath, "onCollided", onCollided, this, result, objB);
     }
 }
コード例 #17
0
ファイル: ObjDisplay.cs プロジェクト: ingex0/smarttank
        public ObjDisplay(string name, Type objClassType, string objDataPath)
        {
            this.name         = name;
            this.objClassType = objClassType;
            this.objDataPath  = objDataPath;

            example = CreateInstance();
        }
コード例 #18
0
 void phiUpdater_OnOverlap(IGameObj Sender, CollisionResult result, GameObjInfo objB)
 {
     if (onOverlap != null)
     {
         //onOverlap( this, result, objB );
         InfoRePath.CallEvent(this.MgPath, "onOverlap", onOverlap, this, result, objB);
     }
 }
コード例 #19
0
        void shell_onCollided(IGameObj Sender, CollisionResult result, GameObjInfo objB)
        {
            sceneMgr.DelGameObj("shell", Sender.Name);
            new ShellExplodeBeta(Sender.Pos, ((ShellNormal)Sender).Azi);

            Quake.BeginQuake(10, 50);
            Sound.PlayCue("EXPLO1");
        }
コード例 #20
0
ファイル: ObjDisplay.cs プロジェクト: ingex0/smarttank
        public ObjDisplay ( string name, Type objClassType, string objDataPath )
        {
            this.name = name;
            this.objClassType = objClassType;
            this.objDataPath = objDataPath;

            example = CreateInstance();
        }
コード例 #21
0
 void SyncCasheReader_onCreateObj(IGameObj obj)
 {
     if (obj is ShellNormal)
     {
         ShellNormal shell = obj as ShellNormal;
         shell.onCollided += new OnCollidedEventHandler(shell_onCollided);
         shellSum++;
     }
 }
コード例 #22
0
 public ShellNormal(string name, IGameObj firer, Vector2 startPos, float startAzi, float speed)
 {
     this.name  = name;
     this.firer = firer;
     sprite     = new Sprite(BaseGame.RenderEngine, BaseGame.ContentMgr, Path.Combine(Directories.ContentDirectory, texPath), true);
     sprite.SetParameters(new Vector2(5, 0), startPos, 0.08f, startAzi, Color.White, LayerDepth.Shell, SpriteBlendMode.AlphaBlend);
     phiUpdater            = new NonInertiasColUpdater(ObjInfo, startPos, MathTools.NormalVectorFromAzi(startAzi) * speed, startAzi, 0f, new Sprite[] { sprite });
     phiUpdater.OnOverlap += new OnCollidedEventHandler(phiUpdater_OnOverlap);
     phiUpdater.OnCollied += new OnCollidedEventHandler(phiUpdater_OnCollied);
 }
コード例 #23
0
ファイル: ShellNormal.cs プロジェクト: ingex0/smarttank
 public ShellNormal( string name, IGameObj firer, Vector2 startPos, float startAzi, float speed )
 {
     this.name = name;
     this.firer = firer;
     sprite = new Sprite( BaseGame.RenderEngine, BaseGame.ContentMgr, Path.Combine( Directories.ContentDirectory, texPath ), true );
     sprite.SetParameters( new Vector2( 5, 0 ), startPos, 0.08f, startAzi, Color.White, LayerDepth.Shell, SpriteBlendMode.AlphaBlend );
     phiUpdater = new NonInertiasColUpdater( ObjInfo, startPos, MathTools.NormalVectorFromAzi( startAzi ) * speed, startAzi, 0f, new Sprite[] { sprite } );
     phiUpdater.OnOverlap += new OnCollidedEventHandler( phiUpdater_OnOverlap );
     phiUpdater.OnCollied += new OnCollidedEventHandler( phiUpdater_OnCollied );
 }
コード例 #24
0
ファイル: ShellNormal.cs プロジェクト: ingex0/smarttank
        void phiUpdater_OnOverlap( IGameObj Sender, CollisionResult result, GameObjInfo objB )
        {
            //if (objB.ObjClass == "Border")
            //{
            //    ((SceneKeeperCommon)(GameManager.CurSceneKeeper)).RemoveGameObj( this, true, false, false, false, SceneKeeperCommon.GameObjLayer.lowFlying );
            //}

            if (onOverlap != null)
                onOverlap( this, result, objB );
        }
コード例 #25
0
ファイル: StarwarLogic.cs プロジェクト: ingex0/smarttank
        void Warship_OnOverLap(IGameObj Sender, CollisionResult result, GameObjInfo objB)
        {
            if (objB.ObjClass == "Gold")
            {
                WarShip ship = Sender as WarShip;
                ship.Score += SpaceWarConfig.GoldScore;

                SyncShipScoreHp(ship, true);
            }
        }
コード例 #26
0
 public bool Colliding(IGameObj o)
 {
     if (Collidable && o.Collidable)
     {
         return(Collider.Colliding(o.Collider));
     }
     else
     {
         return(false);
     }
 }
コード例 #27
0
 public override bool Colliding(IGameObj o)
 {
     if (o.Shootable)
     {
         return(base.Colliding(o));
     }
     else
     {
         return(false);
     }
 }
コード例 #28
0
 public override bool Colliding(IGameObj o)
 {
     if (LifeTime < 5)
     {
         return(false);
     }
     else
     {
         return(base.Colliding(o));
     }
 }
コード例 #29
0
        void Shell_onCollided(IGameObj Sender, CollisionResult result, GameObjInfo objB)
        {
            //scene.RemoveGameObj( Sender, true, false, false, false, SceneKeeperCommon.GameObjLayer.lowFlying );
            sceneMgr.DelGameObj("shell", Sender.Name);

            //camera.Focus( tank );
            //if (objB.Name == "Border")
            //{
            //    NiceShootSum = Math.Max( 0, NiceShootSum - 1 );
            //}
        }
コード例 #30
0
        void controller_OnCollied(IGameObj Sender, CollisionResult result, GameObjInfo objB)
        {
            if (onCollide != null)
            {
                onCollide(this, result, objB);
            }

            if (OnCollide != null)
            {
                OnCollide(result, objB);
            }
        }
コード例 #31
0
ファイル: Level.cs プロジェクト: icefoxen/games-lost3
        public void Boundary(IGameObj o)
        {
            double dist = o.Loc.Length;
            double f    = dist - Radius;

            if (f > 0)
            {
                Vector2d pos = o.Loc;
                pos.Normalize();
                o.Push(Vector2d.Multiply(pos, -(dist / 100)));                // And bounce them back.
            }
        }
コード例 #32
0
        void phiUpdater_OnOverlap(IGameObj Sender, CollisionResult result, GameObjInfo objB)
        {
            //if (objB.ObjClass == "Border")
            //{
            //    ((SceneKeeperCommon)(GameManager.CurSceneKeeper)).RemoveGameObj( this, true, false, false, false, SceneKeeperCommon.GameObjLayer.lowFlying );
            //}

            if (onOverlap != null)
            {
                onOverlap(this, result, objB);
            }
        }
コード例 #33
0
        void controller_OnOverlap(IGameObj Sender, CollisionResult result, GameObjInfo objB)
        {
            if (onOverLap != null)
            {
                onOverLap(this, result, objB);
            }

            if (OnOverLap != null)
            {
                OnOverLap(result, objB);
            }
        }
コード例 #34
0
        /// <summary>
        /// 添加物体
        /// </summary>
        /// <param name="groupPath">要添加到的组的路径,该组必须为TypeGroup</param>
        /// <param name="obj"></param>
        /// <returns></returns>
        public bool AddGameObj(string groupPath, IGameObj obj)
        {
            Group fatherGroup = FindGroup(groupPath);

            if (fatherGroup != null && fatherGroup is TypeGroup)
            {
                return((fatherGroup as TypeGroup).AddObj(obj));
            }
            else
            {
                return(false);
            }
        }
コード例 #35
0
        void controller_OnCollied(IGameObj Sender, CollisionResult result, GameObjInfo objB)
        {
            if (onCollide != null)
            {
                //onCollide(this, result, objB);
                InfoRePath.CallEvent(this.MgPath, "onCollide", onCollide, this, result, objB);
            }

            if (OnCollide != null)
            {
                //OnCollide(result, objB);
                InfoRePath.CallEvent(this.MgPath, "OnCollide", OnCollide, result, objB);
            }
        }
コード例 #36
0
ファイル: ShellNormal.cs プロジェクト: ingex0/smarttank
        public ShellNormal(string name, IGameObj firer, Vector2 startPos, float startAzi, float speed, string texPath, bool fromContent, Vector2 texOrignPos, float texScale)
        {
            this.name = name;
            this.firer = firer;

            if (fromContent)
            {
                sprite = new Sprite(BaseGame.RenderEngine, BaseGame.ContentMgr, texPath, true);
            }
            else
            {
                sprite = new Sprite(BaseGame.RenderEngine, texPath, true);
            }
            sprite.SetParameters(texOrignPos, startPos, texScale, startAzi, Color.White, LayerDepth.Shell, SpriteBlendMode.AlphaBlend);
            phiUpdater = new NonInertiasColUpdater(ObjInfo, startPos, MathTools.NormalVectorFromAzi(startAzi) * speed, startAzi, 0f, new Sprite[] { sprite });
            phiUpdater.OnOverlap += new OnCollidedEventHandler(phiUpdater_OnOverlap);
            phiUpdater.OnCollied += new OnCollidedEventHandler(phiUpdater_OnCollied);
        }
コード例 #37
0
ファイル: WarShip.cs プロジェクト: ingex0/smarttank
 void phisicalUpdater_OnOverlap(IGameObj Sender, CollisionResult result, GameObjInfo objB)
 {
     if (OnOverLap != null)
         InfoRePath.CallEvent(this.mgPath, "OnOverlap", OnOverLap, this, result, objB);
 }
コード例 #38
0
ファイル: StarwarLogic.cs プロジェクト: ingex0/smarttank
 void SyncCasheReader_onCreateObj(IGameObj obj)
 {
     if (obj is WarShipShell)
     {
         WarShipShell shell = obj as WarShipShell;
         shell.onCollided += new OnCollidedEventHandler(Shell_onCollided);
         shell.OnOutDate += new WarShipShell.ShellOutDateEventHandler(Shell_OnOutDate);
         shellcount++;
     }
     else if (obj is Rock)
     {
         Rock newRock = obj as Rock;
         newRock.OnCollided += new OnCollidedEventHandler(Rock_OnCollided);
         rocks.Add(newRock);
         rockCount++;
     }
 }
コード例 #39
0
ファイル: StarwarLogic.cs プロジェクト: ingex0/smarttank
 private void BroadcastObjPhiStatus(IGameObj obj, bool collide)
 {
     if (obj is IPhisicalObj)
     {
         if (collide)
         {
             NonInertiasPhiUpdater phiUpdater = (NonInertiasPhiUpdater)((IPhisicalObj)obj).PhisicalUpdater;
             SyncCasheWriter.SubmitUserDefineInfo("ObjPhiCollide",
                 obj.ObjInfo.ObjClass, obj, phiUpdater.Pos, phiUpdater.Vel, phiUpdater.Azi, phiUpdater.AngVel);
         }
         else
         {
             NonInertiasPhiUpdater phiUpdater = (NonInertiasPhiUpdater)((IPhisicalObj)obj).PhisicalUpdater;
             SyncCasheWriter.SubmitUserDefineInfo("ObjPhi",
                 obj.ObjInfo.ObjClass, obj, phiUpdater.Pos, phiUpdater.Vel, phiUpdater.Azi, phiUpdater.AngVel);
         }
     }
 }
コード例 #40
0
ファイル: StarwarLogic.cs プロジェクト: ingex0/smarttank
 void Gold_OnOverLap(IGameObj Sender, CollisionResult result, GameObjInfo objB)
 {
     SetGoldNewPos(Sender as Gold);
 }
コード例 #41
0
ファイル: StarwarLogic.cs プロジェクト: ingex0/smarttank
        void Rock_OnCollided(IGameObj Sender, CollisionResult result, GameObjInfo objB)
        {
            if (objB.ObjClass == "WarShip")// || objB.ObjClass == "Rock")
            {
                Vector2 newVel = CalMirrorVel((Sender as Rock).Vel, result.NormalVector);
                (Sender as Rock).Vel = newVel;
            }
            else if (objB.ObjClass == "Rock")
            {
                Vector2 newVel = CalMirrorVel((Sender as Rock).Vel, result.NormalVector);
                (Sender as Rock).Vel = newVel;
            }

            //BroadcastObjPhiStatus(Sender, true);
        }
コード例 #42
0
ファイル: SmokeGenerater.cs プロジェクト: ingex0/smarttank
 public SmokeGenerater( float duaration, float partiDuara, Vector2 dir, float speed, float concen, bool managered,
     IGameObj foucsObj )
     : this( duaration, partiDuara, Vector2.Zero, dir, speed, concen, managered )
 {
     this.foucsObj = foucsObj;
 }
コード例 #43
0
ファイル: StarwarLogic.cs プロジェクト: ingex0/smarttank
        void Warship_OnOverLap(IGameObj Sender, CollisionResult result, GameObjInfo objB)
        {
            if (objB.ObjClass == "Gold")
            {
                WarShip ship = Sender as WarShip;
                ship.Score += SpaceWarConfig.GoldScore;

                SyncShipScoreHp(ship, true);
            }
        }
コード例 #44
0
ファイル: StarwarLogic.cs プロジェクト: ingex0/smarttank
 void Shell_OnOutDate(WarShipShell sender, IGameObj shooter)
 {
     OutDateShellNames.Add(sender.Name);
 }
コード例 #45
0
ファイル: StarwarLogic.cs プロジェクト: ingex0/smarttank
        void Shell_onCollided(IGameObj Sender, CollisionResult result, GameObjInfo objB)
        {

            if (objB.ObjClass == "WarShip")
            {
                if (PurviewMgr.IsMainHost)
                {
                    WarShipShell shell = Sender as WarShipShell;
                    WarShip firer = shell.Firer as WarShip;
                    if (objB.Script != firer.ObjInfo.Script)
                    {
                        (shell.Firer as WarShip).Score += SpaceWarConfig.ScoreByHit;
                        SyncShipScoreHp(shell.Firer as WarShip, true);
                    }
                }

                sceneMgr.DelGameObj("shell", Sender.Name);
                new ShellExplodeBeta(Sender.Pos, ((ShellNormal)Sender).Azi);

                Quake.BeginQuake(10, 50);
                Sound.PlayCue("EXPLO1");
            }
            else
            {
                WarShipShell shell = (WarShipShell)Sender;
                shell.MirrorPath(result);

                //
                //BroadcastObjPhiStatus(shell, true);
            }

        }
コード例 #46
0
ファイル: ProperityEditer.cs プロジェクト: ingex0/smarttank
 public void ClearObj ()
 {
     this.obj = null;
     this.properityList = null;
 }
コード例 #47
0
ファイル: DuelRule.cs プロジェクト: ingex0/smarttank
        void shell_onCollided( IGameObj Sender, CollisionResult result, GameObjInfo objB )
        {
            sceneMgr.DelGameObj( "shell", Sender.Name );
            new ShellExplodeBeta( Sender.Pos, ((ShellNormal)Sender).Azi );

            Quake.BeginQuake( 10, 50 );
            Sound.PlayCue( "EXPLO1" );

        }
コード例 #48
0
ファイル: ProperityEditer.cs プロジェクト: ingex0/smarttank
        public void SetObj ( IGameObj obj )
        {
            this.obj = obj;
            this.properityList = new ProperityList( obj );

            this.DataSource = properityList.List;
        }
コード例 #49
0
ファイル: TankSinTur.cs プロジェクト: ingex0/smarttank
        void controller_OnCollied(IGameObj Sender, CollisionResult result, GameObjInfo objB)
        {
            if (onCollide != null)
                //onCollide(this, result, objB);
                InfoRePath.CallEvent(this.MgPath, "onCollide", onCollide,  this, result, objB);

            if (OnCollide != null)
                //OnCollide(result, objB);
                InfoRePath.CallEvent(this.MgPath, "OnCollide", OnCollide, result, objB);
        }
コード例 #50
0
ファイル: TankSinTur.cs プロジェクト: ingex0/smarttank
        void controller_OnOverlap(IGameObj Sender, CollisionResult result, GameObjInfo objB)
        {
            if (onOverLap != null)
                //onOverLap(this, result, objB);
                InfoRePath.CallEvent(this.MgPath, "onOverLap", onOverLap, this, result, objB);

            if (OnOverLap != null)
                //OnOverLap(result, objB);
                InfoRePath.CallEvent(this.MgPath, "OnOverLap", OnOverLap,  result, objB);
        }
コード例 #51
0
ファイル: WarShip.cs プロジェクト: ingex0/smarttank
 public void CallOnOverlap(IGameObj Sender, CollisionResult result, GameObjInfo objB)
 {
     if (OnOverLap != null)
         OnOverLap(Sender, result, objB);
 }
コード例 #52
0
ファイル: StarwarLogic.cs プロジェクト: ingex0/smarttank
        void WarShip_OnCollied(IGameObj Sender, CollisionResult result, GameObjInfo objB)
        {
            if (objB.ObjClass == "WarShipShell")
            {
                WarShip ship = (WarShip)Sender;
                ship.BeginStill();
                if (PurviewMgr.IsMainHost)
                    ship.HitByShell();
                ship.Vel = result.NormalVector * SpaceWarConfig.ShellSpeed;

                SyncShipScoreHp(ship, false);
            }
            else if (objB.ObjClass == "WarShip")
            {
                WarShip ship = (WarShip)Sender;
                Vector2 newVel = CalMirrorVel(ship.Vel, result.NormalVector);
                ship.Vel = newVel;
                ship.BeginStill();
            }
            else if (objB.ObjClass == "Rock")
            {
                WarShip ship = (WarShip)Sender;
                Vector2 newVel = CalMirrorVel(ship.Vel, result.NormalVector);
                ship.Vel = newVel;
                ship.BeginStill();
            }
        }
コード例 #53
0
ファイル: WarShip.cs プロジェクト: ingex0/smarttank
 public void CallOnCollied(IGameObj Sender, CollisionResult result, GameObjInfo objB)
 {
     if (OnCollied != null)
         OnCollied(Sender, result, objB);
 }
コード例 #54
0
ファイル: ShellNormal.cs プロジェクト: ingex0/smarttank
 void phiUpdater_OnCollied( IGameObj Sender, CollisionResult result, GameObjInfo objB )
 {
     if (onCollided != null)
         onCollided( this, result, objB );
 }
コード例 #55
0
ファイル: WarShip.cs プロジェクト: ingex0/smarttank
 void phisicalUpdater_OnCollied(IGameObj Sender, CollisionResult result, GameObjInfo objB)
 {
     if (OnCollied != null)
         InfoRePath.CallEvent(this.mgPath, "OnCollied", OnCollied, this, result, objB);
 }
コード例 #56
0
ファイル: ShellNormal.cs プロジェクト: ingex0/smarttank
 void phiUpdater_OnCollied(IGameObj Sender, CollisionResult result, GameObjInfo objB)
 {
     if (onCollided != null)
         //onCollided( this, result, objB );
         InfoRePath.CallEvent(this.MgPath, "onCollided", onCollided, this, result, objB);
 }
コード例 #57
0
ファイル: ShellNormal.cs プロジェクト: ingex0/smarttank
 public ShellNormal(string name, IGameObj firer, Vector2 startPos, float startAzi, float speed)
     : this(name, firer, startPos, startAzi, speed, "GameObjs\\ShellNormal", true, new Vector2(5, 0), 0.08f)
 {
 }
コード例 #58
0
ファイル: SceneKeeperCommon.cs プロジェクト: ingex0/smarttank
        public void RemoveGameObj ( IGameObj obj, bool asPhi, bool asShe, bool asRaderOwner, bool asEyeable, GameObjLayer layer )
        {
            if (obj == null)
                throw new NullReferenceException( "GameObj is null!" );

            if (asPhi && !(obj is IPhisicalObj))
                throw new Exception( "obj isn't a IPhisicalObj!" );
            if (!(obj is ICollideObj))
                throw new Exception( "obj isn't a ICollideObj!" );
            if (asShe && !(obj is IShelterObj))
                throw new Exception( "obj isn't a IShelterObj!" );
            if (asRaderOwner && !(obj is IRaderOwner))
                throw new Exception( "obj isn't a IRaderOwner!" );
            if (asEyeable && !(obj is IEyeableObj))
                throw new Exception( "obj isn't a IEyeableObj!" );

            SenceObjs.Remove( obj );

            if (asPhi)
                phisicalObjs.Remove( (IPhisicalObj)obj );
            if (asShe)
                tankRaderShelters.Remove( (IShelterObj)obj );
            if (asRaderOwner)
                tankRaderOwners.Remove( (IRaderOwner)obj );

            if (layer == GameObjLayer.Convace)
                concaveObjs.Remove( (ICollideObj)obj );
            else if (layer == GameObjLayer.LowBulge)
                lowBulgeObjs.Remove( (ICollideObj)obj );
            else if (layer == GameObjLayer.HighBulge)
                highBulgeObjs.Remove( (ICollideObj)obj );
            else if (layer == GameObjLayer.lowFlying)
                lowFlyingObjs.Remove( (ICollideObj)obj );
            else if (layer == GameObjLayer.highFlying)
                highFlyingObjs.Remove( (ICollideObj)obj );

            if (asEyeable)
            {
                visibleObjs.Remove( (IEyeableObj)obj );
            }

        }
コード例 #59
0
ファイル: ShellNormal.cs プロジェクト: ingex0/smarttank
 void phiUpdater_OnOverlap(IGameObj Sender, CollisionResult result, GameObjInfo objB)
 {
     if (onOverlap != null)
         //onOverlap( this, result, objB );
         InfoRePath.CallEvent(this.MgPath, "onOverlap", onOverlap, this, result, objB);
 }
コード例 #60
0
ファイル: DuelRule.cs プロジェクト: ingex0/smarttank
        void tank_onCollide( IGameObj Sender, CollisionResult result, GameObjInfo objB )
        {
            if (objB.ObjClass == "ShellNormal")
            {
                if (Sender == tank1)
                {
                    tank1.Live--;
                    // 在此添加效果
                    tank1.smoke.Concen += 0.2f;

                    if (tank1.Live <= 0 && !tank1.IsDead)
                    {
                        new Explode( tank1.Pos, 0 );

                        tank1.Dead();

                        new GameTimer( 3,
                            delegate()
                            {
                                MessageBox.Show( "Tank2胜利!" );
                                gameOver = true;
                            } );

                    }
                }
                else if (Sender == tank2)
                {
                    tank2.Live--;

                    tank2.smoke.Concen += 0.2f;
                    // 在此添加效果
                    if (tank2.Live <= 0 && !tank2.IsDead)
                    {
                        new Explode( tank2.Pos, 0 );

                        tank2.Dead();

                        new GameTimer( 3,
                            delegate()
                            {
                                MessageBox.Show( "Tank1胜利!" );
                                gameOver = true;
                            } );
                    }
                }
            }
        }