本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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);
}
示例5: AABBCollisionRenderSystem
public AABBCollisionRenderSystem(Game1 game)
: base(game)
{
this._componentDependencies.Add(ComponentType.Position);
this._componentDependencies.Add(ComponentType.AABBCollision);
this._componentDependencies.Add(ComponentType.Color);
}
示例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;
}
示例7: SplashScreen
public SplashScreen(Game game)
: base(game)
{
this.game = game;
game1 = (Game1)game;
// TODO: Construct any child components here
}
示例8: PauseMenu
public PauseMenu(IGameState prevGameState, Game1 game)
{
this.game = game;
this.prevGameState = prevGameState;
currentSelection = Selections.Resume;
font = MenuSpriteFactory.CreateHUDFont();
}
示例9: BeamBit
public BeamBit(Game1 game, BeamPool pool)
: base(game)
{
Pool = pool;
AssetName = "shipBullet";
AddAnimation("shot", FrameSequence(0, 1), TimingSequence(5, 1), true);
}
示例10: BaseGameState
public BaseGameState(Game game, GameStateManager manager)
: base(game, manager)
{
GameRef = (Game1)game;
playerIndexInControl = PlayerIndex.One;
}
示例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)));
}
示例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;
}
示例13: ParticleSystem
protected ParticleSystem(Game1 game, int howManyEffects, string textureFileName)
: base(game)
{
this.game = game;
this.howManyEffects = howManyEffects;
this.textureFilename = textureFileName;
}
示例14: HandRenderer1
public HandRenderer1(Game1 game)
: base(game)
{
this._componentDependencies.Add(ComponentType.Hand);
this._componentDependencies.Add(ComponentType.Player);
this._game = game;
}
示例15: DoublePipe
public DoublePipe(IGameState gameState, Game1 game)
{
myGame = game;
pipeSprite = TileSpriteFactory.CreateDoublePipeSprite();
isWarpPipe = true;
this.gameState = gameState;
}