electricity bugfixes, destructable doors, ai improvements, removed rope, container changes
This commit is contained in:
@@ -31,12 +31,18 @@ namespace Subsurface.Particles
|
||||
private Vector2 drawPosition;
|
||||
|
||||
private float checkCollisionTimer;
|
||||
|
||||
|
||||
public bool InWater
|
||||
{
|
||||
get { return prefab.inWater; }
|
||||
}
|
||||
|
||||
public Vector2 yLimits
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public Vector2 Size
|
||||
{
|
||||
get { return size; }
|
||||
@@ -49,7 +55,7 @@ namespace Subsurface.Particles
|
||||
set { velocityChange = value; }
|
||||
}
|
||||
|
||||
public void Init(Vector2 position, float rotation, Vector2 speed, ParticlePrefab prefab)
|
||||
public void Init(ParticlePrefab prefab, Vector2 position, Vector2 speed, float rotation)
|
||||
{
|
||||
this.prefab = prefab;
|
||||
|
||||
@@ -73,13 +79,13 @@ namespace Subsurface.Particles
|
||||
|
||||
rand = (float)Game1.localRandom.NextDouble();
|
||||
sizeChange = prefab.sizeChangeMin + (prefab.sizeChangeMax - prefab.sizeChangeMin) * rand;
|
||||
|
||||
|
||||
yLimits = Vector2.Zero;
|
||||
|
||||
color = prefab.startColor;
|
||||
alpha = prefab.startAlpha;
|
||||
|
||||
velocityChange = prefab.velocityChange;
|
||||
|
||||
velocityChange = prefab.velocityChange;
|
||||
}
|
||||
|
||||
public bool Update(float deltaTime)
|
||||
@@ -110,6 +116,14 @@ namespace Subsurface.Particles
|
||||
color.G / 255.0f + prefab.colorChange.Y * deltaTime,
|
||||
color.B / 255.0f + prefab.colorChange.Z * deltaTime);
|
||||
|
||||
if (yLimits!=Vector2.Zero)
|
||||
{
|
||||
if (position.Y>yLimits.X || position.Y<yLimits.Y)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (prefab.deleteOnHit)
|
||||
{
|
||||
if (checkCollisionTimer > 0.0f)
|
||||
|
||||
Reference in New Issue
Block a user