-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wertz public branch #173
Wertz public branch #173
Conversation
"components": [ | ||
"Microsoft.VisualStudio.Workload.ManagedGame" | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we leave this file in or add it to gitignore instead?
Explode(); | ||
_launchPlatform = other; | ||
_justLaunched = false; | ||
print("instant collision avoided now"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover print; if you want to leave it in, use Logger.LogDamage
src/FieldWarning/Assets/Units/Component/Movement/MovementComponent.cs
Outdated
Show resolved
Hide resolved
@@ -24,6 +24,7 @@ public sealed class MovementComponent : MonoBehaviour | |||
private const float ORIENTATION_RATE = 8.0f; | |||
private const float TRANSLATION_RATE = 6.0f; | |||
|
|||
public Vector3 Velocity; //{ get; private set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can have a private setter
// HE damage is applied by the shellBehavior when it explodes | ||
} | ||
} | ||
shellBehaviour.Initialize(shellDestination, ammo, target.Enemy.gameObject.GetComponent<PFW.Units.Component.Movement.MovementComponent>().Velocity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Break up giga long lines if its not too much trouble.
Also normally this kind of thing would be done through the UnitDispatcher (add a UnitDispatcher property called 'CurrentMovementSpeed' or something and then have that get the value from movement component; the intent is to avoid non-unit code fiddling with specific components, and have the UnitDispatcher provide a clean interface for outside requests. Then this code just goes target.Enemy.CurrentMovementSpeed
. If it sounds like too much boilerplate you can leave it like this tho.
Tank shell damage successfully moved from being instantly applied on shooting to being dealt upon the round actually hitting the target, done in the actual ShellBehavior collision logic now and utilizing collision shapes in the 3D world.
Shell velocity is tweaked based on the target velocity at launch such that it will have the same lateral displacement as the target (lead) over time. To do this, I had to make a manual Velocity property in the MovementComponent to reference.