A* pathfinding, autopilot, WIP radar rendering, proper location names, character skills shown in menus, got rid of PreviewCharacter, mantis
This commit is contained in:
@@ -200,7 +200,7 @@ namespace Subsurface
|
||||
|
||||
if (Vector2.Distance(PlayerInput.MousePosition, limbBodyPos)<5.0f && PlayerInput.LeftButtonDown())
|
||||
{
|
||||
limb.sprite.Origin -= PlayerInput.MouseSpeed;
|
||||
limb.sprite.Origin += PlayerInput.MouseSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,17 +259,30 @@ namespace Subsurface
|
||||
|
||||
if (joint.BodyA == limb.body.FarseerBody)
|
||||
{
|
||||
jointPos = limbBodyPos + ConvertUnits.ToDisplayUnits(joint.LocalAnchorA);
|
||||
jointPos = ConvertUnits.ToDisplayUnits(joint.LocalAnchorA);
|
||||
|
||||
}
|
||||
else if (joint.BodyB == limb.body.FarseerBody)
|
||||
{
|
||||
jointPos = limbBodyPos + ConvertUnits.ToDisplayUnits(joint.LocalAnchorB);
|
||||
jointPos = ConvertUnits.ToDisplayUnits(joint.LocalAnchorB);
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
jointPos.Y = -jointPos.Y;
|
||||
jointPos += limbBodyPos;
|
||||
if (joint.BodyA == limb.body.FarseerBody)
|
||||
{
|
||||
float a1 = joint.UpperLimit - MathHelper.PiOver2;
|
||||
float a2 = joint.LowerLimit - MathHelper.PiOver2;
|
||||
float a3 =( a1+a2)/2.0f;
|
||||
GUI.DrawLine(spriteBatch, jointPos, jointPos + new Vector2((float)Math.Cos(a1), -(float)Math.Sin(a1)) * 30.0f, Color.Green);
|
||||
GUI.DrawLine(spriteBatch, jointPos, jointPos + new Vector2((float)Math.Cos(a2), -(float)Math.Sin(a2)) * 30.0f, Color.DarkGreen);
|
||||
|
||||
GUI.DrawLine(spriteBatch, jointPos, jointPos + new Vector2((float)Math.Cos(a3), -(float)Math.Sin(a3)) * 30.0f, Color.LightGray);
|
||||
}
|
||||
|
||||
GUI.DrawRectangle(spriteBatch, jointPos, new Vector2(5.0f, 5.0f), Color.Red, true);
|
||||
if (Vector2.Distance(PlayerInput.MousePosition, jointPos) < 6.0f)
|
||||
@@ -277,13 +290,15 @@ namespace Subsurface
|
||||
GUI.DrawRectangle(spriteBatch, jointPos - new Vector2(3.0f, 3.0f), new Vector2(11.0f, 11.0f), Color.Red, false);
|
||||
if (PlayerInput.LeftButtonDown())
|
||||
{
|
||||
Vector2 speed = ConvertUnits.ToSimUnits(PlayerInput.MouseSpeed);
|
||||
speed.Y = -speed.Y;
|
||||
if (joint.BodyA == limb.body.FarseerBody)
|
||||
{
|
||||
joint.LocalAnchorA += ConvertUnits.ToSimUnits(PlayerInput.MouseSpeed);
|
||||
joint.LocalAnchorA += speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
joint.LocalAnchorB += ConvertUnits.ToSimUnits(PlayerInput.MouseSpeed);
|
||||
joint.LocalAnchorB += speed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user