• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Game1类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Game1的典型用法代码示例。如果您正苦于以下问题:C# Game1类的具体用法?C# Game1怎么用?C# Game1使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Game1类属于命名空间,在下文中一共展示了Game1类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Recepteur

 /// <summary>
 /// Constructeur
 /// </summary>
 /// <param name="port">Port d'ecoute</param>
 /// <param name="cl"></param>
 public Recepteur(int port, Game1 cl)
 {
     this._client = cl;
     this._portReception = port;
     this._ip = GestionReseau.GetMyLocalIp();
     _reception = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
 }
开发者ID:Chapelin,项目名称:XNAGitTest,代码行数:12,代码来源:Recepteur.cs


示例2: Button

        public Button(Texture2D texture, Vector2 position, string text, SpriteFont font, Game1 game)
            : base(position)
        {
            base.Text = text;
            this.texture = texture;
            this.Font = font;
            bounds = new Rectangle((int)position.X, (int)position.Y, texture.Width, texture.Height);

            switch (Text) {
                case "Create":
                    change = MenuState.Create;
                    break;
                case "Join":
                    change = MenuState.Join;
                    break;
                case "Exit to menu":
                case "Back":
                    change = MenuState.Menu;
                    break;
                default:
                    change = null;
                    break;
            }

            if (Text.Contains("Level")) change = MenuState.Start;
            WireUpEvents(game);
        }
开发者ID:Konjo,项目名称:PracProj,代码行数:27,代码来源:Button.cs


示例3: BaseObject

 /// <summary>
 /// Конструктор класса
 /// </summary>
 /// <param name="Rect">прямоугольник объекта</param>
 /// <param name="texture">текстура объекта</param>
 /// <param name="game">ссылка на игру</param>
 /// <param name="camera">ссылка на камеру</param>
 public BaseObject(Rectangle Rect, Texture2D texture, Game1 game, Camera camera)
 {
     this.Rect = Rect;
     this.texture = texture;
     this.game = game;
     this.camera = camera;
 }
开发者ID:Aleksandr175,项目名称:SimpleGame,代码行数:14,代码来源:BaseObject.cs


示例4: Draw

        public void Draw(SpriteBatch sb, Game1 game)
        {
            float Lenght = (float)Math.Sqrt((p1.X - p2.X) * (p1.X - p2.X) + (p1.Y - p2.Y) * (p1.Y - p2.Y));
            float Angle = (float)Math.Atan2(p1.Y - p2.Y, p1.X - p2.X) - (float)Math.PI;
            Rectangle sourceRectangle = new Rectangle(0, 0, 1, 1);
            Vector2 origin = new Vector2(0f, 0.5f);

            Color color = Color;
            //if (color == game.ColorToChange)
            //    color = game.NewColor;
            if (Owner != null && (game.WinningTeam == Owner.Team && game.ShouldFlash && !Owner.Dead))
                color = new Color(Color.R / 2, Color.G / 2, Color.B / 2);

            if (Owner == null || Owner.Dead)
            {
                color.R >>= 2;
                color.G >>= 2;
                color.B >>= 2;
                color.A >>= 2;
            }

            if (game.Paused)
            {
                color.R >>= 2;
                color.G >>= 2;
                color.B >>= 2;
                color.A >>= 2;
            }

            sb.Draw(Texture, new Rectangle((int)p1.X, (int)p1.Y, (int)Lenght, 2), null, color, Angle, origin, SpriteEffects.None, 1);
        }
开发者ID:popoffka,项目名称:Achtung,代码行数:31,代码来源:Wall.cs


示例5: AABBCollisionRenderSystem

 public AABBCollisionRenderSystem(Game1 game)
     : base(game)
 {
     this._componentDependencies.Add(ComponentType.Position);
     this._componentDependencies.Add(ComponentType.AABBCollision);
     this._componentDependencies.Add(ComponentType.Color);
 }
