Infinite wall fixes, pressure damage to sub, sub/mode voting & randomization working now, better ui scaling

This commit is contained in:
Regalis
2015-10-31 00:29:51 +02:00
parent dc4b502248
commit bcc96cee97
33 changed files with 1068 additions and 151 deletions
@@ -37,10 +37,35 @@ namespace Barotrauma
public override void Start(Level level)
{
Vector2 position = level.PositionsOfInterest[Rand.Int(level.PositionsOfInterest.Count, false)];
Vector2 position = Vector2.Zero;
int tries = 0;
do
{
Vector2 tryPos = level.PositionsOfInterest[Rand.Int(level.PositionsOfInterest.Count, false)];
if (Submarine.PickBody(
tryPos + level.Position,
tryPos + level.Position - Vector2.UnitY*level.Size.Y,
null, Physics.CollisionLevel) != null)
{
position = tryPos;
break;
}
tries++;
if (tries==10)
{
position = level.EndPosition - Vector2.UnitY*300.0f;
}
} while (tries < 10);
item = new Item(itemPrefab, position + level.Position);
item.MoveWithLevel = true;
item.body.FarseerBody.GravityScale = 0.5f;
//item.MoveWithLevel = true;
}