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


C# Game1类代码示例

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


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


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