jugador = {
    representacion = "P",
    vida = 100,
    posicion = 2
}

enemigo = {
    representacion = "E",
    vida = 100,
    posicion = 6
}
map = {
    {"_", "_", "_",},
    {"_", "_", "_"}
}

while true do
jugador.posicion = math.random(1,6)
    
enemigo.posicion = math.random(1,6)

if jugador.posicion == enemigo.posicion then
    enemigo.vida = enemigo.vida -10
    print("choque!")
end

   

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: