aboutsummaryrefslogtreecommitdiff
path: root/SuperPolarity/ActorManager.cs
diff options
context:
space:
mode:
authorBen Beltran <ben@nsovocal.com>2018-06-26 17:03:58 -0500
committerBen Beltran <ben@nsovocal.com>2018-06-26 17:03:58 -0500
commit9ad526c0233134a928cb5889dccb94458fc6dfd0 (patch)
treefa2282abbde8735b801125bb18294c7ec1847a92 /SuperPolarity/ActorManager.cs
parentae4f458103f5bfa44c833a147e7852e23cc02217 (diff)
Update source to compile on VS Studio for mac
Diffstat (limited to 'SuperPolarity/ActorManager.cs')
-rw-r--r--SuperPolarity/ActorManager.cs17
1 files changed, 16 insertions, 1 deletions
diff --git a/SuperPolarity/ActorManager.cs b/SuperPolarity/ActorManager.cs
index 56db26c..3a9b0db 100644
--- a/SuperPolarity/ActorManager.cs
+++ b/SuperPolarity/ActorManager.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -47,6 +47,11 @@ namespace SuperPolarity
foreach (Actor actor in Actors)
{
actor.Draw(spriteBatch);
+
+ if (actor.GetType ().IsAssignableFrom (typeof(MainShip))) {
+ var mainActor = (MainShip)actor;
+ mainActor.ResetEnemyModification ();
+ }
}
}
@@ -102,6 +107,16 @@ namespace SuperPolarity
var angle = (float) Math.Atan2(dy, dx);
var otherAngle = (float)Math.Atan2(-dy, -dx);
+ if (actor.GetType ().IsAssignableFrom (typeof(MainShip))) {
+ var mainActor = (MainShip)actor;
+ mainActor.UpdateEnemyModification (other);
+ }
+
+ if (other.GetType ().IsAssignableFrom (typeof(MainShip))) {
+ var mainOther = (MainShip)other;
+ mainOther.UpdateEnemyModification (actor);
+ }
+
if (linearDistance < actor.MagneticRadius || linearDistance < other.MagneticRadius)
{
actor.Magnetize(other, (float)linearDistance, angle);