本文整理汇总了C#中Platform.getMidPoint方法的典型用法代码示例。如果您正苦于以下问题:C# Platform.getMidPoint方法的具体用法?C# Platform.getMidPoint怎么用?C# Platform.getMidPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Platform
的用法示例。
在下文中一共展示了Platform.getMidPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadContent
/// <summary>
/// LoadContent will be called once per game and is the place to load
/// all of your content.
/// </summary>
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
childComponent = new List<GameObject>();
platform = new Platform(new Rectangle(GraphicsDevice.Viewport.Width / 5 + 28, 10, 445, 650), this.Content);
guage = new Guage(new Rectangle(platform.Position.X + platform.Position.Width + 2, 10, 100, 650), this.Content);
Vector2 startingPos = platform.getMidPoint();
player = new Munchlit(new Rectangle((int)startingPos.X, (int)startingPos.Y, 30, 30), this.Content);
childComponent.Add(platform);
childComponent.Add(guage);
childComponent.Add(player);
for (int i = platform.Position.X + 12; i <= platform.Position.X + platform.Position.Width - 24; i += 30)
{
Console.WriteLine(i);
childComponent.Add(new Meteor(new Rectangle(i, platform.Position.Y + platform.Position.Height - 45, 30, 30), this.Content, 0));
}
// TODO: use this.Content to load your game content here
}