Skip to content

Instantly share code, notes, and snippets.

@mikkelens
Created October 11, 2022 11:10
Show Gist options
  • Save mikkelens/2397509e9d1d6126cfdef57363830e21 to your computer and use it in GitHub Desktop.
Save mikkelens/2397509e9d1d6126cfdef57363830e21 to your computer and use it in GitHub Desktop.
this made me win lol
protected override void FighterBehavior()
{
/* ATTEMPT 2:
* Avoid attack, then attack.
*/
if (EnemyIsAttacking())
{
MoveBackward();
}
else
{
float distance = EnemyXPosition() - XPosition();
const float attackDistance = 0.95f;
if (distance <= attackDistance)
{
Punch();
}
else
{
MoveForward();
}
}
}
@mikkelens
Copy link
Author

game isnt deterministic so maybe it wont be perfect but you can change variables to improve it etc. for me it won with little or no health lost

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment