本文整理汇总了C#中Game1.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Game1.Add方法的具体用法?C# Game1.Add怎么用?C# Game1.Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Game1
的用法示例。
在下文中一共展示了Game1.Add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GameObject
public GameObject(Game1 game, GameObjectType type, String name, float size, Vector2 pos, float vel, bool draggable, int layer)
{
this.game = game;
this.name = name;
this.type = type;
this.img = game.Content.Load<Texture2D>("Graphics\\" + name);
this.size = size;
this.pos = pos;
this.vel = vel;
this.draggable = draggable;
this.layer = layer;
touched = false;
game.Add(this);
}
示例2: GameObject
protected Matrix transformation; // initial transformation
#endregion Fields
#region Constructors
public GameObject(Game1 game, Vector3 pos)
{
this.game = game;
Type = GameObjectType.None;
HitPoints = 0;
AttackSpeed = 0;
Damage = 0;
model = null;
modelName = "";
Scale = 1.0f;
transformation = Matrix.Identity;
color = Color.Transparent;
isCollidable = true;
isAlive = true;
collisionState = CollisionState.None;
attackCounter = 0;
this.pos = pos;
game.Add(this);
}