Originally my intention was to not make it random at all - if you touched the guard before they touch you, you'd kill them ; and if they touch you first, you lose 1 Life.
At the time I couldn't find out why it wasn't working, but turned out the engine I used (Whimtale) has a small bug that prevented it to work as intended. So in the end I just made it random dice roll. I told the Whimtale dev about the bug so it should be fixed soon.
Thank you for your comment!