==========defiende=tu=base========

map = {
    "_ _ _ _ _ _"
    "_ - - - - _"
    ": _ _ _ _ :"
}

casa = {
    args[map]
    "_ - - - - _"
    ": _ _ _ _ :"
}

jugador = {
    rep = "O"
    vida = 100
    arma = {
        "+-"
        true
        false
    }
}

zombie1 = {
    rep = "k"
    vida = 100
    }
zombie2 = {
    rep = "S"
    vida = 200
    }

=======jugador=========

jugador.spawn([14]"_")
if when key(W)
        jugador([+1a]"_")
if when key(S)
        jugador([-1a]"_")
if when key(A)
        jugador([+1]"_")
if when key(D)
        jugador([-1]"_")

if when key(E) then
        jugador.arma(true)
if when key(E) again then
        jugador.arma(false)

if jugador.arma(true) then
        1click(zombie1,zombie2) then
        zombie1,zombie2.vida = vida[2] -1
    
=========zombie========

zombie1,zombie2.spawn([1]"_")
zombie1.follow(jugador)
    ftg.2S
zombie2.follow(jugador)
    ftg.4S

if zombie1,zombie2 touch jugador then
            jugador.vida = -1
if zombie1.vida == 0 then
    zombie1.backspace()
                                    
if zombie2.vida == 0 then
    zombie2.backspace()
                                        
==========casaaa=========

if jugador whitin casa then
        zombie1,zombie2 not follow(jugador)
    else jugador outside casa then
        zombie1,zombie2 follow(jugador)

Embed on website

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