Пример #1
0
        private void SceneInitial()
        {
            tank1 = new DuelTank("tank1", TankSinTur.M60TexPath, TankSinTur.M60Data, new Vector2(mapRect.X + 150 + RandomHelper.GetRandomFloat(-40, 40),
                                                                                                 mapRect.Y + 60 + RandomHelper.GetRandomFloat(-10, 10)),
                                 MathHelper.Pi + RandomHelper.GetRandomFloat(-MathHelper.PiOver4, MathHelper.PiOver4),
                                 "Tank1", tankRaderLength, tankMaxForwardSpd, tankMaxBackwardSpd, 10);
            tank2 = new DuelTank("tank2", TankSinTur.M1A2TexPath, TankSinTur.M1A2Data, new Vector2(mapRect.X + 150 + RandomHelper.GetRandomFloat(-40, 40),
                                                                                                   mapRect.Y + 160 + RandomHelper.GetRandomFloat(-10, 10)),
                                 RandomHelper.GetRandomFloat(-MathHelper.PiOver4, MathHelper.PiOver4),
                                 "Tank2", tankRaderLength, tankMaxForwardSpd, tankMaxBackwardSpd, 10);

            tank1.ShellSpeed = shellSpeed;
            tank2.ShellSpeed = shellSpeed;

            camera.Focus(tank1, true);

            sceneMgr.AddGroup("", new TypeGroup <DuelTank>("tank"));
            sceneMgr.AddGroup("", new TypeGroup <SmartTank.PhiCol.Border>("border"));
            sceneMgr.AddGroup("", new TypeGroup <ShellNormal>("shell"));
            sceneMgr.PhiGroups.Add("tank");
            sceneMgr.PhiGroups.Add("shell");
            sceneMgr.AddColMulGroups("tank", "border", "shell");
            sceneMgr.ShelterGroups.Add(new SceneMgr.MulPair("tank", new List <string>()));
            sceneMgr.VisionGroups.Add(new SceneMgr.MulPair("tank", new List <string>(new string[] { "tank" })));

            sceneMgr.AddGameObj("tank", tank1);
            sceneMgr.AddGameObj("tank", tank2);
            sceneMgr.AddGameObj("border", new SmartTank.PhiCol.Border(mapRect));
        }
Пример #2
0
        private void SceneInitial()
        {
            tank1 = new DuelTank( "tank1", TankSinTur.M60TexPath, TankSinTur.M60Data, new Vector2( mapRect.X + 150 + RandomHelper.GetRandomFloat( -40, 40 ),
                mapRect.Y + 60 + RandomHelper.GetRandomFloat( -10, 10 ) ),
                MathHelper.Pi + RandomHelper.GetRandomFloat( -MathHelper.PiOver4, MathHelper.PiOver4 ),
                "Tank1", tankRaderLength, tankMaxForwardSpd, tankMaxBackwardSpd, 10 );
            tank2 = new DuelTank( "tank2", TankSinTur.M1A2TexPath, TankSinTur.M1A2Data, new Vector2( mapRect.X + 150 + RandomHelper.GetRandomFloat( -40, 40 ),
                mapRect.Y + 160 + RandomHelper.GetRandomFloat( -10, 10 ) ),
                RandomHelper.GetRandomFloat( -MathHelper.PiOver4, MathHelper.PiOver4 ),
                "Tank2", tankRaderLength, tankMaxForwardSpd, tankMaxBackwardSpd, 10 );

            tank1.ShellSpeed = shellSpeed;
            tank2.ShellSpeed = shellSpeed;

            camera.Focus( tank1, true );

            sceneMgr.AddGroup( "", new TypeGroup<DuelTank>( "tank" ) );
            sceneMgr.AddGroup( "", new TypeGroup<SmartTank.PhiCol.Border>( "border" ) );
            sceneMgr.AddGroup( "", new TypeGroup<ShellNormal>( "shell" ) );
            sceneMgr.PhiGroups.Add( "tank" );
            sceneMgr.PhiGroups.Add( "shell" );
            sceneMgr.AddColMulGroups( "tank", "border", "shell" );
            sceneMgr.ShelterGroups.Add( new SceneMgr.MulPair( "tank", new List<string>() ) );
            sceneMgr.VisionGroups.Add( new SceneMgr.MulPair( "tank", new List<string>( new string[] { "tank" } ) ) );

            sceneMgr.AddGameObj( "tank", tank1 );
            sceneMgr.AddGameObj( "tank", tank2 );
            sceneMgr.AddGameObj( "border", new SmartTank.PhiCol.Border( mapRect ) );
        }