开发者ID:patpaquette,项目名称:SSB-clone,代码行数:7,代码来源:AABBCollisionRenderSystem.cs


示例6: FirstBossSprite

        public FirstBossSprite(Game1 game, Texture2D textureImage, Vector2 position,
            Point frameSize, int collisionOffset, Point currentFrame, Point sheetSize,
            Vector2 speed, bool animate, int life, int millisecondsPerFrame)
            : base(game, textureImage, position, frameSize, collisionOffset, currentFrame,
            sheetSize, speed, animate, life * (int)InGameScreen.difficulty, millisecondsPerFrame)
        {
            alive = true;

            scoreAmount = 60;

            warningTexture = new Texture2D(game.GraphicsDevice, 1, 1);
            warningTexture.SetData<Color>(colorData);

            laserStruckTarget = false;

            //Creates the left hitbox.
            hitBox.X = 37 + (int)position.X;
            hitBox.Y = 156 + (int)position.Y;
            hitBox.Width = 30;
            hitBox.Height = 47;

            //Creates the right hitbox.
            nonMoveableBossHitbox.X = 121 + (int)position.X;
            nonMoveableBossHitbox.Y = 147 + (int)position.Y;
            nonMoveableBossHitbox.Width = 30;
            nonMoveableBossHitbox.Height = 47;
        }
开发者ID:hk222gn,项目名称:Supesu,代码行数:27,代码来源:FirstBossSprite.cs


示例7: SplashScreen

 public SplashScreen(Game game)
     : base(game)
 {
     this.game = game;
     game1 = (Game1)game;
     // TODO: Construct any child components here
 }
开发者ID:sirchip,项目名称:sadc-gamejam-test,代码行数:7,代码来源:SplashScreen.cs


示例8: PauseMenu

 public PauseMenu(IGameState prevGameState, Game1 game)
 {
     this.game = game;
     this.prevGameState = prevGameState;
     currentSelection = Selections.Resume;
     font = MenuSpriteFactory.CreateHUDFont();
 }
开发者ID:Bartholomew-m134,项目名称:BuckeyeGameEngine,代码行数:7,代码来源:PauseMenu.cs


示例9: BeamBit

 public BeamBit(Game1 game, BeamPool pool)
     : base(game)
 {
     Pool = pool;
     AssetName = "shipBullet";
     AddAnimation("shot", FrameSequence(0, 1), TimingSequence(5, 1), true);
 }
开发者ID:JoeOsborn,项目名称:Cyclyc,代码行数:7,代码来源:BeamBit.cs


示例10: BaseGameState

        public BaseGameState(Game game, GameStateManager manager)
            : base(game, manager)
        {
            GameRef = (Game1)game;

            playerIndexInControl = PlayerIndex.One;
        }
开发者ID:brollins90,项目名称:eotd,代码行数:7,代码来源:BaseGameState.cs


示例11: BootstrapLoad

        public BootstrapLoad(Game1 game, IScreen nextScreen, IScreen errorScreen, Action<Action, Action<String>> load)
        {
            Next = nextScreen;
            this.game = game;

            loadingThread = new Thread(a => load(() => complete = true, s => strings.Push(s)));
        }
开发者ID:martindevans,项目名称:DistributedServiceProvider,代码行数:7,代码来源:BootstrapLoad.cs


示例12: ColonyShip

 public ColonyShip(Game1 game, World world, float ratio, string texturePath, Player player)
     : base(game, world, texturePath)
 {
     _texture = Content.Load<Texture2D>(texturePath);
     _ratio = ratio;
     this.player = player;
 }
开发者ID:RiltonF,项目名称:MonogameAsteroids,代码行数:7,代码来源:ColonyShip.cs


示例13: ParticleSystem

 protected ParticleSystem(Game1 game, int howManyEffects, string textureFileName)
     : base(game)
 {
     this.game = game;
     this.howManyEffects = howManyEffects;
     this.textureFilename = textureFileName;
 }
