Created
October 11, 2022 11:10
-
-
Save mikkelens/2397509e9d1d6126cfdef57363830e21 to your computer and use it in GitHub Desktop.
this made me win lol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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