Functional level generation + moving the submarine
This commit is contained in:
@@ -215,7 +215,7 @@ namespace Subsurface.Items.Components
|
||||
{
|
||||
base.Move(amount);
|
||||
|
||||
LinkedGap.Move(amount);
|
||||
//LinkedGap.Move(amount);
|
||||
|
||||
body.SetTransform(body.Position + ConvertUnits.ToSimUnits(amount), 0.0f);
|
||||
|
||||
|
||||
@@ -41,12 +41,12 @@ namespace Subsurface.Items.Components
|
||||
|
||||
Rectangle miniMap = new Rectangle(x + 20, y + 40, width - 40, height - 60);
|
||||
|
||||
float size = Math.Min((float)miniMap.Width / (float)Map.Borders.Width, (float)miniMap.Height / (float)Map.Borders.Height);
|
||||
float size = Math.Min((float)miniMap.Width / (float)Submarine.Borders.Width, (float)miniMap.Height / (float)Submarine.Borders.Height);
|
||||
foreach (Hull hull in Hull.hullList)
|
||||
{
|
||||
Rectangle hullRect = new Rectangle(
|
||||
miniMap.X + (int)((hull.Rect.X - Map.Borders.X) * size),
|
||||
miniMap.Y - (int)((hull.Rect.Y - Map.Borders.Y) * size),
|
||||
miniMap.X + (int)((hull.Rect.X - Submarine.Borders.X) * size),
|
||||
miniMap.Y - (int)((hull.Rect.Y - Submarine.Borders.Y) * size),
|
||||
(int)(hull.Rect.Width * size),
|
||||
(int)(hull.Rect.Height * size));
|
||||
|
||||
@@ -71,8 +71,8 @@ namespace Subsurface.Items.Components
|
||||
if (c.animController.CurrentHull!=null) continue;
|
||||
|
||||
Rectangle characterRect = new Rectangle(
|
||||
miniMap.X + (int)((c.Position.X - Map.Borders.X) * size),
|
||||
miniMap.Y - (int)((c.Position.Y - Map.Borders.Y) * size),
|
||||
miniMap.X + (int)((c.Position.X - Submarine.Borders.X) * size),
|
||||
miniMap.Y - (int)((c.Position.Y - Submarine.Borders.Y) * size),
|
||||
5, 5);
|
||||
|
||||
GUI.DrawRectangle(spriteBatch, characterRect, Color.White, true);
|
||||
|
||||
@@ -109,8 +109,8 @@ namespace Subsurface.Items.Components
|
||||
ignoredBodies.Add(limb.body.FarseerBody);
|
||||
}
|
||||
|
||||
Body targetBody = Map.PickBody(TransformedBarrelPos, targetPosition, ignoredBodies);
|
||||
pickedPosition = Map.LastPickedPosition;
|
||||
Body targetBody = Submarine.PickBody(TransformedBarrelPos, targetPosition, ignoredBodies);
|
||||
pickedPosition = Submarine.LastPickedPosition;
|
||||
|
||||
if (targetBody==null || targetBody.UserData==null) return true;
|
||||
|
||||
|
||||
@@ -6,8 +6,7 @@ using System.Xml.Linq;
|
||||
namespace Subsurface.Items.Components
|
||||
{
|
||||
class ConnectionPanel : ItemComponent
|
||||
{
|
||||
|
||||
{
|
||||
public List<Connection> connections;
|
||||
|
||||
Character user;
|
||||
@@ -31,10 +30,20 @@ namespace Subsurface.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
public override void Move(Vector2 amount)
|
||||
{
|
||||
base.Move(amount);
|
||||
}
|
||||
//public override void Move(Vector2 amount)
|
||||
//{
|
||||
// base.Move(amount);
|
||||
|
||||
// foreach (Connection c in connections)
|
||||
// {
|
||||
// foreach (Wire w in c.wires)
|
||||
// {
|
||||
// if (w == null) continue;
|
||||
|
||||
// w.Move
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
public override void DrawHUD(SpriteBatch spriteBatch, Character character)
|
||||
{
|
||||
|
||||
@@ -35,6 +35,15 @@ namespace Subsurface.Items.Components
|
||||
connections = new Connection[2];
|
||||
}
|
||||
|
||||
public override void Move(Vector2 amount)
|
||||
{
|
||||
amount = FarseerPhysics.ConvertUnits.ToDisplayUnits(amount);
|
||||
for (int i = 0; i<nodes.Count; i++)
|
||||
{
|
||||
nodes[i] += amount;
|
||||
}
|
||||
}
|
||||
|
||||
public Connection OtherConnection(Connection connection)
|
||||
{
|
||||
if (connection == null) return null;
|
||||
|
||||
Reference in New Issue
Block a user