在DLL(GUI)中,我需要获取当前Application中所有命名空间的List(例如,如果我将该DLL绑定到名为"Hundekuchen"的Project中,它应该列出
{ "GUI", "Hundekuchen" }
Run Code Online (Sandbox Code Playgroud)
这有什么内置功能吗?
我希望导弹跟随一名遵循以下规则的玩家:
- 当玩家相对于导弹位于右侧时,以固定速率向右
更改旋转 - 否则以相同的速率向左更改旋转
if (missile.Rotation > 0 && missile.Rotation < Math.PI)
{
if (angle > missile.Rotation && angle < missile.Rotation + Math.PI)
{
missile.Rotation += 0.05f;
}
else
{
missile.Rotation -= 0.05f;
}
}
else
{
if (angle < missile.Rotation && angle > missile.Rotation - Math.PI)
{
missile.Rotation -= 0.05f;
}
else
{
missile.Rotation += 0.05f;
}
}
missile.Position += new Vector2((float)(5 * gameTime.ElapsedGameTime.TotalSeconds * Math.Cos(missile.Rotation)), (float)(5 * gameTime.ElapsedGameTime.TotalSeconds * Math.Sin(missile.Rotation)));
Run Code Online (Sandbox Code Playgroud)
有了这个代码,一些导弹似乎有虫子,当我与玩家一起跳跃时,导弹进入一个无法停止的无限循环(它们围成一圈飞行)
坐标系就像在XNA中(360°0°位于右侧,270°位于顶部......)
有人可以帮帮我吗?