Functional level generation + moving the submarine

This commit is contained in:
Regalis
2015-06-26 23:05:51 +03:00
parent bda9b31cbe
commit 9237a9efe2
48 changed files with 1629 additions and 750 deletions
@@ -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;