diff --git a/src/Core/Entity.bf b/src/Core/Entity.bf index cbcaf91..548ddd8 100644 --- a/src/Core/Entity.bf +++ b/src/Core/Entity.bf @@ -338,7 +338,7 @@ namespace Strawberry public bool Check() where T : Entity { - for (var e in Scene.All(scope List)) + for (var e in Scene.All(scope List())) if (Check(e)) return true; @@ -347,7 +347,7 @@ namespace Strawberry public bool Check(Point offset) where T : Entity { - for (var e in Scene.All(scope List)) + for (var e in Scene.All(scope List())) if (Check(e, offset)) return true; @@ -356,7 +356,7 @@ namespace Strawberry public bool CheckOutside(Point offset) where T : Entity { - for (var e in Scene.All(scope List)) + for (var e in Scene.All(scope List())) if (CheckOutside(e, offset)) return true; @@ -365,7 +365,7 @@ namespace Strawberry public T First() where T : Entity { - for (var e in Scene.All(scope List)) + for (var e in Scene.All(scope List())) if (Check(e)) return e; @@ -374,7 +374,7 @@ namespace Strawberry public T First(Point offset) where T : Entity { - for (var e in Scene.All(scope List)) + for (var e in Scene.All(scope List())) if (Check(e, offset)) return e; @@ -383,7 +383,7 @@ namespace Strawberry public T FirstOutside(Point offset) where T : Entity { - for (var e in Scene.All(scope List)) + for (var e in Scene.All(scope List())) if (CheckOutside(e, offset)) return e; @@ -392,7 +392,7 @@ namespace Strawberry public List All(List into) where T : Entity { - for (var e in Scene.All(scope List)) + for (var e in Scene.All(scope List())) if (Check(e)) into.Add(e); @@ -401,7 +401,7 @@ namespace Strawberry public List All(Point offset, List into) where T : Entity { - for (var e in Scene.All(scope List)) + for (var e in Scene.All(scope List())) if (Check(e, offset)) into.Add(e); @@ -410,7 +410,7 @@ namespace Strawberry public List AllOutside(Point offset, List into) where T : Entity { - for (var e in Scene.All(scope List)) + for (var e in Scene.All(scope List())) if (CheckOutside(e, offset)) into.Add(e); diff --git a/src/Physics/Actor.bf b/src/Physics/Actor.bf index a23d1aa..3ca4063 100644 --- a/src/Physics/Actor.bf +++ b/src/Physics/Actor.bf @@ -43,7 +43,7 @@ namespace Strawberry MovedByGeometry = Point.Zero; } - public bool MoveX(float amount, Action onCollide = null) + public bool MoveX(float amount, delegate void(Collision) onCollide = null) { remainder.X += amount; let move = (int)Math.Round(remainder.X); @@ -56,7 +56,7 @@ namespace Strawberry return false; } - public bool MoveY(float amount, Action onCollide = null) + public bool MoveY(float amount, delegate void(Collision) onCollide = null) { remainder.Y += amount; let move = (int)Math.Round(remainder.Y); @@ -72,16 +72,16 @@ namespace Strawberry [Inline] public void MoveToX(float x) { - MoveX(x - (X + remainder.X)); + MoveX(x - (X + remainder.X), null); } [Inline] public void MoveToY(float y) { - MoveY(y - (Y + remainder.Y)); + MoveY(y - (Y + remainder.Y), null); } - public bool MoveExactX(int amount, Action onCollide = null, Geometry pusher = null, Geometry carrier = null) + public bool MoveExactX(int amount, delegate void(Collision) onCollide = null, Geometry pusher = null, Geometry carrier = null) { int move = amount; int sign = Math.Sign(amount); @@ -127,7 +127,7 @@ namespace Strawberry return false; } - public bool MoveExactY(int amount, Action onCollide = null, Geometry pusher = null, Geometry carrier = null) + public bool MoveExactY(int amount, delegate void(Collision) onCollide = null, Geometry pusher = null, Geometry carrier = null) { int move = amount; int sign = Math.Sign(amount); @@ -195,5 +195,22 @@ namespace Strawberry { MovedByGeometry += amount; } + + + public bool CornerCorrection(Cardinals direction, int maxAmount, int lookAhead = 1, int onlySign = 0) + { + Point pt = direction; + + if (pt.X != 0) + { + + } + else + { + + } + + return false; + } } } diff --git a/src/Physics/JumpThru.bf b/src/Physics/JumpThru.bf index 9632a95..1605108 100644 --- a/src/Physics/JumpThru.bf +++ b/src/Physics/JumpThru.bf @@ -20,7 +20,7 @@ namespace Strawberry { if (Collidable) { - let riders = GetRiders(scope List); + let riders = GetRiders(scope List()); X += amount; for (var a in riders) @@ -34,11 +34,11 @@ namespace Strawberry { if (Collidable) { - let riders = GetRiders(scope List); + let riders = GetRiders(scope List()); if (amount < 0) { - for (var a in Scene.All(scope List)) + for (var a in Scene.All(scope List())) { if (riders.Contains(a) || CheckOutside(a, Point.UnitY * amount)) { @@ -65,7 +65,7 @@ namespace Strawberry public override List GetRiders(List into) { - for (var a in Scene.All(scope List)) + for (var a in Scene.All(scope List())) if (a.IsRiding(this)) into.Add(a); return into; diff --git a/src/Physics/Solid.bf b/src/Physics/Solid.bf index 566ed96..8044c07 100644 --- a/src/Physics/Solid.bf +++ b/src/Physics/Solid.bf @@ -12,7 +12,7 @@ namespace Strawberry public override List GetRiders(List into) { - for (var a in Scene.All(scope List)) + for (var a in Scene.All(scope List())) if (a.IsRiding(this)) into.Add(a); return into; @@ -22,12 +22,12 @@ namespace Strawberry { if (Collidable) { - let riders = GetRiders(scope List); + let riders = GetRiders(scope List()); X += amount; Collidable = false; - for (Actor a in Scene.All(scope List)) + for (Actor a in Scene.All(scope List())) { if (Check(a)) { @@ -56,12 +56,12 @@ namespace Strawberry { if (Collidable) { - let riders = GetRiders(scope List); + let riders = GetRiders(scope List()); Y += amount; Collidable = false; - for (Actor a in Scene.All(scope List)) + for (Actor a in Scene.All(scope List())) { if (Check(a)) { diff --git a/src/Static/Calc.bf b/src/Static/Calc.bf index a70e19e..1339c31 100644 --- a/src/Static/Calc.bf +++ b/src/Static/Calc.bf @@ -49,7 +49,7 @@ namespace Strawberry [Inline] static public void Log(T v) { - String string = scope String; + String string = scope String(); v.ToString(string); Debug.WriteLine(string); }