开发者ID:josiah1888,项目名称:game-dev,代码行数:7,代码来源:ParticleSystem.cs


示例14: HandRenderer1

 public HandRenderer1(Game1 game)
     : base(game)
 {
     this._componentDependencies.Add(ComponentType.Hand);
     this._componentDependencies.Add(ComponentType.Player);
     this._game = game;
 }
开发者ID:patpaquette,项目名称:SSB-clone,代码行数:7,代码来源:HandRenderer1.cs


示例15: DoublePipe

 public DoublePipe(IGameState gameState, Game1 game)
 {
     myGame = game;
     pipeSprite = TileSpriteFactory.CreateDoublePipeSprite();
     isWarpPipe = true;
     this.gameState = gameState;
 }
开发者ID:Bartholomew-m134,项目名称:BuckeyeGameEngine,代码行数:7,代码来源:DoublePipe.cs


示例16: Card

 public Card(Game1 game, int x, int y)
 {
     this.game = game;
     this.x = x;
     this.y = y;
     LoadImage();
 }
开发者ID:Epik8000,项目名称:Black-Jack-Game,代码行数:7,代码来源:Card.cs


示例17: GameState

 public GameState(Game1 game, GameStateManager manager)
     : base(game)
 {
     StateManager = manager;
     childComponents = new List<GameComponent>();
     tag = this;
 }
开发者ID:RainbowCupcake,项目名称:MLPTheMasterQuest,代码行数:7,代码来源:GameState.cs


示例18: ArrowInputSystem

 public ArrowInputSystem(Game1 game, int playerNum)
     : base(game)
 {
     this._componentDependencies.Add(ComponentType.Player);
     this._componentDependencies.Add(ComponentType.Arrow);
     this.playerNumber = playerNum;
 }
开发者ID:patpaquette,项目名称:SSB-clone,代码行数:7,代码来源:ArrowInputSystem.cs


示例19: LevelThree

        public LevelThree(Game1 game)
            : base(game)
        {
            _questions["*"].Add("3,2");
            _questions["*"].Add("4,5");
            _questions["*"].Add("2,4");
            _questions["*"].Add("1,2");
            _questions["*"].Add("3,1");
            _questions["*"].Add("6,2");
            _questions["*"].Add("4,1");
            _questions["*"].Add("1,1");
            _questions["*"].Add("2,5");
            _questions["*"].Add("4,3");
            _questions["*"].Add("3,3");
            _questions["*"].Add("4,4");

            _questions["/"].Add("16,4");
            _questions["/"].Add("20,5");
            _questions["/"].Add("10,2");
            _questions["/"].Add("15,3");
            _questions["/"].Add("8,4");
            _questions["/"].Add("4,4");
            _questions["/"].Add("12,2");
            _questions["/"].Add("2,1");
            _questions["/"].Add("18,9");
            _questions["/"].Add("9,3");
            _questions["/"].Add("24,3");
            _questions["/"].Add("28,4");
            _mountain.Texture = AssetManager.Textures[Assets.GAME_MOUNTAIN_3];
            _mountain.Location.Y += 75;
            GenerateQuestion();
        }
开发者ID:Sedatb23,项目名称:Kapitein-Kat,代码行数:32,代码来源:LevelThree.cs


示例20: MovingGameObject

 public MovingGameObject(Game1 game)
     : base(game)
 {
     velocity = new InterpolatedVector2GameObjectMember(this, new Vector2(0));
     angularSpeed = new FloatGameObjectMember(this, 0);
     targetAngle = new FloatGameObjectMember(this, 0);
 }
开发者ID:BenAndJoelAlexander,项目名称:BulletHellGame,代码行数:7,代码来源:MovingGameObject.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# GameAction类代码示例发布时间:2022-05-24
下一篇:
C# Game类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap