当前位置: 首页>>代码示例>>C#>>正文


C# Car.CopyCat方法代码示例

本文整理汇总了C#中Car.CopyCat方法的典型用法代码示例。如果您正苦于以下问题:C# Car.CopyCat方法的具体用法?C# Car.CopyCat怎么用?C# Car.CopyCat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Car的用法示例。


在下文中一共展示了Car.CopyCat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Init

        public override void Init()
        {
            Player player = Player.Singleton;
            CarGarage garage = CarGarage.Singleton;
            NpcManager npcManager = NpcManager.Singleton;
            Game1 game = Game1.Singleton;
            ContentManager content = game.Content;

            Song themeSong = content.Load<Song>("Sounds\\Shop_Theme");
            MediaPlayer.Volume = 0.25f;
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Play(themeSong);

            Entity background = new Entity();
            background.TexturePath = "Backgrounds\\Shop";
            entities.Add(background);

            Entity statusBackground = new Entity();
            statusBackground.Position = new Vector2(665, 50);
            statusBackground.TexturePath = "UI\\Status";
            entities.Add(statusBackground);

            playerCar.CopyCat(garage.Get(player.CarName));
            playerCar.Position = new Vector2(700, 70);
            entities.Add(playerCar);

            Text newText;
            newText = new Text();
            newText.FontPath = "Fonts\\DefaultFont";
            newText.Color = Color.Black;
            newText.Position = new Vector2(690, 170);
            newText.String = "Money:";
            entities.Add(newText);

            newText = new Text();
            newText.FontPath = "Fonts\\DefaultFont";
            newText.Color = Color.Black;
            newText.Position = new Vector2(690, 190);
            newText.String = "$" + player.Money;
            newText.Type = "PlayerMoneyText";
            entities.Add(newText);

            newText = new Text();
            newText.FontPath = "Fonts\\DefaultFont";
            newText.Color = Color.Black;
            newText.Position = new Vector2(690, 210);
            newText.String = "Debt:";
            entities.Add(newText);

            newText = new Text();
            newText.FontPath = "Fonts\\DefaultFont";
            newText.Color = Color.Black;
            newText.Position = new Vector2(690, 230);
            newText.String = "$" + player.Debt;
            newText.Type = "PlayerDebt";
            entities.Add(newText);

            Entity whiteArea;
            whiteArea = new Entity();
            whiteArea.TexturePath = "UI\\Whitearea";
            whiteArea.Position = new Vector2(75, 50);
            entities.Add(whiteArea);

            whiteArea = new Entity();
            whiteArea.TexturePath = "UI\\Whitearea";
            whiteArea.Position = new Vector2(275, 50);
            entities.Add(whiteArea);

            whiteArea = new Entity();
            whiteArea.TexturePath = "UI\\Whitearea";
            whiteArea.Position = new Vector2(475, 50);
            entities.Add(whiteArea);

            Button newButton;
            newButton = new Button();
            newButton.TexturePath = "UI\\Shop_Red";
            newButton.Link = "Red";
            newButton.OnClick += new Button.ButtonEventDelegate(buyButton_OnClick);
            newButton.Position = new Vector2(65, 50);
            entities.Add(newButton);

            Entity newIntroduce;
            newIntroduce = new Entity();
            newIntroduce.TexturePath = "UI\\Introduce1";
            newIntroduce.Position = new Vector2(65, 180);
            entities.Add(newIntroduce);

            newButton = new Button();
            newButton.TexturePath = "UI\\Shop_Yellow";
            newButton.Link = "Yellow";
            newButton.OnClick += new Button.ButtonEventDelegate(buyButton_OnClick);
            newButton.Position = new Vector2(265, 50);
            entities.Add(newButton);

            newIntroduce = new Entity();
            newIntroduce.TexturePath = "UI\\Introduce2";
            newIntroduce.Position = new Vector2(265, 180);
            entities.Add(newIntroduce);

            newButton = new Button();
//.........这里部分代码省略.........
开发者ID:iAmGhost,项目名称:OverDrive,代码行数:101,代码来源:Shop.cs

示例2: Init

        public override void Init()
        {
            Game1.Singleton.IsMouseVisible = true;
            ContentManager content = Game1.Singleton.Content;

            Song themeSong = content.Load<Song>("Sounds\\Menu_Theme");
            MediaPlayer.Volume = 0.35f;
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Play(themeSong);

            CarGarage garage = CarGarage.Singleton;
            Player player = Player.Singleton;

            Entity background = new Entity();
            background.TexturePath = "Backgrounds\\Menu";
            entities.Add(background);

            Entity statusBackground = new Entity();
            statusBackground.Position = new Vector2(665, 50);
            statusBackground.TexturePath = "UI\\Status";
            entities.Add(statusBackground);

            Text newText;
            newText = new Text();
            newText.FontPath = "Fonts\\DefaultFont";
            newText.Color = Color.Black;
            newText.Position = new Vector2(690, 170);
            newText.String = "Money:";
            entities.Add(newText);

            newText = new Text();
            newText.FontPath = "Fonts\\DefaultFont";
            newText.Color = Color.Black;
            newText.Position = new Vector2(690, 190);
            newText.String = "$" + player.Money;
            newText.Type = "PlayerMoneyText";
            entities.Add(newText);

            newText = new Text();
            newText.FontPath = "Fonts\\DefaultFont";
            newText.Color = Color.Black;
            newText.Position = new Vector2(690, 210);
            newText.String = "Debt:";
            entities.Add(newText);

            newText = new Text();
            newText.FontPath = "Fonts\\DefaultFont";
            newText.Color = Color.Black;
            newText.Position = new Vector2(690, 230);
            newText.String = "$" + player.Debt;
            newText.Type = "PlayerDebt";
            entities.Add(newText);

            Button newButton;

            newButton = new Button();
            newButton.TexturePath = "UI\\Easy";
            newButton.Link = "Easy";
            newButton.Position = new Vector2(70, 80);
            newButton.OnClick += new Button.ButtonEventDelegate(Button_OnClick);
            entities.Add(newButton);

            newButton = new Button();
            newButton.TexturePath = "UI\\Normal";
            newButton.Link = "Normal";
            newButton.Position = new Vector2(70, 205);
            newButton.OnClick += new Button.ButtonEventDelegate(Button_OnClick);
            entities.Add(newButton);

            newButton = new Button();
            newButton.TexturePath = "UI\\Hard";
            newButton.Link = "Hard";
            newButton.Position += new Vector2(70, 330);
            newButton.OnClick += new Button.ButtonEventDelegate(Button_OnClick);
            entities.Add(newButton);

            newButton = new Button();
            newButton.TexturePath = "UI\\Shop";
            newButton.Link = "Shop";
            newButton.Position = new Vector2(0, 550);
            newButton.OnClick += new Button.ButtonEventDelegate(Button_OnClick);
            entities.Add(newButton);

            newButton = new Button();
            newButton.TexturePath = "UI\\Bank";
            newButton.Link = "Bank";
            newButton.Position = new Vector2(160, 550);
            newButton.OnClick += new Button.ButtonEventDelegate(Button_OnClick);
            entities.Add(newButton);

            newButton = new Button();
            newButton.TexturePath = "UI\\Exit";
            newButton.Link = "Exit";
            newButton.Position = new Vector2(675, 550);
            newButton.OnClick += new Button.ButtonEventDelegate(Button_OnClick);
            entities.Add(newButton);

            Car car = new Car();
            car.CopyCat(garage.Get(player.CarName));
            car.Position = new Vector2(700, 70);
//.........这里部分代码省略.........
开发者ID:iAmGhost,项目名称:OverDrive,代码行数:101,代码来源:Menu.cs


注:本文中的Car.CopyCat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。