Naruto's World
Naruto's World

Reply
Naruto: Lo Spirito della volpe a 9 code
view post Posted on 23/12/2008, 14:01Quote
Avatar

Jonin

Group: Member
Posts: 2422
Location: Roma>Pomezia>Torvajanica


Status: Offline: ultima azione eseguita il 25/12/2009, 18:06


Naruto: il chackra della volpe a 9 code




Piattaforma: PSP (EBOOT-Homebrew)- PC (Emulazione Homebrew)
Numero Personaggi: 5
Suoni: Originali (In JAP)
Linguaggio: Italiano
Genere: Picchiaduro
Stato di Sviluppo: 99% (c'è un bug con Gaara)
Relase: Download Versione PSP Versione PC presto disponibile



Per chi vuole aiutarmi questo è il code di Gaara
if chosedplayer == "gaara" then

if iso == "false" then

-- player mo

-- left muna

icon = Image.load("charicon/gaaraicon.png")


standleft = {}
for inc = 1, 4 do
standleft[inc] = Image.load("gaarasprites/left/stand/stand"..inc..".png")
end
walkleft = {}
for inc = 1, 2 do
walkleft[inc] = Image.load("gaarasprites/left/walk/walktest"..inc..".png")
end

jumpleft = {}
for inc = 1, 5 do
jumpleft[inc] = Image.load("gaarasprites/left/jump/jump"..inc..".png")
end

blockleft = {}

blockleft[1] = Image.load("gaarasprites/left/block/block1.png")
blockleft[2] = Image.load("gaarasprites/left/block/block2.png")


retreatleft = {}

retreatleft[1] = Image.load("gaarasprites/left/retreat/retreat1.png")
retreatleft[2] = Image.load("gaarasprites/left/retreat/retreat2.png")


crouchleft = {}
for inc = 1, 4 do
crouchleft[inc] = Image.load("gaarasprites/left/crouch/crouch"..inc..".png")
end

punchleft = {}
for inc = 1, 6 do
punchleft[inc] = Image.load("gaarasprites/left/punch/punchtest"..inc..".png")
end

kickleft = {}
for inc = 1, 4 do
kickleft[inc] = Image.load("gaarasprites/left/kick/kicktest"..inc..".png")
end

killedleft = {}
for inc = 1, 2 do
killedleft[inc] = Image.load("gaarasprites/left/killed/killed"..inc..".png")
end

specialleft = {}
for inc = 1, 36 do
specialleft[inc] = Image.load("gaarasprites/left/special/spl"..inc..".png")
end

damagedleft = Image.load("gaarasprites/left/damaged/damaged1.png")


-- right naman


standright = {}
for inc = 1,4 do
standright[inc] = Image.load("gaarasprites/right/stand/stand"..inc..".png")
end
walkright = {}
for inc = 1, 2 do
walkright[inc] = Image.load("gaarasprites/right/walk/walktest"..inc..".png")
end

jumpright = {}
for inc = 1, 5 do
jumpright[inc] = Image.load("gaarasprites/right/jump/jump"..inc..".png")
end

blockright = {}

blockright[1] = Image.load("gaarasprites/right/block/block1.png")
blockright[2] = Image.load("gaarasprites/right/block/block2.png")


retreatright = {}

retreatright[1] = Image.load("gaarasprites/right/retreat/retreat1.png")
retreatright[2] = Image.load("gaarasprites/right/retreat/retreat2.png")


crouchright = {}
for inc = 1, 4 do
crouchright[inc] = Image.load("gaarasprites/right/crouch/crouch"..inc..".png")
end

punchright = {}
for inc = 1, 6 do
punchright[inc] = Image.load("gaarasprites/right/punch/punchtest"..inc..".png")
end

kickright = {}
for inc = 1, 4 do
kickright[inc] = Image.load("gaarasprites/right/kick/kicktest"..inc..".png")
end

killedright = {}
for inc = 1, 2 do
killedright[inc] = Image.load("gaarasprites/right/killed/killed"..inc..".png")
end

specialright = {}
for inc = 1, 36 do
specialright[inc] = Image.load("gaarasprites/right/special/spl"..inc..".png")
end

damagedright = Image.load("gaarasprites/right/damaged/damaged1.png")


function throw()

if throwstate == 1 then

klastD = lastdirection

if klastD == 0 then

throwloop = throwloop + 1

if throwloop >= 1 and throwloop <= 15 then

yourP = punchleft[6]

kit = punchleft[1]
screen:blit(player.x, player.y, kit)

elseif throwloop > 15 then
throwloop = 0
state = 0
throwstate = 0
end

else

throwloop = throwloop + 1

if throwloop >= 1 and throwloop <= 15 then

yourP = punchright[6]

kit = punchright[1]
screen:blit(player.x - 50, player.y, kit)


elseif throwloop > 15 then
throwloop = 0
state = 0
throwstate = 0
end

end
end
end

function throwit()

if flyingstate == 1 then

if klastD == 0 then

if kny.x == 0 then

kny.x = player.x + 15

kny.y = player.y + 80

else

kny.x = kny.x + 10

screen:blit(kny.x, kny.y, kunayleft)

if kny.x >= enemyplay.x and enemylastdirection == 1 and (kny.y >= enemyplay.y and kny.y <= enemyplay.y + enemyplay.height) then


if enemyblockstate == 1 then

flyingstate = 0
kny.x = 0

else

enemyhitstate = 1
flyingstate = 0
kny.x = 0

end

end

if kny.x > 460 then
flyingstate = 0
kny.x = 0
end

end

else

if kny.x == 0 then

kny.x = player.x - 15

kny.y = player.y + 80

else

kny.x = kny.x - 10

screen:blit(kny.x, kny.y, kunayright)



if kny.x <= enemyplay.x and enemylastdirection == 0 and (kny.y >= enemyplay.y and kny.y <= enemyplay.y + enemyplay.height) then

if enemyblockstate == 1 then

flyingstate = 0
kny.x = 0

else

enemyhitstate = 1
flyingstate = 0
kny.x = 0

end

end

if kny.x < 0 then
flyingstate = 0
kny.x = 0
end

end

end
end

end


function run()


if lastdirection == 0 then
loop = loop + 1

player.y = 120
if loop >= 1 and loop <=8 then
yourP = standleft[1]
screen:blit(player.x + 8, player.y + 110, walkleft[1])
player.x = player.x + 7
--elseif loop >= 5 and loop <= 8 then
-- -- yourP = standleft[2]
-- screen:blit(player.x + 8, player.y + 110, walkleft[2])
-- player.x = player.x + 7
elseif loop > 8 then
loop = 1

end

else

loop = loop + 1

player.y = 120
if loop >= 1 and loop <= 8 then
yourP = standright[1]
screen:blit(player.x - 30, player.y + 110, walkright[1])
player.x = player.x - 7
--elseif loop >= 5 and loop <= 8 then
-- yourP = standright[2]
-- screen:blit(player.x - 30, player.y + 110, walkright[2])
-- player.x = player.x - 7
elseif loop > 8 then
loop = 1

end

end
end

function jump()

if lastdirection == 0 then

if player.state == "jumping" then

jumploop = jumploop + 1

if jumploop >= 1 and jumploop <= 5 then
yourP = jumpleft[1]
elseif jumploop >= 6 and jumploop <= 10 then
yourP = jumpleft[2]
elseif jumploop >= 11 and jumploop <= 15 then
yourP = jumpleft[3]
elseif jumploop >= 16 and jumploop <= 20 then
yourP = jumpleft[4]
elseif jumploop >= 21 and jumploop <= 25 then
yourP = jumpleft[5]
elseif jumploop > 25 then
player.state = "ground"
player.x = player.x + 170
state = 1
jumpstate = 0
jumploop = 0
end

end




else

if player.state == "jumping" then

jumploop = jumploop + 1

if jumploop >= 1 and jumploop <= 5 then
yourP = jumpright[1]
elseif jumploop >= 6 and jumploop <= 10 then
yourP = jumpright[2]
elseif jumploop >= 11 and jumploop <= 15 then
yourP = jumpright[3]
elseif jumploop >= 16 and jumploop <= 20 then
yourP = jumpright[4]
elseif jumploop >= 21 and jumploop <= 25 then
yourP = jumpright[5]
elseif jumploop > 25 then
player.state = "ground"
player.x = player.x - 170
state = 1
jumpstate = 0
jumploop = 0
end
end
end
end


function punch()
if lastdirection == 0 then

punchloop = punchloop + 1
if punchloop >= 1 and punchloop <= 10 then
player.x = player.x + 1
yourP = punchleft[6]

kit = punchleft[1]
screen:blit(player.x, player.y, kit)
elseif punchloop >= 11 and punchloop <= 15 then
yourP = punchleft[6]

kit = punchleft[2]
screen:blit(player.x, player.y, kit)
elseif punchloop >= 16 and punchloop <= 18 then
yourP = punchleft[6]

kit = punchleft[3]
screen:blit(player.x, player.y, kit)
elseif punchloop >= 19 and punchloop <= 22 then
yourP = punchleft[6]

kit = punchleft[4]
screen:blit(player.x, player.y, kit)
elseif punchloop >= 23 and punchloop <= 27 then
yourP = punchleft[6]

kit = punchleft[5]
screen:blit(player.x, player.y, kit)
elseif punchloop > 27 then
punchloop = 0
state = 0
punchstate = 0

end

else

punchloop = punchloop + 1
if punchloop >= 1 and punchloop <= 10 then
player.x = player.x - 1
yourP = punchright[6]

kit = punchright[1]
screen:blit(player.x - 50, player.y, kit)
elseif punchloop >= 11 and punchloop <= 15 then
yourP = punchright[6]

kit = punchright[2]
screen:blit(player.x - 50, player.y, kit)
elseif punchloop >= 16 and punchloop <= 18 then
yourP = punchright[6]

kit = punchright[3]
screen:blit(player.x - 50, player.y, kit)
elseif punchloop >= 19 and punchloop <= 22 then
yourP = punchright[6]

kit = punchright[4]
screen:blit(player.x - 50, player.y, kit)

elseif punchloop >= 23 and punchloop <= 27 then
yourP = punchright[6]

kit = punchright[5]
screen:blit(player.x - 50, player.y, kit)
elseif punchloop > 27 then
punchloop = 0
state = 0
punchstate = 0

end
end
end

function kick()
if lastdirection == 0 then

kickloop = kickloop + 1
if kickloop >= 1 and kickloop <= 5 then
yourP = standleft[1]

kit = kickleft[1]
screen:blit(player.x + 50, player.y + 60, kit)
elseif kickloop >= 6 and kickloop <= 10 then
yourP = standleft[2]

kit = kickleft[2]
screen:blit(player.x + 50, player.y + 60, kit)
elseif kickloop >= 11 and kickloop <= 15 then
yourP = standleft[3]

kit = kickleft[3]
screen:blit(player.x + 50, player.y + 60, kit)
elseif kickloop >= 16 and kickloop <= 20 then
yourP = standleft[4]

kit = kickleft[4]
screen:blit(player.x + 50, player.y + 60, kit)
elseif kickloop > 20 then
kickloop = 0
kickstate = 0
state = 0

end

else

kickloop = kickloop + 1
if kickloop >= 1 and kickloop <= 5 then
yourP = standright[1]

kit = kickright[1]
screen:blit(player.x - 80, player.y + 60, kit)
elseif kickloop >= 6 and kickloop <= 10 then
yourP = standright[2]

kit = kickright[2]
screen:blit(player.x - 80, player.y + 60, kit)
elseif enemykickloop >= 11 and enemykickloop <= 15 then
enemy = standright[3]

kit = kickright[3]
screen:blit(player.x - 80, player.y + 60, kit)
elseif kickloop >= 16 and kickloop <= 20 then
yourP = standright[4]

kit = kickright[4]
screen:blit(player.x - 80, player.y + 60, kit)
elseif kickloop > 20 then
kickloop = 0
kickstate = 0
state = 0

end
end
end

function retreat()
if lastdirection == 0 then

retreatloop = retreatloop + 1
if retreatloop >= 1 and retreatloop <= 7 then
screen:blit(player.x, player.y, retreatleft[1])
yourP = retreatleft[2]
elseif retreatloop >= 8 and retreatloop <= 14 then
screen:blit(player.x, player.y, retreatleft[2])
yourP = retreatleft[2]
elseif retreatloop > 14 then
retreatloop = 0
state = 0
retreatstate = 0

player.x = player.x - 50
end

else

retreatloop = retreatloop + 1
if retreatloop >= 1 and retreatloop <= 7 then
screen:blit(player.x, player.y, retreatleft[1])
yourP = retreatleft[2]
elseif retreatloop >= 8 and retreatloop <= 14 then
screen:blit(player.x, player.y, retreatleft[2])
yourP = retreatleft[2]
elseif retreatloop > 14 then
retreatloop = 0
state = 0
retreatstate = 0

player.x = player.x + 60
end
end
end

function crouch()
if lastdirection == 0 then
crouchloop = crouchloop + 1
if crouchloop >= 1 and crouchloop <= 2 then
yourP = crouchleft[2]
elseif crouchloop > 3 then
yourP = crouchleft[3]
end
else
crouchloop = crouchloop + 1
if crouchloop >= 1 and crouchloop <= 2 then
yourP = crouchright[2]
elseif crouchloop > 3 then
yourP = crouchright[3]
end
end
crouchstate = 0
end

function block()
if lastdirection == 0 then
blockloop = blockloop + 1

if blockloop >= 1 and blockloop <= 2 then
yourP = blockleft[1]
elseif blockloop >= 3 and blockloop <= 4 then
yourP = blockleft[2]
end
else
blockloop = blockloop + 1
if blockloop >= 1 and blockloop <= 2 then
yourP = blockright[1]
elseif blockloop >= 3 and blockloop <= 4 then
yourP = blockright[2]
end
end


blockstate = 0

end



function specialTech()
if specialstate == 1 then

if (player.x + player.width > enemyplay.x - 150) and (player.x < enemyplay.x + 160) and
(player.y + player.height > enemyplay.y) and (player.y < enemyplay.y + enemyplay.height) then

gaaraRange = "range" else gaaraRange = "" end

if lastdirection == 0 then
specialloop = specialloop + 1

if specialloop >= 1 and specialloop <= 10 then yourP = specialleft[1] player.y = 195 --player.x = player.x + 30
elseif specialloop >= 11 and specialloop <= 20 then yourP = specialleft[2] player.y = 195
elseif specialloop >= 21 and specialloop <= 30 then yourP = specialleft[3] player.y = 185 --player.x = player.x - 35
elseif specialloop >= 31 and specialloop <= 40 then yourP = specialleft[4] player.y = 185 --player.x = player.x - 14
elseif specialloop >= 41 and specialloop <= 50 then yourP = specialleft[5] player.y = 185 --player.x = player.x - 12
elseif specialloop >= 51 and specialloop <= 60 then yourP = specialleft[6] player.y = 163
elseif specialloop >= 61 and specialloop <= 70 then yourP = specialleft[7] player.y = 156
elseif specialloop >= 71 and specialloop <= 80 then yourP = specialleft[8] player.y = 156
elseif specialloop >= 81 and specialloop <= 90 then yourP = specialleft[9] player.y = 156
elseif specialloop >= 91 and specialloop <= 100 then yourP = specialleft[10] player.y = 156

elseif specialloop >= 101 and specialloop <= 110 then yourP = specialleft[11] player.y = 156
elseif specialloop >= 111 and specialloop <= 120 then yourP = specialleft[12] player.y = 156
elseif specialloop >= 121 and specialloop <= 130 then yourP = specialleft[13] player.y = 156
elseif specialloop >= 131 and specialloop <= 140 then yourP = specialleft[14] player.y = 156
elseif specialloop >= 141 and specialloop <= 150 then yourP = specialleft[15] player.y = 156
elseif specialloop >= 151 and specialloop <= 160 then yourP = specialleft[16] player.y = 156
elseif specialloop >= 161 and specialloop <= 170 then yourP = specialleft[17] player.y = 156
elseif specialloop >= 171 and specialloop <= 180 then yourP = specialleft[18] player.y = 156
elseif specialloop >= 181 and specialloop <= 190 then yourP = specialleft[19] player.y = 156
elseif specialloop >= 191 and specialloop <= 200 then yourP = specialleft[20] player.y = 156

elseif specialloop >= 201 and specialloop <= 210 then yourP = specialleft[21] player.y = 156
elseif specialloop >= 211 and specialloop <= 220 then yourP = specialleft[22] player.y = 156
elseif specialloop >= 221 and specialloop <= 230 then yourP = specialleft[23] player.y = 156
elseif specialloop >= 231 and specialloop <= 240 then yourP = specialleft[24] player.y = 156
elseif specialloop >= 241 and specialloop <= 250 then yourP = specialleft[25] player.y = 156
elseif specialloop >= 251 and specialloop <= 260 then yourP = specialleft[26] player.y = 156
elseif specialloop >= 261 and specialloop <= 270 then yourP = specialleft[27] player.y = 156
elseif specialloop >= 271 and specialloop <= 280 then yourP = specialleft[28] player.y = 156
elseif specialloop >= 281 and specialloop <= 290 then yourP = specialleft[29] player.y = 156
elseif specialloop >= 291 and specialloop <= 300 then yourP = specialleft[30] player.y = 156

elseif specialloop >= 301 and specialloop <= 320 then yourP = specialleft[31] player.y = 156
elseif specialloop >= 321 and specialloop <= 340 then yourP = specialleft[32] player.y = 156
elseif specialloop >= 341 and specialloop <= 360 then yourP = specialleft[33] player.y = 156
elseif specialloop >= 361 and specialloop <= 380 then yourP = specialleft[34] player.y = 156
elseif specialloop >= 381 and specialloop <= 400 then yourP = specialleft[35] player.y = 156
elseif specialloop >= 401 and specialloop <= 430 then yourP = specialleft[36] player.y = 156
elseif specialloop > 430 then specialloop = 0 state = 0 specialstate = 0 end

if specialloop == 1 then player.x = currentX + 30
elseif specialloop == 11 then player.x = currentX + 30
elseif specialloop == 21 then player.x = currentX
elseif specialloop == 31 then player.x = currentX - 14
elseif specialloop == 41 then player.x = currentX - 12
elseif specialloop == 51 then player.y = 163 end

else

specialloop = specialloop + 1

if specialloop >= 1 and specialloop <= 10 then yourP = specialright[1] player.y = 195 --player.x = player.x + 30
elseif specialloop >= 11 and specialloop <= 20 then yourP = specialright[2] player.y = 195
elseif specialloop >= 21 and specialloop <= 30 then yourP = specialright[3] player.y = 185 --player.x = player.x - 35
elseif specialloop >= 31 and specialloop <= 40 then yourP = specialright[4] player.y = 185 --player.x = player.x - 14
elseif specialloop >= 41 and specialloop <= 50 then yourP = specialright[5] player.y = 185 --player.x = player.x - 12
elseif specialloop >= 51 and specialloop <= 60 then yourP = specialright[6] player.y = 163
elseif specialloop >= 61 and specialloop <= 70 then yourP = specialright[7] player.y = 156
elseif specialloop >= 71 and specialloop <= 80 then yourP = specialright[8] player.y = 156
elseif specialloop >= 81 and specialloop <= 90 then yourP = specialright[9] player.y = 156
elseif specialloop >= 91 and specialloop <= 100 then yourP = specialright[10] player.y = 156

elseif specialloop >= 101 and specialloop <= 110 then yourP = specialright[11] player.y = 156
elseif specialloop >= 111 and specialloop <= 120 then yourP = specialright[12] player.y = 156
elseif specialloop >= 121 and specialloop <= 130 then yourP = specialright[13] player.y = 156
elseif specialloop >= 131 and specialloop <= 140 then yourP = specialright[14] player.y = 156
elseif specialloop >= 141 and specialloop <= 150 then yourP = specialright[15] player.y = 156
elseif specialloop >= 151 and specialloop <= 160 then yourP = specialright[16] player.y = 156
elseif specialloop >= 161 and specialloop <= 170 then yourP = specialright[17] player.y = 156
elseif specialloop >= 171 and specialloop <= 180 then yourP = specialright[18] player.y = 156
elseif specialloop >= 181 and specialloop <= 190 then yourP = specialright[19] player.y = 156
elseif specialloop >= 191 and specialloop <= 200 then yourP = specialright[20] player.y = 156

elseif specialloop >= 201 and specialloop <= 210 then yourP = specialright[21] player.y = 156
elseif specialloop >= 211 and specialloop <= 220 then yourP = specialright[22] player.y = 156
elseif specialloop >= 221 and specialloop <= 230 then yourP = specialright[23] player.y = 156
elseif specialloop >= 231 and specialloop <= 240 then yourP = specialright[24] player.y = 156
elseif specialloop >= 241 and specialloop <= 250 then yourP = specialright[25] player.y = 156
elseif specialloop >= 251 and specialloop <= 260 then yourP = specialright[26] player.y = 156
elseif specialloop >= 261 and specialloop <= 270 then yourP = specialright[27] player.y = 156
elseif specialloop >= 271 and specialloop <= 280 then yourP = specialright[28] player.y = 156
elseif specialloop >= 281 and specialloop <= 290 then yourP = specialright[29] player.y = 156
elseif specialloop >= 291 and specialloop <= 300 then yourP = specialright[30] player.y = 156

elseif specialloop >= 301 and specialloop <= 320 then yourP = specialright[31] player.y = 156
elseif specialloop >= 321 and specialloop <= 340 then yourP = specialright[32] player.y = 156
elseif specialloop >= 341 and specialloop <= 360 then yourP = specialright[33] player.y = 156
elseif specialloop >= 361 and specialloop <= 380 then yourP = specialright[34] player.y = 156
elseif specialloop >= 381 and specialloop <= 400 then yourP = specialright[35] player.y = 156
elseif specialloop >= 401 and specialloop <= 430 then yourP = specialright[36] player.y = 156
elseif specialloop > 430 then specialloop = 0 state = 0 specialstate = 0 end

if specialloop == 1 then player.x = currentX - 30
elseif specialloop == 11 then player.x = currentX - 30
elseif specialloop == 21 then player.x = currentX
elseif specialloop == 31 then player.x = currentX + 14
elseif specialloop == 41 then player.x = currentX + 12
elseif specialloop == 51 then player.y = 163
elseif specialloop == 151 then player.x = currentX - 30
elseif specialloop == 161 then player.x = currentX - 30
elseif specialloop == 171 then player.x = currentX - 30
elseif specialloop == 181 then player.x = currentX - 30
elseif specialloop == 191 then player.x = currentX - 30
elseif specialloop == 200 then player.x = currentX - 30

elseif specialloop == 241 then player.x = currentX + 30

elseif specialloop == 251 then player.x = currentX + 30
elseif specialloop == 271 then player.x = currentX + 30
elseif specialloop == 281 then player.x = currentX - 30
elseif specialloop == 291 then player.x = currentX - 30
elseif specialloop == 301 then player.x = currentX - 73
elseif specialloop == 321 then player.x = currentX - 70
elseif specialloop == 341 then player.x = currentX - 70
elseif specialloop == 361 then player.x = currentX - 89
elseif specialloop == 381 then player.x = currentX - 140
elseif specialloop == 401 then player.x = currentX - 150
elseif specialloop == 430 then player.x = currentX + 150 end
end

if specialloop == 1 then playerH.x = playerH.x - 20 end
if gaaraRange == "range" and specialloop == 430 and enemyblockloop < 1 then enemyhitstate = 1 enemyhealth.x = enemyhealth.x - 50 end
end
end


function killed()

if killedstate == 1 then

if enemylastdirection == 0 then

killedloop = killedloop + 1

if killedloop >= 1 and killedloop <= 15 then

yourP = killedleft[1]
player.y = player.y - 6
player.x = player.x + 15

elseif killedloop >= 16 and killedloop <= 30 then

yourP = killedleft[1]
player.y = player.y + 6
player.x = player.x + 15

elseif killedloop >= 31 then

yourP = killedleft[2]

end


else


killedloop = killedloop + 1
if killedloop >= 1 and killedloop <= 15 then

yourP = killedright[1]
player.y = player.y - 6
player.x = player.x - 15

elseif killedloop >= 16 and killedloop <= 30 then

yourP = killedright[1]
player.y = player.y + 6
player.x = player.x - 15

elseif killedloop >= 31 then

yourP = killedright[2]

end

end

end
end


function damaged()


if blockloop == 0 and enemycollision == 1 and crouchstate == 0 and retreatstate == 0 then
if enemypunchloop == 20 or enemykickloop == 20 then

damagedstate = 1
state = ""
end
end


if damagedstate == 1 then

if enemylastdirection == 1 then

damagedloop = damagedloop + 1

if damagedloop >= 1 and damagedloop <= 7 then
yourP = damagedleft
player.x = player.x - 1

elseif damagedloop >= 8 and damagedloop <= 14 then
yourP = damagedleft
player.x = player.x - 1


elseif damagedloop > 21 then
damagedloop = 0
state = 0
damagedstate = 0
lastdirection = 0
end

else

damagedloop = damagedloop + 1

if damagedloop >= 1 and damagedloop <= 9 then
yourP = damagedright
player.x = player.x + 1

elseif damagedloop >= 10 and damagedloop <= 18 then
yourP = damagedright
player.x = player.x + 1

elseif damagedloop > 25 then
damagedloop = 0
state = 0
damagedstate = 0
lastdirection = 1
end
end
end


----- mabawasan ka .....

-- PS : Kalokohan lang ito ha!

-- another PS : ay, tunay pala ito, juk lng ...


if damagedstate == 1 and damagedloop == 2 then
playerH.x = playerH.x - 5
end

if playerH.x <= 0 then
killedstate = 1
killed()
end


end

end
iso = "true"
end









if chosedenemy == "gaara" then

if enemyiso == "false" then

eicon = Image.load("charicon/gaaraicon.png")


enemystandleft = {}
for inc = 1, 4 do
enemystandleft[inc] = Image.load("gaarasprites/left/stand/stand"..inc..".png")
end
enemywalkleft = {}
for inc = 1, 2 do
enemywalkleft[inc] = Image.load("gaarasprites/left/walk/walktest"..inc..".png")
end

enemyjumpleft = {}
for inc = 1, 5 do
enemyjumpleft[inc] = Image.load("gaarasprites/left/jump/jump"..inc..".png")
end

enemyblockleft = {}

enemyblockleft[1] = Image.load("gaarasprites/left/block/block1.png")
enemyblockleft[2] = Image.load("gaarasprites/left/block/block2.png")


enemyretreatleft = {}

enemyretreatleft[1] = Image.load("gaarasprites/left/retreat/retreat1.png")
enemyretreatleft[2] = Image.load("gaarasprites/left/retreat/retreat2.png")


enemycrouchleft = {}
for inc = 1, 4 do
enemycrouchleft[inc] = Image.load("gaarasprites/left/crouch/crouch"..inc..".png")
end

enemypunchleft = {}
for inc = 1, 6 do
enemypunchleft[inc] = Image.load("gaarasprites/left/punch/punchtest"..inc..".png")
end

enemykickleft = {}
for inc = 1, 4 do
enemykickleft[inc] = Image.load("gaarasprites/left/kick/kicktest"..inc..".png")
end

enemyspecialleft = {}
for inc = 1, 36 do
enemyspecialleft[inc] = Image.load("gaarasprites/left/special/spl"..inc..".png")
end

enemykilledleft = {}
for inc = 1, 2 do
enemykilledleft[inc] = Image.load("gaarasprites/left/killed/killed"..inc..".png")
end

enemyhitleft = Image.load("gaarasprites/left/damaged/damaged1.png")


-- right naman


enemystandright = {}
for inc = 1,4 do
enemystandright[inc] = Image.load("gaarasprites/right/stand/stand"..inc..".png")
end
enemywalkright = {}
for inc = 1, 2 do
enemywalkright[inc] = Image.load("gaarasprites/right/walk/walktest"..inc..".png")
end

enemyjumpright = {}
for inc = 1, 5 do
enemyjumpright[inc] = Image.load("gaarasprites/right/jump/jump"..inc..".png")
end

enemyblockright = {}

enemyblockright[1] = Image.load("gaarasprites/right/block/block1.png")
enemyblockright[2] = Image.load("gaarasprites/right/block/block2.png")


enemyretreatright = {}

enemyretreatright[1] = Image.load("gaarasprites/right/retreat/retreat1.png")
enemyretreatright[2] = Image.load("gaarasprites/right/retreat/retreat2.png")


enemycrouchright = {}
for inc = 1, 4 do
enemycrouchright[inc] = Image.load("gaarasprites/right/crouch/crouch"..inc..".png")
end

enemypunchright = {}
for inc = 1, 6 do
enemypunchright[inc] = Image.load("gaarasprites/right/punch/punchtest"..inc..".png")
end

enemykickright = {}
for inc = 1, 4 do
enemykickright[inc] = Image.load("gaarasprites/right/kick/kicktest"..inc..".png")
end

enemyspecialright = {}
for inc = 1, 36 do
enemyspecialright[inc] = Image.load("gaarasprites/right/special/spl"..inc..".png")
end


enemykilledright = {}
for inc = 1, 2 do
enemykilledright[inc] = Image.load("gaarasprites/right/killed/killed"..inc..".png")
end

enemyhitright = Image.load("gaarasprites/right/damaged/damaged1.png")






function enemythrow()

if enemythrowstate == 1 then

if enemylastdirection == 0 then

enemythrowloop = enemythrowloop + 1

if enemythrowloop >= 1 and enemythrowloop <= 15 then

enemy = enemypunchleft[6]

elseif enemythrowloop > 15 then
enemythrowloop = 0
enemystate = 1
enemythrowstate = 0
end

else

enemythrowloop = enemythrowloop + 1

if enemythrowloop >= 1 and enemythrowloop <= 15 then

enemy = enemypunchright[6]

elseif enemythrowloop > 15 then
enemythrowloop = 0
enemystate = 1
enemythrowstate = 0
end

end
end
end

---------------- papaganahin pa lang -------------------

----------------- nagana na kaya ---------------------

function enemythrowit()

if enemyflyingstate == 1 then

if enemylastdirection == 0 then

if enemykny.x == 0 then

enemykny.x = enemyplay.x + 15

enemykny.y = enemyplay.y + 80

else

enemykny.x = enemykny.x + 10

screen:blit(enemykny.x, enemykny.y, kunayleft)

if enemykny.x >= player.x and enemylastdirection == 0 and (enemykny.y >= player.y and enemykny.y <= player.y + player.height) then

enemyflyingstate = 0
enemykny.x = 0
throwcd = 0

if blockloop > 0 then

damagedstate = 0

else

damagedstate = 1
enemyflyingstate = 0
enemykny.x = 0
throwcd = 0

end


end

if enemykny.x > 460 then
enemyflyingstate = 0
enemykny.x = 0
end

end

else

if enemykny.x == 0 then

enemykny.x = enemyplay.x - 15

enemykny.y = enemyplay.y + 80

else

enemykny.x = enemykny.x - 10

screen:blit(enemykny.x, enemykny.y, kunayright)



if enemykny.x <= player.x and enemylastdirection == 1 and (enemykny.y >= player.y and enemykny.y <= player.y + player.height) then

enemyflyingstate = 0
enemykny.x = 0
throwcd = 0

if blockloop > 0 then

damagedstate = 0

else

damagedstate = 1
enemyflyingstate = 0
enemykny.x = 0
throwcd = 0

end

end

if enemykny.x < 0 then
enemyflyingstate = 0
enemykny.x = 0
end

end

end
end

end


function enemyrun()


if enemylastdirection == 0 then
enemyloop = enemyloop + 1

enemyplay.y = 120
if enemyloop >= 1 and enemyloop <=8 then
enemy = enemystandleft[1]
screen:blit(enemyplay.x + 8, enemyplay.y + 110, enemywalkleft[1])
enemyplay.x = enemyplay.x + 7
--elseif loop >= 5 and loop <= 8 then
-- -- yourP = standleft[2]
-- screen:blit(player.x + 8, player.y + 110, walkleft[2])
-- player.x = player.x + 7
elseif enemyloop > 8 then
enemyloop = 1

end

else

enemyloop = enemyloop + 1

enemyplay.y = 120
if enemyloop >= 1 and enemyloop <= 8 then
enemy = enemystandright[1]
screen:blit(enemyplay.x - 30, enemyplay.y + 110, enemywalkright[1])
enemyplay.x = enemyplay.x - 7
--elseif loop >= 5 and loop <= 8 then
-- yourP = standright[2]
-- screen:blit(player.x - 30, player.y + 110, walkright[2])
-- player.x = player.x - 7
elseif enemyloop > 8 then
enemyloop = 1

end

end
end

function enemyjump()
if enemystate == 0 then
if enemylastdirection == 0 then

if enemyplay.state == "jumping" then

enemyjumploop = enemyjumploop + 1

if enemyjumploop >= 1 and enemyjumploop <= 5 then
enemy = enemyjumpleft[1]
elseif enemyjumploop >= 6 and enemyjumploop <= 10 then
enemy = enemyjumpleft[2]
elseif enemyjumploop >= 11 and enemyjumploop <= 15 then
enemy = enemyjumpleft[3]
elseif enemyjumploop >= 16 and enemyjumploop <= 20 then
enemy = enemyjumpleft[4]
elseif enemyjumploop >= 21 and enemyjumploop <= 25 then
enemy = enemyjumpleft[5]
elseif enemyjumploop > 25 then
enemyplay.state = "ground"
enemyplay.x = enemyplay.x + 100
enemystate = 1
enemyjumpstate = 0
enemyjumploop = 0
end

end




else

if enemyplay.state == "jumping" then

enemyjumploop = enemyjumploop + 1

if enemyjumploop >= 1 and enemyjumploop <= 5 then
enemy = enemyjumpright[1]
elseif enemyjumploop >= 6 and enemyjumploop <= 10 then
enemy = enemyjumpright[2]
elseif enemyjumploop >= 11 and enemyjumploop <= 15 then
enemy = enemyjumpright[3]
elseif enemyjumploop >= 16 and enemyjumploop <= 20 then
enemy = enemyjumpright[4]
elseif enemyjumploop >= 21 and enemyjumploop <= 25 then
enemy = enemyjumpright[5]
elseif enemyjumploop > 25 then
enemyplay.state = "ground"
enemyplay.x = enemyplay.x - 100
enemystate = 1
enemyjumpstate = 0
enemyjumploop = 0
end
end

end
end
end


function enemyjumpApp()
if enemystate == 0 then
if enemylastdirection == 0 then

if enemyplay.state == "jumping" then

enemyjumploop = enemyjumploop + 1

if enemyjumploop >= 1 and enemyjumploop <= 5 then
enemy = enemyjumpleft[1]
elseif enemyjumploop >= 6 and enemyjumploop <= 10 then
enemy = enemyjumpleft[2]
elseif enemyjumploop >= 11 and enemyjumploop <= 15 then
enemy = enemyjumpleft[3]
elseif enemyjumploop >= 16 and enemyjumploop <= 20 then
enemy = enemyjumpleft[4]
elseif enemyjumploop >= 21 and enemyjumploop <= 25 then
enemy = enemyjumpleft[5]
elseif enemyjumploop > 25 then
enemyplay.state = "ground"
enemyplay.x = enemyplay.x + 100
enemystate = 1
enemyjumpstate = 0
enemyjumploop = 0
end

end




else

if enemyplay.state == "jumping" then

enemyjumploop = enemyjumploop + 1

if enemyjumploop >= 1 and enemyjumploop <= 5 then
enemy = enemyjumpright[1]
elseif enemyjumploop >= 6 and enemyjumploop <= 10 then
enemy = enemyjumpright[2]
elseif enemyjumploop >= 11 and enemyjumploop <= 15 then
enemy = enemyjumpright[3]
elseif enemyjumploop >= 16 and enemyjumploop <= 20 then
enemy = enemyjumpright[4]
elseif enemyjumploop >= 21 and enemyjumploop <= 25 then
enemy = enemyjumpright[5]
elseif enemyjumploop > 25 then
enemyplay.state = "ground"
enemyplay.x = enemyplay.x - 100
enemystate = 1
enemyjumpstate = 0
enemyjumploop = 0
end
end
end
end
end


function enemypunch()
if enemylastdirection == 0 then

enemypunchloop = enemypunchloop + 1
if enemypunchloop >= 1 and enemypunchloop <= 10 then
enemyplay.x = enemyplay.x + 1
enemy = enemypunchleft[6]

kit = enemypunchleft[1]
screen:blit(enemyplay.x, enemyplay.y, kit)
elseif enemypunchloop >= 11 and enemypunchloop <= 15 then
enemy = enemypunchleft[6]

kit = enemypunchleft[2]
screen:blit(enemyplay.x, enemyplay.y, kit)
elseif enemypunchloop >= 16 and enemypunchloop <= 18 then
enemy = enemypunchleft[6]

kit = enemypunchleft[3]
screen:blit(enemyplay.x, enemyplay.y, kit)
elseif enemypunchloop >= 19 and enemypunchloop <= 22 then
enemy = enemypunchleft[6]

kit = enemypunchleft[4]
screen:blit(enemyplay.x, enemyplay.y, kit)
elseif enemypunchloop >= 23 and enemypunchloop <= 27 then
enemy = enemypunchleft[6]

kit = enemypunchleft[5]
screen:blit(enemyplay.x, enemyplay.y, kit)
elseif enemypunchloop > 27 then
enemypunchloop = 0
enemystatestate = 0
enemypunchstate = 0

end

else

enemypunchloop = enemypunchloop + 1
if enemypunchloop >= 1 and enemypunchloop <= 10 then
enemyplay.x = enemyplay.x - 1
enemy = enemypunchright[6]

kit = enemypunchright[1]
screen:blit(enemyplay.x - 50, enemyplay.y, kit)
elseif enemypunchloop >= 11 and enemypunchloop <= 15 then
enemy = enemypunchright[6]

kit = enemypunchright[2]
screen:blit(enemyplay.x - 50, enemyplay.y, kit)
elseif enemypunchloop >= 16 and enemypunchloop <= 18 then
enemy = enemypunchright[6]

kit = enemypunchright[3]
screen:blit(enemyplay.x - 50, enemyplay.y, kit)
elseif enemypunchloop >= 19 and enemypunchloop <= 22 then
enemy = enemypunchright[6]

kit = enemypunchright[4]
screen:blit(enemyplay.x - 50, enemyplay.y, kit)

elseif enemypunchloop >= 23 and enemypunchloop <= 27 then
enemy = enemypunchright[6]

kit = enemypunchright[5]
screen:blit(enemyplay.x - 50, enemyplay.y, kit)
elseif enemypunchloop > 27 then
enemypunchloop = 0
enemystate = 0
enemypunchstate = 0

end
end
end


function enemykick()
if enemylastdirection == 0 then

enemykickloop = enemykickloop + 1
if enemykickloop >= 1 and enemykickloop <= 5 then
enemy = enemystandleft[1]

kit = enemykickleft[1]
screen:blit(enemyplay.x + 50, enemyplay.y + 60, kit)
elseif enemykickloop >= 6 and enemykickloop <= 10 then
enemy = enemystandleft[2]

kit = enemykickleft[2]
screen:blit(enemyplay.x + 50, enemyplay.y + 60, kit)
elseif enemykickloop >= 11 and enemykickloop <= 15 then
enemy = enemystandleft[3]

kit = enemykickleft[3]
screen:blit(enemyplay.x + 50, enemyplay.y + 60, kit)
elseif enemykickloop >= 16 and enemykickloop <= 20 then
enemy = enemystandleft[4]

kit = enemykickleft[4]
screen:blit(enemyplay.x + 50, enemyplay.y + 60, kit)
elseif enemykickloop > 20 then
enemykickloop = 0
enemykickstate = 0
enemystate = 0

end

else

enemykickloop = enemykickloop + 1
if enemykickloop >= 1 and enemykickloop <= 5 then
enemy = enemystandright[1]

kit = enemykickright[1]
screen:blit(enemyplay.x - 80, enemyplay.y + 60, kit)
elseif enemykickloop >= 6 and enemykickloop <= 10 then
enemy = enemystandright[2]

kit = enemykickright[2]
screen:blit(enemyplay.x - 80, enemyplay.y + 60, kit)
elseif enemykickloop >= 11 and enemykickloop <= 15 then
enemy = enemystandright[3]

kit = enemykickright[3]
screen:blit(enemyplay.x - 80, enemyplay.y + 60, kit)
elseif enemykickloop >= 16 and enemykickloop <= 20 then
enemy = enemystandright[4]

kit = enemykickright[4]
screen:blit(enemyplay.x - 80, enemyplay.y + 60, kit)
elseif enemykickloop > 20 then
enemykickloop = 0
enemykickstate = 0
enemystate = 0

end
end
end


function enemyretreat()
if enemylastdirection == 0 then

enemyretreatloop = enemyretreatloop + 1
if enemyretreatloop >= 1 and enemyretreatloop <= 7 then
screen:blit(enemyplay.x, enemyplay.y, enemyretreatleft[1])
enemy = enemyretreatleft[2]
elseif enemyretreatloop >= 8 and enemyretreatloop <= 14 then
screen:blit(enemyplay.x, enemyplay.y, enemyretreatleft[2])
enemy = enemyretreatleft[2]
elseif enemyretreatloop > 14 then
enemyretreatloop = 0
enemystate = 0
enemyretreatstate = 0

enemyplay.x = enemyplay.x - 50
end

else

enemyretreatloop = enemyretreatloop + 1
if enemyretreatloop >= 1 and enemyretreatloop <= 7 then
screen:blit(enemyplay.x, enemyplay.y, enemyretreatleft[1])
enemy = enemyretreatleft[2]
elseif enemyretreatloop >= 8 and enemyretreatloop <= 14 then
screen:blit(enemyplay.x, enemyplay.y, enemyretreatleft[2])
enemy = enemyretreatleft[2]
elseif enemyretreatloop > 14 then
enemyretreatloop = 0
enemystate = 0
enemyretreatstate = 0

enemyplay.x = enemyplay.x + 60
end
end
end


function enemycrouch()
if enemylastdirection == 0 then
enemycrouchloop = enemycrouchloop + 1

if enemycrouchloop >= 1 and enemycrouchloop <= 5 then
enemy = enemycrouchleft[1]
elseif enemycrouchloop >= 6 and enemycrouchloop <= 10 then
enemy = enemycrouchleft[2]
elseif enemycrouchloop >= 11 and enemycrouchloop <= 15 then
enemy = enemycrouchleft[3]
elseif enemycrouchloop >= 16 then
enemy = enemycrouchleft[4]
end
else
enemycrouchloop = enemycrouchloop + 1

if enemycrouchloop >= 1 and enemycrouchloop <= 5 then
enemy = enemycrouchright[1]
elseif enemycrouchloop >= 6 and enemycrouchloop <= 10 then
enemy = enemycrouchright[2]
elseif enemycrouchloop >= 11 and enemycrouchloop <= 15 then
enemy = enemycrouchright[3]
elseif enemycrouchloop >= 16 then
enemy = enemycrouchright[4]
end
end
enemycrouchstate = 0
end

function enemyblock()
if enemylastdirection == 0 then
enemyblockloop = enemyblockloop + 1

if enemyblockloop >= 1 and enemyblockloop <= 4 then
enemy = enemyblockleft[1]
elseif enemyblockloop >= 5 and enemyblockloop <= 25 then
enemy = enemyblockleft[2]
elseif enemyblockloop > 25 then
enemyblockloop = 0
enemyblockstate = 0
enemystate = 1
end
else
enemyblockloop = enemyblockloop + 1
if enemyblockloop >= 1 and enemyblockloop <= 4 then
enemy = enemyblockright[1]
elseif enemyblockloop >= 5 and enemyblockloop <= 25 then
enemy = enemyblockright[2]
elseif enemyblockloop > 25 then
enemyblockloop = 0
enemyblockstate = 0
enemystate = 1
end
end

end


function enemyspecialTech()
if enemyspecialstate == 1 then

-- if (enemyplay.x + enemyplay.width > enemyplay.x - 150) and (enemyplay.x < enemyplay.x + 160) and
-- (enemyplay.y + enemyplay.height > enemyplay.y) and (enemyplay.y < enemyplay.y + enemyplay.height) then
--
-- gaaraRange = "range" else gaaraRange = "" end

if enemylastdirection == 0 then
enemyspecialloop = enemyspecialloop + 1

if enemyspecialloop >= 1 and enemyspecialloop <= 10 then enemy = enemyspecialleft[1] enemyplay.y = 195 --enemyplay.x = enemyplay.x + 30
elseif enemyspecialloop >= 11 and enemyspecialloop <= 20 then enemy = enemyspecialleft[2] enemyplay.y = 195
elseif enemyspecialloop >= 21 and enemyspecialloop <= 30 then enemy = enemyspecialleft[3] enemyplay.y = 185 --enemyplay.x = enemyplay.x - 35
elseif enemyspecialloop >= 31 and enemyspecialloop <= 40 then enemy = enemyspecialleft[4] enemyplay.y = 185 --enemyplay.x = enemyplay.x - 14
elseif enemyspecialloop >= 41 and enemyspecialloop <= 50 then enemy = enemyspecialleft[5] enemyplay.y = 185 --enemyplay.x = enemyplay.x - 12
elseif enemyspecialloop >= 51 and enemyspecialloop <= 60 then enemy = enemyspecialleft[6] enemyplay.y = 163
elseif enemyspecialloop >= 61 and enemyspecialloop <= 70 then enemy = enemyspecialleft[7] enemyplay.y = 156
elseif enemyspecialloop >= 71 and enemyspecialloop <= 80 then enemy = enemyspecialleft[8] enemyplay.y = 156
elseif enemyspecialloop >= 81 and enemyspecialloop <= 90 then enemy = enemyspecialleft[9] enemyplay.y = 156
elseif enemyspecialloop >= 91 and enemyspecialloop <= 100 then enemy = enemyspecialleft[10] enemyplay.y = 156

elseif enemyspecialloop >= 101 and enemyspecialloop <= 110 then enemy = enemyspecialleft[11] enemyplay.y = 156
elseif enemyspecialloop >= 111 and enemyspecialloop <= 120 then enemy = enemyspecialleft[12] enemyplay.y = 156
elseif enemyspecialloop >= 121 and enemyspecialloop <= 130 then enemy = enemyspecialleft[13] enemyplay.y = 156
elseif enemyspecialloop >= 131 and enemyspecialloop <= 140 then enemy = enemyspecialleft[14] enemyplay.y = 156
elseif enemyspecialloop >= 141 and enemyspecialloop <= 150 then enemy = enemyspecialleft[15] enemyplay.y = 156
elseif enemyspecialloop >= 151 and enemyspecialloop <= 160 then enemy = enemyspecialleft[16] enemyplay.y = 156
elseif enemyspecialloop >= 161 and enemyspecialloop <= 170 then enemy = enemyspecialleft[17] enemyplay.y = 156
elseif enemyspecialloop >= 171 and enemyspecialloop <= 180 then enemy = enemyspecialleft[18] enemyplay.y = 156
elseif enemyspecialloop >= 181 and enemyspecialloop <= 190 then enemy = enemyspecialleft[19] enemyplay.y = 156
elseif enemyspecialloop >= 191 and enemyspecialloop <= 200 then enemy = enemyspecialleft[20] enemyplay.y = 156

elseif enemyspecialloop >= 201 and enemyspecialloop <= 210 then enemy = enemyspecialleft[21] enemyplay.y = 156
elseif enemyspecialloop >= 211 and enemyspecialloop <= 220 then enemy = enemyspecialleft[22] enemyplay.y = 156
elseif enemyspecialloop >= 221 and enemyspecialloop <= 230 then enemy = enemyspecialleft[23] enemyplay.y = 156
elseif enemyspecialloop >= 231 and enemyspecialloop <= 240 then enemy = enemyspecialleft[24] enemyplay.y = 156
elseif enemyspecialloop >= 241 and enemyspecialloop <= 250 then enemy = enemyspecialleft[25] enemyplay.y = 156
elseif enemyspecialloop >= 251 and enemyspecialloop <= 260 then enemy = enemyspecialleft[26] enemyplay.y = 156
elseif enemyspecialloop >= 261 and enemyspecialloop <= 270 then enemy = enemyspecialleft[27] enemyplay.y = 156
elseif enemyspecialloop >= 271 and enemyspecialloop <= 280 then enemy = enemyspecialleft[28] enemyplay.y = 156
elseif enemyspecialloop >= 281 and enemyspecialloop <= 290 then enemy = enemyspecialleft[29] enemyplay.y = 156
elseif enemyspecialloop >= 291 and enemyspecialloop <= 300 then enemy = enemyspecialleft[30] enemyplay.y = 156

elseif enemyspecialloop >= 301 and enemyspecialloop <= 320 then enemy = enemyspecialleft[31] enemyplay.y = 156
elseif enemyspecialloop >= 321 and enemyspecialloop <= 340 then enemy = enemyspecialleft[32] enemyplay.y = 156
elseif enemyspecialloop >= 341 and enemyspecialloop <= 360 then enemy = enemyspecialleft[33] enemyplay.y = 156
elseif enemyspecialloop >= 361 and enemyspecialloop <= 380 then enemy = enemyspecialleft[34] enemyplay.y = 156
elseif enemyspecialloop >= 381 and enemyspecialloop <= 400 then enemy = enemyspecialleft[35] enemyplay.y = 156
elseif enemyspecialloop >= 401 and enemyspecialloop <= 430 then enemy = enemyspecialleft[36] enemyplay.y = 156
elseif enemyspecialloop > 430 then enemyspecialloop = 0 state = 0 specialstate = 0 end

if enemyspecialloop == 1 then enemyplay.x = currentX + 30
elseif enemyspecialloop == 11 then enemyplay.x = currentX + 30
elseif enemyspecialloop == 21 then enemyplay.x = currentX
elseif enemyspecialloop == 31 then enemyplay.x = currentX - 14
elseif enemyspecialloop == 41 then enemyplay.x = currentX - 12
elseif enemyspecialloop == 51 then enemyplay.y = 163 end

else

enemyspecialloop = enemyspecialloop + 1

if enemyspecialloop >= 1 and enemyspecialloop <= 10 then enemy = enemyspecialright[1] enemyplay.y = 195 --enemyplay.x = enemyplay.x + 30
elseif enemyspecialloop >= 11 and enemyspecialloop <= 20 then enemy = enemyspecialright[2] enemyplay.y = 195
elseif enemyspecialloop >= 21 and enemyspecialloop <= 30 then enemy = enemyspecialright[3] enemyplay.y = 185 --enemyplay.x = enemyplay.x - 35
elseif enemyspecialloop >= 31 and enemyspecialloop <= 40 then enemy = enemyspecialright[4] enemyplay.y = 185 --enemyplay.x = enemyplay.x - 14
elseif enemyspecialloop >= 41 and enemyspecialloop <= 50 then enemy = enemyspecialright[5] enemyplay.y = 185 --enemyplay.x = enemyplay.x - 12
elseif enemyspecialloop >= 51 and enemyspecialloop <= 60 then enemy = enemyspecialright[6] enemyplay.y = 163
elseif enemyspecialloop >= 61 and enemyspecialloop <= 70 then enemy = enemyspecialright[7] enemyplay.y = 156
elseif enemyspecialloop >= 71 and enemyspecialloop <= 80 then enemy = enemyspecialright[8] enemyplay.y = 156
elseif enemyspecialloop >= 81 and enemyspecialloop <= 90 then enemy = enemyspecialright[9] enemyplay.y = 156
elseif enemyspecialloop >= 91 and enemyspecialloop <= 100 then enemy = enemyspecialright[10] enemyplay.y = 156

elseif enemyspecialloop >= 101 and enemyspecialloop <= 110 then enemy = enemyspecialright[11] enemyplay.y = 156
elseif enemyspecialloop >= 111 and enemyspecialloop <= 120 then enemy = enemyspecialright[12] enemyplay.y = 156
elseif enemyspecialloop >= 121 and enemyspecialloop <= 130 then enemy = enemyspecialright[13] enemyplay.y = 156
elseif enemyspecialloop >= 131 and enemyspecialloop <= 140 then enemy = enemyspecialright[14] enemyplay.y = 156
elseif enemyspecialloop >= 141 and enemyspecialloop <= 150 then enemy = enemyspecialright[15] enemyplay.y = 156
elseif enemyspecialloop >= 151 and enemyspecialloop <= 160 then enemy = enemyspecialright[16] enemyplay.y = 156
elseif enemyspecialloop >= 161 and enemyspecialloop <= 170 then enemy = enemyspecialright[17] enemyplay.y = 156
elseif enemyspecialloop >= 171 and enemyspecialloop <= 180 then enemy = enemyspecialright[18] enemyplay.y = 156
elseif enemyspecialloop >= 181 and enemyspecialloop <= 190 then enemy = enemyspecialright[19] enemyplay.y = 156
elseif enemyspecialloop >= 191 and enemyspecialloop <= 200 then enemy = enemyspecialright[20] enemyplay.y = 156

elseif enemyspecialloop >= 201 and enemyspecialloop <= 210 then enemy = enemyspecialright[21] enemyplay.y = 156
elseif enemyspecialloop >= 211 and enemyspecialloop <= 220 then enemy = enemyspecialright[22] enemyplay.y = 156
elseif enemyspecialloop >= 221 and enemyspecialloop <= 230 then enemy = enemyspecialright[23] enemyplay.y = 156
elseif enemyspecialloop >= 231 and enemyspecialloop <= 240 then enemy = enemyspecialright[24] enemyplay.y = 156
elseif enemyspecialloop >= 241 and enemyspecialloop <= 250 then enemy = enemyspecialright[25] enemyplay.y = 156
elseif enemyspecialloop >= 251 and enemyspecialloop <= 260 then enemy = enemyspecialright[26] enemyplay.y = 156
elseif enemyspecialloop >= 261 and enemyspecialloop <= 270 then enemy = enemyspecialright[27] enemyplay.y = 156
elseif enemyspecialloop >= 271 and enemyspecialloop <= 280 then enemy = enemyspecialright[28] enemyplay.y = 156
elseif enemyspecialloop >= 281 and enemyspecialloop <= 290 then enemy = enemyspecialright[29] enemyplay.y = 156
elseif enemyspecialloop >= 291 and enemyspecialloop <= 300 then enemy = enemyspecialright[30] enemyplay.y = 156

elseif enemyspecialloop >= 301 and enemyspecialloop <= 320 then enemy = enemyspecialright[31] enemyplay.y = 156
elseif enemyspecialloop >= 321 and enemyspecialloop <= 340 then enemy = enemyspecialright[32] enemyplay.y = 156
elseif enemyspecialloop >= 341 and enemyspecialloop <= 360 then enemy = enemyspecialright[33] enemyplay.y = 156
elseif enemyspecialloop >= 361 and enemyspecialloop <= 380 then enemy = enemyspecialright[34] enemyplay.y = 156
elseif enemyspecialloop >= 381 and enemyspecialloop <= 400 then enemy = enemyspecialright[35] enemyplay.y = 156
elseif enemyspecialloop >= 401 and enemyspecialloop <= 430 then enemy = enemyspecialright[36] enemyplay.y = 156
elseif enemyspecialloop > 430 then enemyspecialloop = 0 enemystate = 1 enemyspecialstate = 0 end

if enemyspecialloop == 1 then enemyplay.x = currentX - 30
elseif enemyspecialloop == 11 then enemyplay.x = currentX - 30
elseif enemyspecialloop == 21 then enemyplay.x = currentX
elseif enemyspecialloop == 31 then enemyplay.x = currentX + 14
elseif enemyspecialloop == 41 then enemyplay.x = currentX + 12
elseif enemyspecialloop == 51 then enemyplay.y = 163
elseif enemyspecialloop == 151 then enemyplay.x = currentX - 30
elseif enemyspecialloop == 161 then enemyplay.x = currentX - 30
elseif enemyspecialloop == 171 then enemyplay.x = currentX - 30
elseif enemyspecialloop == 181 then enemyplay.x = currentX - 30
elseif enemyspecialloop == 191 then enemyplay.x = currentX - 30
elseif enemyspecialloop == 200 then enemyplay.x = currentX - 30

elseif enemyspecialloop == 241 then enemyplay.x = currentX + 30

elseif enemyspecialloop == 251 then enemyplay.x = currentX + 30
elseif enemyspecialloop == 271 then enemyplay.x = currentX + 30
elseif enemyspecialloop == 281 then enemyplay.x = currentX - 30
elseif enemyspecialloop == 291 then enemyplay.x = currentX - 30
elseif enemyspecialloop == 301 then enemyplay.x = currentX - 73
elseif enemyspecialloop == 321 then enemyplay.x = currentX - 70
elseif enemyspecialloop == 341 then enemyplay.x = currentX - 70
elseif enemyspecialloop == 361 then enemyplay.x = currentX - 89
elseif enemyspecialloop == 381 then enemyplay.x = currentX - 140
elseif enemyspecialloop == 401 then enemyplay.x = currentX - 150
elseif enemyspecialloop == 430 then enemyplay.x = currentX + 150 end
end

if enemyspecialloop == 430 and status == "attack range" and blockstate == 0 then hitstate = 1 playerH.x = playerH.x - 50 end
if enemyspecialloop == 430 then allowable = "nope" enemyspecialstate = 0 enemystopCur = 0
if enemyspecialloop == 430 and enemyhealth.x < 21 then enemytemp = 1 end enemyspecialloop = 0 end

if enemyspecialloop == 329 then enemyhealth.x = enemyhealth.x - 20 end
--if status == "attack range" and enemyspecialloop == 430 then hitstate = 1 playerH.x = playerH.x - 50 end
end
end




function enemykilled()

if enemykilledstate == 1 then

if lastdirection == 0 then

enemykilledloop = enemykilledloop + 1

if enemykilledloop >= 1 and enemykilledloop <= 15 then

enemy = enemykilledleft[1]
enemyplay.y = enemyplay.y - 6
enemyplay.x = enemyplay.x + 15

elseif enemykilledloop >= 16 and enemykilledloop <= 30 then

enemy = enemykilledleft[1]
enemyplay.y = enemyplay.y + 6
enemyplay.x = enemyplay.x + 15

elseif enemykilledloop >= 31 then

enemy = enemykilledleft[2]

end


else


enemykilledloop = enemykilledloop + 1
if enemykilledloop >= 1 and enemykilledloop <= 15 then

enemy = enemykilledright[1]
enemyplay.y = enemyplay.y - 6
enemyplay.x = enemyplay.x - 15

elseif enemykilledloop >= 16 and enemykilledloop <= 30 then

enemy = enemykilledright[1]
enemyplay.y = enemyplay.y + 6
enemyplay.x = enemyplay.x - 15

elseif enemykilledloop >= 31 then

enemy = enemykilledright[2]

end

end

end
end


function enemydamaged()


if enemycollision == 1 and enemyhitstate == 0 then
if punchloop == 10 or kickloop == 10 then

enemyhitstate = 1
enemystate = 0
end
end


if enemyhitstate == 1 and enemyblockloop == 0 and enemykickstate == 0 then

if lastdirection == 0 then

enemyhitloop = enemyhitloop + 1

if enemyhitloop >= 1 and enemyhitloop <= 7 then
enemy = enemyhitright
enemyplay.x = enemyplay.x + 1
hit = "true"

elseif enemyhitloop >= 8 and enemyhitloop <= 14 then
enemy = enemyhitright
enemyplay.x = enemyplay.x + 1

elseif enemyhitloop > 18 then
enemyhitloop = 0
enemystate = 1
enemyhitstate = 0
enemylastdirection = 1
buloy = 0
end

else

enemyhitloop = enemyhitloop + 1


if enemyhitloop >= 1 and enemyhitloop <= 7 then
enemy = enemyhitleft
enemyplay.x = enemyplay.x - 1
hit = "true"

elseif enemyhitloop >= 8 and enemyhitloop <= 14 then
enemy = enemyhitleft
enemyplay.x = enemyplay.x - 1

elseif enemyhitloop > 18 then
enemyhitloop = 0
enemystate = 1
enemyhitstate = 0
enemylastdirection = 0
buloy = 0
end
end
end


----- mabawasan ka .....

-- PS : Kalokohan lang ito ha!

if enemyhitstate == 1 and buloy == 0 then

enemyhealth.x = enemyhealth.x - 5
highscore = highscore + 5
--hit = "false"
buloy = 1
end

if enemyhealth.x <= 0 then

enemykilledstate = 1
enemykilled()
end

end

end

enemyiso = "true"
end




function gaaraWash()

icon = nil


standleft = {}
for inc = 1, 4 do
standleft[inc] = nil
end
walkleft = {}
for inc = 1, 2 do
walkleft[inc] = nil
end

jumpleft = {}
for inc = 1, 5 do
jumpleft[inc] = nil
end

blockleft = {}

blockleft[1] = nil
blockleft[2] = nil


retreatleft = {}

retreatleft[1] = nil
retreatleft[2] = nil


crouchleft = {}
for inc = 1, 4 do
crouchleft[inc] = nil
end

punchleft = {}
for inc = 1, 4 do
punchleft[inc] = nil
end

kickleft = {}
for inc = 1, 4 do
kickleft[inc] = nil
end

killedleft = {}
for inc = 1, 2 do
killedleft[inc] = nil
end

specialleft = {}
for inc = 1, 36 do
specialleft[inc] = nil
end

damagedleft = nil







standright = {}
for inc = 1,4 do
standright[inc] = nil
end
walkright = {}
for inc = 1, 2 do
walkright[inc] = nil
end

jumpright = {}
for inc = 1, 5 do
jumpright[inc] = nil
end

blockright = {}

blockright[1] = nil
blockright[2] = nil


retreatright = {}

retreatright[1] = nil
retreatright[2] = nil


crouchright = {}
for inc = 1, 4 do
crouchright[inc] = nil
end

punchright = {}
for inc = 1, 4 do
punchright[inc] = nil
end

kickright = {}
for inc = 1, 4 do
kickright[inc] = nil
end

killedright = {}
for inc = 1, 2 do
killedright[inc] = nil
end

specialright = {}
for inc = 1, 36 do
specialright[inc] = nil
end

damagedright = nil









eicon = nil

enemystandleft = {}
for inc = 1, 4 do
enemystandleft[inc] = nil
end

enemykickleft = {}
for inc = 1, 4 do
enemykickleft[inc] = nil
end


enemyjumpleft = {}
for inc = 1, 5 do
enemyjumpleft[inc] = nil
end

enemywalkleft = {}
for inc = 1, 2 do
enemywalkleft[inc] = nil
end


enemypunchleft = {}
for inc = 1, 4 do
enemypunchleft[inc] = nil
end


enemyretreatleft = {}

enemyretreatleft[1] = nil
enemyretreatleft[2] = nil



enemycrouchleft = {}

for inc = 1, 4 do
enemycrouchleft[inc] = nil
end



enemyblockleft = {}

enemyblockleft[1] = nil
enemyblockleft[2] = nil

enemyspecialleft = {}
for inc = 1, 36 do
enemyspecialleft[inc] = nil
end

enemykilledleft = {}
for inc = 1, 2 do
enemykilledleft[inc] = nil
end


enemyhitleft = {}
enemyhitleft[1] = nil


-- right


enemystandright = {}
for inc = 1, 4 do
enemystandright[inc] = nil
end

enemykickright = {}
for inc = 1, 4 do
enemykickright[inc] = nil
end


enemyjumpright = {}
for inc = 1, 5 do
enemyjumpright[inc] = nil
end

enemywalkright = {}
for inc = 1, 2 do
enemywalkright[inc] = nil
end


enemypunchright = {}
for inc = 1, 4 do
enemypunchright[inc] = nil
end


enemyretreatright = {}

enemyretreatright[1] = nil
enemyretreatright[2] = nil



enemycrouchright = {}

for inc = 1, 4 do
enemycrouchright[inc] = nil
end



enemyblockright = {}

enemyblockright[1] = nil
enemyblockright[2] = nil

enemyspecialright = {}
for inc = 1, 36 do
enemyspecialright[inc] = nil
end

enemykilledright = {}
for inc = 1, 2 do
enemykilledright[inc] = nil
end


enemyhitright = {}
enemyhitright[1] = nil



collectgarbage()




end


e quello di Naruto (in modo da confrontarli
if chosedplayer == "naruto" then

if iso == "false" then

-- player mo

-- left muna

icon = Image.load("charicon/narutoicon.png")


standleft = {}
for inc = 1, 4 do
standleft[inc] = Image.load("narutosprites/left/stand/stand"..inc..".png")
end
walkleft = {}
for inc = 1, 6 do
walkleft[inc] = Image.load("narutosprites/left/walk/walk"..inc..".png")
end

jumpleft = {}
for inc = 1, 4 do
jumpleft[inc] = Image.load("narutosprites/left/jump/jump"..inc..".png")
end

blockleft = {}

blockleft[1] = Image.load("narutosprites/left/block/block1.png")


retreatleft = {}

retreatleft[1] = Image.load("narutosprites/left/retreat/retreat1.png")
retreatleft[2] = Image.load("narutosprites/left/retreat/retreat2.png")


crouchleft = {}
for inc = 2, 3 do
crouchleft[inc] = Image.load("narutosprites/left/crouch/crouch"..inc..".png")
end

punchleft = {}
for inc = 1, 4 do
punchleft[inc] = Image.load("narutosprites/left/punch/punch"..inc..".png")
end

kickleft = {}
for inc = 1, 5 do
kickleft[inc] = Image.load("narutosprites/left/kick/kick"..inc..".png")
end

killedleft = {}
for inc = 1, 2 do
killedleft[inc] = Image.load("narutosprites/left/killed/killed"..inc..".png")
end

specialleft = {}
for inc = 1, 46 do
specialleft[inc] = Image.load("narutosprites/left/special/spl"..inc..".png")
end


damagedleft = Image.load("narutosprites/left/damaged/damaged1.png")


-- right naman


standright = {}
for inc = 1,4 do
standright[inc] = Image.load("narutosprites/right/stand/stand"..inc..".png")
end
walkright = {}
for inc = 1, 6 do
walkright[inc] = Image.load("narutosprites/right/walk/walk"..inc..".png")
end

jumpright = {}
for inc = 1, 4 do
jumpright[inc] = Image.load("narutosprites/right/jump/jump"..inc..".png")
end

blockright = {}

blockright[1] = Image.load("narutosprites/right/block/block1.png")


retreatright = {}

retreatright[1] = Image.load("narutosprites/right/retreat/retreat1.png")
retreatright[2] = Image.load("narutosprites/right/retreat/retreat2.png")


crouchright = {}
for inc = 2, 3 do
crouchright[inc] = Image.load("narutosprites/right/crouch/crouch"..inc..".png")
end

punchright = {}
for inc = 1, 4 do
punchright[inc] = Image.load("narutosprites/right/punch/punch"..inc..".png")
end

kickright = {}
for inc = 1, 5 do
kickright[inc] = Image.load("narutosprites/right/kick/kick"..inc..".png")
end

killedright = {}
for inc = 1, 2 do
killedright[inc] = Image.load("narutosprites/right/killed/killed"..inc..".png")
end

specialright = {}
for inc = 1, 46 do
specialright[inc] = Image.load("narutosprites/right/special/spl"..inc..".png")
end

damagedright = Image.load("narutosprites/right/damaged/damaged1.png")


function throw()

if throwstate == 1 then

klastD = lastdirection

if klastD == 0 then

throwloop = throwloop + 1

if throwloop >= 1 and throwloop <= 5 then

yourP = punchleft[1]

elseif throwloop >= 6 and throwloop <= 10 then

yourP = punchleft[2]

elseif throwloop >= 11 and throwloop <= 15 then

yourP = punchleft[3]

elseif throwloop >= 16 and throwloop <= 20 then

yourP = punchleft[4]

elseif throwloop > 20 then
throwloop = 0
state = 0
throwstate = 0
end

else

throwloop = throwloop + 1

if throwloop >= 1 and throwloop <= 5 then

yourP = punchright[1]

elseif throwloop >= 6 and throwloop <= 10 then

yourP = punchright[2]

elseif throwloop >= 11 and throwloop <= 15 then

yourP = punchright[3]

elseif throwloop >= 16 and throwloop <= 20 then

yourP = punchright[4]

elseif throwloop > 20 then
throwloop = 0
state = 0
throwstate = 0
end

end
end
end

function throwit()

if flyingstate == 1 then

if klastD == 0 then

if kny.x == 0 then

kny.x = player.x + 15

kny.y = player.y + 40

else

kny.x = kny.x + 10

screen:blit(kny.x, kny.y, kunayleft)

if kny.x >= enemyplay.x and enemylastdirection == 1 and (kny.y >= enemyplay.y and kny.y <= enemyplay.y + enemyplay.height) then


if enemyblockstate == 1 then

flyingstate = 0
kny.x = 0

else

enemyhitstate = 1
flyingstate = 0
kny.x = 0

end

end

if kny.x > 460 then
flyingstate = 0
kny.x = 0
end

end

else

if kny.x == 0 then

kny.x = player.x - 15

kny.y = player.y + 40

else

kny.x = kny.x - 10

screen:blit(kny.x, kny.y, kunayright)



if kny.x <= enemyplay.x and enemylastdirection == 0 and (kny.y >= enemyplay.y and kny.y <= enemyplay.y + enemyplay.height) then

if enemyblockstate == 1 then

flyingstate = 0
kny.x = 0

else

enemyhitstate = 1
flyingstate = 0
kny.x = 0

end

end

if kny.x < 0 then
flyingstate = 0
kny.x = 0
end

end

end
end

end


function run()
if lastdirection == 0 then
loop = loop + 1
if loop >= 1 and loop <= 4 then
yourP = walkleft[1]
player.x = player.x + 7
elseif loop >= 5 and loop <= 8 then
yourP = walkleft[2]
player.x = player.x + 7
elseif loop >= 9 and loop <= 12 then
yourP = walkleft[3]
player.x = player.x + 7
elseif loop >= 13 and loop <= 16 then
yourP = walkleft[4]
player.x = player.x + 7
elseif loop >= 17 and loop <= 20 then
yourP = walkleft[5]
player.x = player.x + 7
elseif loop >= 21 and loop <= 24 then
yourP = walkleft[6]
player.x = player.x + 7
elseif loop > 24 then
loop = 1
end

else

loop = loop + 1
if loop >= 1 and loop <= 4 then
yourP = walkright[1]
player.x = player.x - 7
elseif loop >= 5 and loop <= 8 then
yourP = walkright[2]
player.x = player.x - 7
elseif loop >= 9 and loop <= 12 then
yourP = walkright[3]
player.x = player.x - 7
elseif loop >= 13 and loop <= 16 then
yourP = walkright[4]
player.x = player.x - 7
elseif loop >= 17 and loop <= 20 then
yourP = walkright[5]
player.x = player.x - 7
elseif loop >= 21 and loop <= 24 then
yourP = walkright[6]
player.x = player.x - 7
elseif loop > 24 then
loop = 1
end

end
end

function jump()
if lastdirection == 0 then

if player.state == "jumping" then
player.jumpspeed = player.jumpspeed - 0.4
player.gravity = player.gravity - player.jumpspeed
end

jumploop = jumploop + 1
if jumploop >= 1 and jumploop <= 30 then
yourP = jumpleft[1]
elseif jumploop >= 31 and jumploop <= 60 then
yourP = jumpleft[2]
elseif jumploop >= 61 and jumploop <= 65 then
yourP = jumpleft[3]
elseif jumploop >= 66 and jumploop <= 70 then
yourP = jumpleft[4]
elseif jumploop > 70 then
jumploop = 0
end

if player.gravity < 0 then
player.state = "falling"
end

if player.gravity < 180 and player.state == "falling" then
player.gravity = player.gravity + (player.jumpspeed + 1)
end

if player.gravity >= 180 then
player.gravity = 180
player.jumpspeed = 11
player.state = "ground"
state = 0
jumpstate = 0
jumploop = 0
end

player.y = player.gravity

else

if player.state == "jumping" then
player.jumpspeed = player.jumpspeed - 0.4
player.gravity = player.gravity - player.jumpspeed
end

jumploop = jumploop + 1
if jumploop >= 1 and jumploop <= 30 then
yourP = jumpright[1]
elseif jumploop >= 31 and jumploop <= 60 then
yourP = jumpright[2]
elseif jumploop >= 61 and jumploop <= 65 then
yourP = jumpright[3]
elseif jumploop >= 66 and jumploop <= 70 then
yourP = jumpright[4]
elseif jumploop > 70 then
jumploop = 0
end

if player.gravity < 0 then
player.state = "falling"
end

if player.gravity < 180 and player.state == "falling" then
player.gravity = player.gravity + (player.jumpspeed + 1)
end

if player.gravity >= 180 then
player.gravity = 180
player.jumpspeed = 11
player.state = "ground"
state = 0
jumpstate = 0
jumploop = 0
end

player.y = player.gravity
end
end

function punch()
if lastdirection == 0 then

punchloop = punchloop + 1
if punchloop >= 1 and punchloop <= 10 then
yourP = punchleft[1]
elseif punchloop >= 11 and punchloop <= 15 then
yourP = punchleft[2]
elseif punchloop >= 16 and punchloop <= 18 then
yourP = punchleft[3]
elseif punchloop >= 19 and punchloop <= 25 then
yourP = punchleft[4]
elseif punchloop > 25 then
punchloop = 0
state = 0
punchstate = 0

end

else

punchloop = punchloop + 1
if punchloop >= 1 and punchloop <= 10 then
yourP = punchright[1]
elseif punchloop >= 11 and punchloop <= 15 then
yourP = punchright[2]
elseif punchloop >= 16 and punchloop <= 18 then
yourP = punchright[3]
elseif punchloop >= 19 and punchloop <= 25 then
yourP = punchright[4]
elseif punchloop > 25 then
punchloop = 0
state = 0
punchstate = 0

end
end
end

function kick()
if lastdirection == 0 then

kickloop = kickloop + 1
if kickloop >= 1 and kickloop <= 5 then
yourP = kickleft[1]
elseif kickloop >= 6 and kickloop <= 10 then
yourP = kickleft[2]
player.x = player.x + 3
elseif kickloop >= 11 and kickloop <= 15 then
yourP = kickleft[3]
player.x = player.x + 3
elseif kickloop >= 16 and kickloop <= 20 then
yourP = kickleft[4]
player.x = player.x + 3
elseif kickloop >= 21 and kickloop <= 25 then
yourP = kickleft[5]
player.x = player.x + 3
elseif kickloop > 25 then
kickloop = 0
kickstate = 0
state = 0

end

else

kickloop = kickloop + 1
if kickloop >= 1 and kickloop <= 5 then
yourP = kickright[1]
elseif kickloop >= 6 and kickloop <= 10 then
yourP = kickright[2]
player.x = player.x - 3
elseif kickloop >= 11 and kickloop <= 15 then
yourP = kickright[3]
player.x = player.x - 3
elseif kickloop >= 16 and kickloop <= 20 then
yourP = kickright[4]
player.x = player.x - 3
elseif kickloop >= 21 and kickloop <= 25 then
yourP = kickright[5]
player.x = player.x - 3
elseif kickloop > 25 then
kickloop = 0
kickstate = 0
state = 0

end
end
end

function retreat()
if lastdirection == 0 then

retreatloop = retreatloop + 1
if retreatloop >= 1 and retreatloop <= 7 then
yourP = retreatleft[1]
player.x = player.x - 6
player.y = player.y - 4
elseif retreatloop >= 8 and retreatloop <= 14 then
yourP = retreatleft[2]
player.x = player.x - 2
player.y = player.y + 4
elseif retreatloop > 10 then
retreatloop = 0
state = 0
retreatstate = 0
end

else

retreatloop = retreatloop + 1
if retreatloop >= 1 and retreatloop <= 7 then
yourP = retreatright[1]
player.x = player.x + 6
player.y = player.y - 4
elseif retreatloop >= 8 and retreatloop <= 14 then
yourP = retreatright[2]
player.x = player.x + 2
player.y = player.y + 4
elseif retreatloop > 10 then
retreatloop = 0
state = 0
retreatstate = 0
end
end
end

function crouch()
if lastdirection == 0 then
crouchloop = crouchloop + 1
if crouchloop >= 1 and crouchloop <= 2 then
yourP = crouchleft[2]
elseif crouchloop > 3 then
yourP = crouchleft[3]
end
else
crouchloop = crouchloop + 1
if crouchloop >= 1 and crouchloop <= 2 then
yourP = crouchright[2]
elseif crouchloop > 3 then
yourP = crouchright[3]
end
end
crouchstate = 0
end

function block()
if lastdirection == 0 then
blockloop = blockloop + 1

if blockloop >= 1 and blockloop <= 2 then
yourP = blockleft[1]
elseif blockloop >= 3 and blockloop <= 4 then
yourP = blockleft[1]
end
else
blockloop = blockloop + 1
if blockloop >= 1 and blockloop <= 2 then
yourP = blockright[1]
elseif blockloop >= 3 and blockloop <= 4 then
yourP = blockright[1]
end
end


blockstate = 0

end



function specialTech()

if specialstate == 1 then
if lastdirection == 0 then
specialloop = specialloop + 1

if specialloop >= 1 and specialloop <= 10 then yourP = specialleft[1]
elseif specialloop >= 6 and specialloop <= 20 then yourP = specialleft[2]
elseif specialloop >= 11 and specialloop <= 30 then yourP = specialleft[3]
elseif specialloop >= 16 and specialloop <= 40 then yourP = specialleft[4]
elseif specialloop >= 21 and specialloop <= 50 then yourP = specialleft[5]
elseif specialloop >= 26 and specialloop <= 60 then yourP = specialleft[6]
elseif specialloop >= 31 and specialloop <= 70 then yourP = specialleft[7]
elseif specialloop >= 35 and specialloop <= 80 then yourP = specialleft[8]
elseif specialloop >= 41 and specialloop <= 90 then yourP = specialleft[9]
elseif specialloop >= 46 and specialloop <= 100 then yourP = specialleft[10]

elseif specialloop >= 51 and specialloop <= 110 then yourP = specialleft[11]
elseif specialloop >= 56 and specialloop <= 120 then yourP = specialleft[12]
elseif specialloop >= 62 and specialloop <= 130 then yourP = specialleft[13]
elseif specialloop >= 66 and specialloop <= 140 then yourP = specialleft[14]
elseif specialloop >= 71 and specialloop <= 150 then yourP = specialleft[15]
elseif specialloop >= 76 and specialloop <= 160 then yourP = specialleft[16]
elseif specialloop >= 81 and specialloop <= 170 then yourP = specialleft[17]
elseif specialloop >= 86 and specialloop <= 180 then yourP = specialleft[18]
elseif specialloop >= 91 and specialloop <= 190 then yourP = specialleft[19]
elseif specialloop >= 96 and specialloop <= 200 then yourP = specialleft[20]

elseif specialloop >= 101 and specialloop <= 210 then yourP = specialleft[21]
elseif specialloop >= 106 and specialloop <= 220 then yourP = specialleft[22]
elseif specialloop >= 111 and specialloop <= 230 then yourP = specialleft[23]
elseif specialloop >= 116 and specialloop <= 240 then yourP = specialleft[24]
elseif specialloop >= 121 and specialloop <= 250 then yourP = specialleft[25]
elseif specialloop >= 126 and specialloop <= 260 then yourP = specialleft[26]
elseif specialloop >= 131 and specialloop <= 270 then yourP = specialleft[27]
elseif specialloop >= 136 and specialloop <= 280 then yourP = specialleft[28]
elseif specialloop >= 141 and specialloop <= 290 then yourP = specialleft[29]
elseif specialloop >= 146 and specialloop <= 300 then yourP = specialleft[30]

elseif specialloop >= 151 and specialloop <= 310 then yourP = specialleft[31]
elseif specialloop >= 156 and specialloop <= 320 then yourP = specialleft[32]
elseif specialloop >= 161 and specialloop <= 330 then yourP = specialleft[33]
elseif specialloop >= 166 and specialloop <= 340 then yourP = specialleft[34]
elseif specialloop >= 171 and specialloop <= 350 then yourP = specialleft[35]
elseif specialloop >= 176 and specialloop <= 360 then yourP = specialleft[36]
elseif specialloop >= 181 and specialloop <= 370 then yourP = specialleft[37]
elseif specialloop >= 186 and specialloop <= 380 then yourP = specialleft[38]
elseif specialloop >= 191 and specialloop <= 390 then yourP = specialleft[39]
elseif specialloop >= 196 and specialloop <= 400 then yourP = specialleft[40]

elseif specialloop >= 201 and specialloop <= 410 then yourP = specialleft[41]
elseif specialloop >= 206 and specialloop <= 420 then yourP = specialleft[42]
elseif specialloop > 420 then specialloop = 0 specialstate = 0 state = 0 end


if specialloop >= 271 and specialloop <= 300 then
yourTemp = specialright[43]
screen:blit(enemyplay.x + 30, enemyplay.y - 40, yourTemp)
elseif specialloop >= 301 and specialloop <= 310 then
yourTemp = specialright[44]
screen:blit(enemyplay.x + 20, enemyplay.y - 30, yourTemp)
elseif specialloop >= 311 and specialloop <= 320 then
yourTemp = specialright[45]
screen:blit(enemyplay.x + 10, enemyplay.y - 20, yourTemp)
elseif specialloop >= 321 and specialloop <= 330 then
yourTemp = specialright[46]
screen:blit(enemyplay.x, enemyplay.y - 10, yourTemp) end


if specialloop >= 301 and specialloop <= 330 then
yourTemp = specialleft[43]
screen:blit(enemyplay.x - 40, enemyplay.y - 40, yourTemp)
elseif specialloop >= 331 and specialloop <= 340 then
yourTemp = specialleft[44]
screen:blit(enemyplay.x - 30, enemyplay.y - 30, yourTemp)
elseif specialloop >= 341 and specialloop <= 350 then
yourTemp = specialleft[45]
screen:blit(enemyplay.x - 20, enemyplay.y - 20, yourTemp)
elseif specialloop >= 351 and specialloop <= 360 then
yourTemp = specialleft[46]
screen:blit(enemyplay.x, enemyplay.y - 10, yourTemp) end


if specialloop == 360 and enemyblockloop < 1 then enemyhitstate = 1 enemyhealth.x = enemyhealth.x - 50 end
if specialloop == 1 then playerH.x = playerH.x - 20 end

else

specialloop = specialloop + 1

if specialloop >= 1 and specialloop <= 10 then yourP = specialright[1]
elseif specialloop >= 11 and specialloop <= 20 then yourP = specialright[2]
elseif specialloop >= 21 and specialloop <= 30 then yourP = specialright[3]
elseif specialloop >= 31 and specialloop <= 40 then yourP = specialright[4]
elseif specialloop >= 41 and specialloop <= 50 then yourP = specialright[5]
elseif specialloop >= 51 and specialloop <= 60 then yourP = specialright[6]
elseif specialloop >= 61 and specialloop <= 70 then yourP = specialright[7]
elseif specialloop >= 71 and specialloop <= 80 then yourP = specialright[8]
elseif specialloop >= 81 and specialloop <= 90 then yourP = specialright[9]
elseif specialloop >= 91 and specialloop <= 100 then yourP = specialright[10]

elseif specialloop >= 101 and specialloop <= 110 then yourP = specialright[11]
elseif specialloop >= 111 and specialloop <= 120 then yourP = specialright[12]
elseif specialloop >= 121 and specialloop <= 130 then yourP = specialright[13]
elseif specialloop >= 131 and specialloop <= 140 then yourP = specialright[14]
elseif specialloop >= 141 and specialloop <= 150 then yourP = specialright[15]
elseif specialloop >= 151 and specialloop <= 160 then yourP = specialright[16]
elseif specialloop >= 161 and specialloop <= 170 then yourP = specialright[17]
elseif specialloop >= 171 and specialloop <= 180 then yourP = specialright[18]
elseif specialloop >= 181 and specialloop <= 190 then yourP = specialright[19]
elseif specialloop >= 191 and specialloop <= 200 then yourP = specialright[20]

elseif specialloop >= 201 and specialloop <= 210 then yourP = specialright[21]
elseif specialloop >= 211 and specialloop <= 220 then yourP = specialright[22]
elseif specialloop >= 221 and specialloop <= 230 then yourP = specialright[23]
elseif specialloop >= 231 and specialloop <= 240 then yourP = specialright[24]
elseif specialloop >= 241 and specialloop <= 250 then yourP = specialright[25]
elseif specialloop >= 251 and specialloop <= 260 then yourP = specialright[26]
elseif specialloop >= 261 and specialloop <= 270 then yourP = specialright[27]
elseif specialloop >= 271 and specialloop <= 280 then yourP = specialright[28]
elseif specialloop >= 281 and specialloop <= 290 then yourP = specialright[29]
elseif specialloop >= 291 and specialloop <= 300 then yourP = specialright[30]

elseif specialloop >= 301 and specialloop <= 310 then yourP = specialright[31]
elseif specialloop >= 311 and specialloop <= 320 then yourP = specialright[32]
elseif specialloop >= 321 and specialloop <= 330 then yourP = specialright[33]
elseif specialloop >= 331 and specialloop <= 340 then yourP = specialright[34]
elseif specialloop >= 341 and specialloop <= 350 then yourP = specialright[35]
elseif specialloop >= 351 and specialloop <= 360 then yourP = specialright[36]
elseif specialloop >= 361 and specialloop <= 370 then yourP = specialright[37]
elseif specialloop >= 371 and specialloop <= 380 then yourP = specialright[38]
elseif specialloop >= 381 and specialloop <= 390 then yourP = specialright[39]
elseif specialloop >= 391 and specialloop <= 400 then yourP = specialright[40]

elseif specialloop >= 401 and specialloop <= 410 then yourP = specialright[41]
elseif specialloop >= 411 and specialloop <= 420 then yourP = specialright[42]
elseif specialloop > 420 then specialloop = 0 specialstate = 0 state = 0 end


if specialloop >= 271 and specialloop <= 300 then
yourTemp = specialright[43]
screen:blit(enemyplay.x + 30, enemyplay.y - 40, yourTemp)
elseif specialloop >= 301 and specialloop <= 310 then
yourTemp = specialright[44]
screen:blit(enemyplay.x + 20, enemyplay.y - 30, yourTemp)
elseif specialloop >= 311 and specialloop <= 320 then
yourTemp = specialright[45]
screen:blit(enemyplay.x + 10, enemyplay.y - 20, yourTemp)
elseif specialloop >= 321 and specialloop <= 330 then
yourTemp = specialright[46] enemyhitstate = 1
screen:blit(enemyplay.x, enemyplay.y - 10, yourTemp) end


if specialloop >= 301 and specialloop <= 330 then
yourTemp = specialleft[43]
screen:blit(enemyplay.x - 40, enemyplay.y - 40, yourTemp)
elseif specialloop >= 331 and specialloop <= 340 then
yourTemp = specialleft[44]
screen:blit(enemyplay.x - 30, enemyplay.y - 30, yourTemp)
elseif specialloop >= 341 and specialloop <= 350 then
yourTemp = specialleft[45]
screen:blit(enemyplay.x - 20, enemyplay.y - 20, yourTemp)
elseif specialloop >= 351 and specialloop <= 360 then
yourTemp = specialleft[46] enemyhitstate = 1
screen:blit(enemyplay.x, enemyplay.y - 10, yourTemp) end


if specialloop == 360 and enemyblockloop < 1 then enemyhitstate = 1 enemyhealth.x = enemyhealth.x - 50 end
if specialloop == 1 then playerH.x = playerH.x - 20 end

--if specialloop == 365 then enemy = killed

end
end
end



function killed()

if killedstate == 1 then

if enemylastdirection == 0 then

killedloop = killedloop + 1

if killedloop >= 1 and killedloop <= 15 then

yourP = killedleft[1]
player.y = player.y - 6
player.x = player.x + 15

elseif killedloop >= 16 and killedloop <= 30 then

yourP = killedleft[1]
player.y = player.y + 6
player.x = player.x + 15

elseif killedloop >= 31 then

yourP = killedleft[2]

end


else


killedloop = killedloop + 1
if killedloop >= 1 and killedloop <= 15 then

yourP = killedright[1]
player.y = player.y - 6
player.x = player.x - 15

elseif killedloop >= 16 and killedloop <= 30 then

yourP = killedright[1]
player.y = player.y + 6
player.x = player.x - 15

elseif killedloop >= 31 then

yourP = killedright[2]

end

end

end
end


function damaged()


if blockloop == 0 and enemycollision == 1 and crouchstate == 0 and retreatstate == 0 then
if enemypunchloop == 20 or enemykickloop == 20 then

damagedstate = 1
state = ""
end
end


if damagedstate == 1 then

if enemylastdirection == 1 then

damagedloop = damagedloop + 1

if damagedloop >= 1 and damagedloop <= 7 then
yourP = damagedleft
player.x = player.x - 1

elseif damagedloop >= 8 and damagedloop <= 14 then
yourP = damagedleft
player.x = player.x - 1


elseif damagedloop > 21 then
damagedloop = 0
state = 0
damagedstate = 0
lastdirection = 0
end

else

damagedloop = damagedloop + 1

if damagedloop >= 1 and damagedloop <= 9 then
yourP = damagedright
player.x = player.x + 1

elseif damagedloop >= 10 and damagedloop <= 18 then
yourP = damagedright
player.x = player.x + 1

elseif damagedloop > 25 then
damagedloop = 0
state = 0
damagedstate = 0
lastdirection = 1
end
end
end


----- mabawasan ka .....

-- PS : Kalokohan lang ito ha!

-- another PS : ay, tunay pala ito, juk lng ...


if damagedstate == 1 and damagedloop == 2 then
playerH.x = playerH.x - 5
end

if playerH.x <= 0 then
killedstate = 1
killed()
end


end

end
iso = "true"
end









if chosedenemy == "naruto" then

if enemyiso == "false" then

eicon = Image.load("charicon/narutoicon.png")

enemystandleft = {}
for inc = 1, 4 do
enemystandleft[inc] = Image.load("narutosprites/left/stand/stand"..inc..".png")
end

enemykickleft = {}
for inc = 1, 5 do
enemykickleft[inc] = Image.load("narutosprites/left/kick/kick"..inc..".png")
end


enemyjumpleft = {}
for inc = 1, 4 do
enemyjumpleft[inc] = Image.load("narutosprites/left/jump/jump"..inc..".png")
end

enemywalkleft = {}
for inc = 1, 6 do
enemywalkleft[inc] = Image.load("narutosprites/left/walk/walk"..inc..".png")
end


enemypunchleft = {}
for inc = 1, 4 do
enemypunchleft[inc] = Image.load("narutosprites/left/punch/punch"..inc..".png")
end


enemyretreatleft = {}

enemyretreatleft[1] = Image.load("narutosprites/left/retreat/retreat1.png")
enemyretreatleft[2] = Image.load("narutosprites/left/retreat/retreat2.png")



enemycrouchleft = {}

for inc = 2, 3 do
enemycrouchleft[inc] = Image.load("narutosprites/left/crouch/crouch"..inc..".png")
end



enemyblockleft = {}

enemyblockleft[1] = Image.load("narutosprites/left/block/block1.png")


enemyspecialleft = {}
for inc = 1, 46 do
enemyspecialleft[inc] = Image.load("narutosprites/left/special/spl"..inc..".png")
end


enemykilledleft = {}
for inc = 1, 2 do
enemykilledleft[inc] = Image.load("narutosprites/left/killed/killed"..inc..".png")
end


enemyhitleft = {}
enemyhitleft[1] = Image.load("narutosprites/left/damaged/damaged1.png")


-- right


enemystandright = {}
for inc = 1, 4 do
enemystandright[inc] = Image.load("narutosprites/right/stand/stand"..inc..".png")
end

enemykickright = {}
for inc = 1, 5 do
enemykickright[inc] = Image.load("narutosprites/right/kick/kick"..inc..".png")
end


enemyjumpright = {}
for inc = 1, 4 do
enemyjumpright[inc] = Image.load("narutosprites/right/jump/jump"..inc..".png")
end

enemywalkright = {}
for inc = 1, 6 do
enemywalkright[inc] = Image.load("narutosprites/right/walk/walk"..inc..".png")
end


enemypunchright = {}
for inc = 1, 4 do
enemypunchright[inc] = Image.load("narutosprites/right/punch/punch"..inc..".png")
end


enemyretreatright = {}

enemyretreatright[1] = Image.load("narutosprites/right/retreat/retreat1.png")
enemyretreatright[2] = Image.load("narutosprites/right/retreat/retreat2.png")



enemycrouchright = {}

for inc = 2, 3 do
enemycrouchright[inc] = Image.load("narutosprites/left/crouch/crouch"..inc..".png")
end



enemyblockright = {}

enemyblockright[1] = Image.load("narutosprites/right/block/block1.png")


enemyspecialright = {}
for inc = 1, 46 do
enemyspecialright[inc] = Image.load("narutosprites/right/special/spl"..inc..".png")
end



enemykilledright = {}
for inc = 1, 2 do
enemykilledright[inc] = Image.load("narutosprites/right/killed/killed"..inc..".png")
end


enemyhitright = {}
enemyhitright[1] = Image.load("narutosprites/right/damaged/damaged1.png")






function enemythrow()

if enemythrowstate == 1 then

if enemylastdirection == 0 then

enemythrowloop = enemythrowloop + 1

if enemythrowloop >= 1 and enemythrowloop <= 5 then

enemy = enemypunchleft[1]

elseif enemythrowloop >= 6 and enemythrowloop <= 10 then

enemy = enemypunchleft[2]

elseif enemythrowloop >= 11 and enemythrowloop <= 15 then

enemy = enemypunchleft[3]

elseif enemythrowloop >= 16 and enemythrowloop <= 20 then

enemy = enemypunchleft[4]

elseif enemythrowloop > 20 then
enemythrowloop = 0
enemystate = 1
enemythrowstate = 0
end

else

enemythrowloop = enemythrowloop + 1

if enemythrowloop >= 1 and enemythrowloop <= 5 then

enemy = enemypunchright[1]

elseif enemythrowloop >= 6 and enemythrowloop <= 10 then

enemy = enemypunchright[2]

elseif enemythrowloop >= 11 and enemythrowloop <= 15 then

enemy = enemypunchright[3]

elseif enemythrowloop >= 16 and enemythrowloop <= 20 then

enemy = enemypunchright[4]

elseif enemythrowloop > 20 then
enemythrowloop = 0
enemystate = 1
enemythrowstate = 0
end

end
end
end

---------------- papaganahin pa lang -------------------

----------------- nagana na kaya ---------------------

function enemythrowit()

if enemyflyingstate == 1 then

if enemylastdirection == 0 then

if enemykny.x == 0 then

enemykny.x = enemyplay.x + 15

enemykny.y = enemyplay.y + 40

else

enemykny.x = enemykny.x + 10

screen:blit(enemykny.x, enemykny.y, kunayleft)

if enemykny.x >= player.x and enemylastdirection == 0 and (enemykny.y >= player.y and enemykny.y <= player.y + player.height) then

enemyflyingstate = 0
enemykny.x = 0
throwcd = 0

if blockloop > 0 then

damagedstate = 0

else

damagedstate = 1
enemyflyingstate = 0
enemykny.x = 0
throwcd = 0

end


end

if enemykny.x > 460 then
enemyflyingstate = 0
enemykny.x = 0
end

end

else

if enemykny.x == 0 then

enemykny.x = enemyplay.x - 15

enemykny.y = enemyplay.y + 40

else

enemykny.x = enemykny.x - 10

screen:blit(enemykny.x, enemykny.y, kunayright)



if enemykny.x <= player.x and enemylastdirection == 1 and (enemykny.y >= player.y and enemykny.y <= player.y + player.height) then

enemyflyingstate = 0
enemykny.x = 0
throwcd = 0

if blockloop > 0 then

damagedstate = 0

else

damagedstate = 1
enemyflyingstate = 0
enemykny.x = 0
throwcd = 0

end

end

if enemykny.x < 0 then
enemyflyingstate = 0
enemykny.x = 0
end

end

end
end

end


function enemyrun()
if enemylastdirection == 0 then
enemyloop = enemyloop + 1
if enemyloop >= 1 and enemyloop <= 4 then
enemy = enemywalkleft[1]
enemyplay.x = enemyplay.x + 7
elseif enemyloop >= 5 and enemyloop <= 8 then
enemy = enemywalkleft[2]
enemyplay.x = enemyplay.x + 7
elseif enemyloop >= 9 and enemyloop <= 12 then
enemy = enemywalkleft[3]
enemyplay.x = enemyplay.x + 7
elseif enemyloop >= 13 and enemyloop <= 16 then
enemy = enemywalkleft[4]
enemyplay.x = enemyplay.x + 7
elseif enemyloop >= 17 and enemyloop <= 20 then
enemy = enemywalkleft[5]
enemyplay.x = enemyplay.x + 7
elseif enemyloop >= 21 and enemyloop <= 24 then
enemy = enemywalkleft[6]
enemyplay.x = enemyplay.x + 7
elseif enemyloop > 24 then
enemyloop = 1
end

else
enemyloop = enemyloop + 1
if enemyloop >= 1 and enemyloop <= 4 then
enemy = enemywalkright[1]
enemyplay.x = enemyplay.x - 7
elseif enemyloop >= 5 and enemyloop <= 8 then
enemy = enemywalkright[2]
enemyplay.x = enemyplay.x - 7
elseif enemyloop >= 9 and enemyloop <= 12 then
enemy = enemywalkright[3]
enemyplay.x = enemyplay.x - 7
elseif enemyloop >= 13 and enemyloop <= 16 then
enemy = enemywalkright[4]
enemyplay.x = enemyplay.x - 7
elseif enemyloop >= 17 and enemyloop <= 20 then
enemy = enemywalkright[5]
enemyplay.x = enemyplay.x - 7
elseif enemyloop >= 21 and enemyloop <= 24 then
enemy = enemywalkright[6]
enemyplay.x = enemyplay.x - 7
elseif enemyloop > 24 then
enemyloop = 1
end
end
end

function enemyjump()
if enemystate == 0 then
if enemylastdirection == 0 then

if enemyplay.state == "jumping" then
enemyplay.jumpspeed = enemyplay.jumpspeed - 0.4
enemyplay.gravity = enemyplay.gravity - enemyplay.jumpspeed
end

enemyjumploop = enemyjumploop + 1
if enemyjumploop >= 1 and enemyjumploop <= 15 then
enemy = enemyjumpleft[1]
elseif enemyjumploop >= 16 and enemyjumploop <= 30 then
enemy = enemyjumpleft[1]
elseif enemyjumploop >= 31 and enemyjumploop <= 45 then
enemy = enemyjumpleft[2]
elseif enemyjumploop >= 46 and enemyjumploop <= 60 then
enemy = enemyjumpleft[2]
elseif enemyjumploop >= 61 and enemyjumploop <= 65 then
enemy = enemyjumpleft[2]
elseif enemyjumploop > 65 then
enemyjumploop = 0
end

if enemyplay.gravity < 0 then
enemyplay.state = "falling"
end

if enemyplay.gravity < 180 and enemyplay.state == "falling" then
enemyplay.gravity = enemyplay.gravity + (enemyplay.jumpspeed + 1)
end

if enemyplay.gravity >= 180 then
enemyplay.gravity = 180
enemyplay.jumpspeed = 10
enemyplay.state = "ground"
enemystate = 1
enemyjumpstate = 0
enemyjumploop = 0
end

enemyplay.y = enemyplay.gravity


else

if enemyplay.state == "jumping" then
enemyplay.jumpspeed = enemyplay.jumpspeed - 0.4
enemyplay.gravity = enemyplay.gravity - enemyplay.jumpspeed
end

enemyjumploop = enemyjumploop + 1
if enemyjumploop >= 1 and enemyjumploop <= 15 then
enemy = enemyjumpright[1]
elseif enemyjumploop >= 16 and enemyjumploop <= 30 then
enemy = enemyjumpright[1]
elseif enemyjumploop >= 31 and enemyjumploop <= 45 then
enemy = enemyjumpright[2]
elseif enemyjumploop >= 46 and enemyjumploop <= 60 then
enemy = enemyjumpright[2]
elseif enemyjumploop >= 61 and enemyjumploop <= 65 then
enemy = enemyjumpright[2]
elseif enemyjumploop > 65 then
enemyjumploop = 0
end

if enemyplay.gravity < 0 then
enemyplay.state = "falling"
end

if enemyplay.gravity < 180 and enemyplay.state == "falling" then
enemyplay.gravity = enemyplay.gravity + (enemyplay.jumpspeed + 1)
end

if enemyplay.gravity >= 180 then
enemyplay.gravity = 180
enemyplay.jumpspeed = 10
enemyplay.state = "ground"
enemystate = 1
enemyjumpstate = 0
enemyjumploop = 0
end

enemyplay.y = enemyplay.gravity
end
end
end


function enemyjumpApp()
if enemystate == 0 then
if enemylastdirection == 0 then

if enemyplay.state == "jumping" then
enemyplay.jumpspeed = enemyplay.jumpspeed - 0.4
enemyplay.gravity = enemyplay.gravity - enemyplay.jumpspeed
end

enemyjumploop = enemyjumploop + 1
if enemyjumploop >= 1 and enemyjumploop <= 15 then
enemy = enemyjumpleft[1]
enemyplay.x = enemyplay.x + 3
elseif enemyjumploop >= 16 and enemyjumploop <= 30 then
enemy = enemyjumpleft[1]
enemyplay.x = enemyplay.x + 3
elseif enemyjumploop >= 31 and enemyjumploop <= 45 then
enemy = enemyjumpleft[2]
enemyplay.x = enemyplay.x + 3
elseif enemyjumploop >= 46 and enemyjumploop <= 60 then
enemy = enemyjumpleft[2]
enemyplay.x = enemyplay.x + 3
elseif enemyjumploop >= 61 and enemyjumploop <= 65 then
enemy = enemyjumpleft[2]
elseif enemyjumploop > 65 then
enemyjumploop = 0
end

if enemyplay.gravity < 0 then
enemyplay.state = "falling"
end

if enemyplay.gravity < 180 and enemyplay.state == "falling" then
enemyplay.gravity = enemyplay.gravity + (enemyplay.jumpspeed + 1)
end

if enemyplay.gravity >= 180 then
enemyplay.gravity = 180
enemyplay.jumpspeed = 10
enemyplay.state = "ground"
enemystate = 1
enemyjumpstate = 0
enemyjumploop = 0
end

enemyplay.y = enemyplay.gravity


else

if enemyplay.state == "jumping" then
enemyplay.jumpspeed = enemyplay.jumpspeed - 0.4
enemyplay.gravity = enemyplay.gravity - enemyplay.jumpspeed
end

enemyjumploop = enemyjumploop + 1
if enemyjumploop >= 1 and enemyjumploop <= 15 then
enemy = enemyjumpright[1]
enemyplay.x = enemyplay.x - 3
elseif enemyjumploop >= 16 and enemyjumploop <= 30 then
enemy = enemyjumpright[1]
enemyplay.x = enemyplay.x - 3
elseif enemyjumploop >= 31 and enemyjumploop <= 45 then
enemy = enemyjumpright[2]
enemyplay.x = enemyplay.x - 3
elseif enemyjumploop >= 46 and enemyjumploop <= 60 then
enemy = enemyjumpright[2]
enemyplay.x = enemyplay.x - 3
elseif enemyjumploop >= 61 and enemyjumploop <= 65 then
enemy = enemyjumpright[2]
elseif enemyjumploop > 65 then
enemyjumploop = 0
end

if enemyplay.gravity < 0 then
enemyplay.state = "falling"
end

if enemyplay.gravity < 180 and enemyplay.state == "falling" then
enemyplay.gravity = enemyplay.gravity + (enemyplay.jumpspeed + 1)
end

if enemyplay.gravity >= 180 then
enemyplay.gravity = 180
enemyplay.jumpspeed = 10
enemyplay.state = "ground"
enemystate = 1
enemyjumpstate = 0
enemyjumploop = 0
end

enemyplay.y = enemyplay.gravity
end
end
end



function enemypunch()
if enemylastdirection == 0 then

enemypunchloop = enemypunchloop + 1
if enemypunchloop >= 1 and enemypunchloop <= 10 then
enemy = enemypunchleft[1]
elseif enemypunchloop >= 11 and enemypunchloop <= 15 then
enemy = enemypunchleft[2]
elseif enemypunchloop >= 16 and enemypunchloop <= 18 then
enemy = enemypunchleft[3]
elseif enemypunchloop >= 19 and enemypunchloop <= 25 then
enemy = enemypunchleft[4]
elseif enemypunchloop > 25 then
enemypunchloop = 0
enemystate = 0
enemypunchstate = 0
end

else

enemypunchloop = enemypunchloop + 1
if enemypunchloop >= 1 and enemypunchloop <= 10 then
enemy = enemypunchright[1]
elseif enemypunchloop >= 11 and enemypunchloop <= 15 then
enemy = enemypunchright[2]
elseif enemypunchloop >= 16 and enemypunchloop <= 18 then
enemy = enemypunchright[3]
elseif enemypunchloop >= 19 and enemypunchloop <= 25 then
enemy = enemypunchright[4]
elseif enemypunchloop > 25 then
enemypunchloop = 0
enemystate = 0
enemypunchstate = 0
end
end
end

function enemykick()
if enemylastdirection == 0 then

enemykickloop = enemykickloop + 1
if enemykickloop >= 1 and enemykickloop <= 5 then
enemy = enemykickleft[1]
elseif enemykickloop >= 6 and enemykickloop <= 10 then
enemy = enemykickleft[2]
enemyplay.x = enemyplay.x + 3
elseif enemykickloop >= 11 and enemykickloop <= 15 then
enemy = enemykickleft[3]
enemyplay.x = enemyplay.x + 3
elseif enemykickloop >= 16 and enemykickloop <= 20 then
enemy = enemykickleft[4]
enemyplay.x = enemyplay.x + 3
elseif enemykickloop >= 21 and enemykickloop <= 25 then
enemy = enemykickleft[5]
enemyplay.x = enemyplay.x + 3
elseif enemykickloop > 25 then
enemykickloop = 0
enemykickstate = 0
enemystate = 0
end


else

enemykickloop = enemykickloop + 1
if enemykickloop >= 1 and enemykickloop <= 5 then
enemy = enemykickright[1]
elseif enemykickloop >= 6 and enemykickloop <= 10 then
enemy = enemykickright[2]
enemyplay.x = enemyplay.x - 3
elseif enemykickloop >= 11 and enemykickloop <= 15 then
enemy = enemykickright[3]
enemyplay.x = enemyplay.x - 3
elseif enemykickloop >= 16 and enemykickloop <= 20 then
enemy = enemykickright[4]
enemyplay.x = enemyplay.x - 3
elseif enemykickloop >= 21 and enemykickloop <= 25 then
enemy = enemykickright[5]
enemyplay.x = enemyplay.x - 3
elseif enemykickloop > 25 then
enemykickloop = 0
enemykickstate = 0
enemystate = 0
end
end
end

function enemyretreat()
if enemylastdirection == 0 then

enemyretreatloop = enemyretreatloop + 1
if enemyretreatloop >= 1 and enemyretreatloop <= 7 then
enemy = enemyretreatleft[1]
enemyplay.x = enemyplay.x - 6
enemyplay.y = enemyplay.y - 4
elseif enemyretreatloop >= 8 and enemyretreatloop <= 14 then
enemy = enemyretreatleft[2]
enemyplay.x = enemyplay.x - 2
enemyplay.y = enemyplay.y + 4
elseif enemyretreatloop > 14 then
enemyretreatloop = 0
enemystate = 1
enemyretreatstate = 0
end


else

enemyretreatloop = enemyretreatloop + 1
if enemyretreatloop >= 1 and enemyretreatloop <= 7 then
enemy = enemyretreatright[1]
enemyplay.x = enemyplay.x + 6
enemyplay.y = enemyplay.y - 4
elseif enemyretreatloop >= 8 and enemyretreatloop <= 14 then
enemy = enemyretreatright[2]
enemyplay.x = enemyplay.x + 2
enemyplay.y = enemyplay.y + 4
elseif enemyretreatloop > 14 then
enemyretreatloop = 0
enemystate = 1
enemyretreatstate = 0
end

end
end

function enemycrouch()
if enemylastdirection == 0 then
enemycrouchloop = enemycrouchloop + 1
if enemycrouchloop >= 1 and enemycrouchloop <= 2 then
enemy = enemycrouchleft[2]
elseif enemycrouchloop > 3 then
enemy = enemycrouchleft[3]
end
else
enemycrouchloop = enemycrouchloop + 1
if enemycrouchloop >= 1 and enemycrouchloop <= 2 then
enemy = enemycrouchright[2]
elseif enemycrouchloop > 3 then
enemy = enemycrouchright[3]
end
end
enemycrouchstate = 0
end

function enemyblock()
if enemylastdirection == 0 then
enemyblockloop = enemyblockloop + 1

if enemyblockloop >= 1 and enemyblockloop <= 4 then
enemy = enemyblockleft[1]
elseif enemyblockloop >= 5 and enemyblockloop <= 25 then
enemy = enemyblockleft[1]
elseif enemyblockloop > 25 then
enemyblockloop = 0
enemyblockstate = 0
enemystate = 1
end
else
enemyblockloop = enemyblockloop + 1
if enemyblockloop >= 1 and enemyblockloop <= 4 then
enemy = enemyblockright[1]
elseif enemyblockloop >= 5 and enemyblockloop <= 25 then
enemy = enemyblockright[1]
elseif enemyblockloop > 25 then
enemyblockloop = 0
enemyblockstate = 0
enemystate = 1
end
end

end



function enemyspecialTech()

if enemyspecialstate == 1 then
if enemylastdirection == 0 then
enemyspecialloop = enemyspecialloop + 1

if enemyspecialloop >= 1 and enemyspecialloop <= 10 then enemy = enemyspecialleft[1]
elseif enemyspecialloop >= 6 and enemyspecialloop <= 20 then enemy = enemyspecialleft[2]
elseif enemyspecialloop >= 11 and enemyspecialloop <= 30 then enemy = enemyspecialleft[3]
elseif enemyspecialloop >= 16 and enemyspecialloop <= 40 then enemy = enemyspecialleft[4]
elseif enemyspecialloop >= 21 and enemyspecialloop <= 50 then enemy = enemyspecialleft[5]
elseif enemyspecialloop >= 26 and enemyspecialloop <= 60 then enemy = enemyspecialleft[6]
elseif enemyspecialloop >= 31 and enemyspecialloop <= 70 then enemy = enemyspecialleft[7]
elseif enemyspecialloop >= 35 and enemyspecialloop <= 80 then enemy = enemyspecialleft[8]
elseif enemyspecialloop >= 41 and enemyspecialloop <= 90 then enemy = enemyspecialleft[9]
elseif enemyspecialloop >= 46 and enemyspecialloop <= 100 then enemy = enemyspecialleft[10]

elseif enemyspecialloop >= 51 and enemyspecialloop <= 110 then enemy = enemyspecialleft[11]
elseif enemyspecialloop >= 56 and enemyspecialloop <= 120 then enemy = enemyspecialleft[12]
elseif enemyspecialloop >= 62 and enemyspecialloop <= 130 then enemy = enemyspecialleft[13]
elseif enemyspecialloop >= 66 and enemyspecialloop <= 140 then enemy = enemyspecialleft[14]
elseif enemyspecialloop >= 71 and enemyspecialloop <= 150 then enemy = enemyspecialleft[15]
elseif enemyspecialloop >= 76 and enemyspecialloop <= 160 then enemy = enemyspecialleft[16]
elseif enemyspecialloop >= 81 and enemyspecialloop <= 170 then enemy = enemyspecialleft[17]
elseif enemyspecialloop >= 86 and enemyspecialloop <= 180 then enemy = enemyspecialleft[18]
elseif enemyspecialloop >= 91 and enemyspecialloop <= 190 then enemy = enemyspecialleft[19]
elseif enemyspecialloop >= 96 and enemyspecialloop <= 200 then enemy = enemyspecialleft[20]

elseif enemyspecialloop >= 101 and enemyspecialloop <= 210 then enemy = enemyspecialleft[21]
elseif enemyspecialloop >= 106 and enemyspecialloop <= 220 then enemy = enemyspecialleft[22]
elseif enemyspecialloop >= 111 and enemyspecialloop <= 230 then enemy = enemyspecialleft[23]
elseif enemyspecialloop >= 116 and enemyspecialloop <= 240 then enemy = enemyspecialleft[24]
elseif enemyspecialloop >= 121 and enemyspecialloop <= 250 then enemy = enemyspecialleft[25]
elseif enemyspecialloop >= 126 and enemyspecialloop <= 260 then enemy = enemyspecialleft[26]
elseif enemyspecialloop >= 131 and enemyspecialloop <= 270 then enemy = enemyspecialleft[27]
elseif enemyspecialloop >= 136 and enemyspecialloop <= 280 then enemy = enemyspecialleft[28]
elseif enemyspecialloop >= 141 and enemyspecialloop <= 290 then enemy = enemyspecialleft[29]
elseif enemyspecialloop >= 146 and enemyspecialloop <= 300 then enemy = enemyspecialleft[30]

elseif enemyspecialloop >= 151 and enemyspecialloop <= 310 then enemy = enemyspecialleft[31]
elseif enemyspecialloop >= 156 and enemyspecialloop <= 320 then enemy = enemyspecialleft[32]
elseif enemyspecialloop >= 161 and enemyspecialloop <= 330 then enemy = enemyspecialleft[33]
elseif enemyspecialloop >= 166 and enemyspecialloop <= 340 then enemy = enemyspecialleft[34]
elseif enemyspecialloop >= 171 and enemyspecialloop <= 350 then enemy = enemyspecialleft[35]
elseif enemyspecialloop >= 176 and enemyspecialloop <= 360 then enemy = enemyspecialleft[36]
elseif enemyspecialloop >= 181 and enemyspecialloop <= 370 then enemy = enemyspecialleft[37]
elseif enemyspecialloop >= 186 and enemyspecialloop <= 380 then enemy = enemyspecialleft[38]
elseif enemyspecialloop >= 191 and enemyspecialloop <= 390 then enemy = enemyspecialleft[39]
elseif enemyspecialloop >= 196 and enemyspecialloop <= 400 then enemy = enemyspecialleft[40]

elseif enemyspecialloop >= 201 and enemyspecialloop <= 410 then enemy = enemyspecialleft[41]
elseif enemyspecialloop >= 206 and enemyspecialloop <= 420 then enemy = enemyspecialleft[42]
elseif enemyspecialloop > 420 then enemyspecialloop = 0 enemyspecialstate = 0 enemystate = 1 end


if enemyspecialloop >= 271 and enemyspecialloop <= 300 then
yourTemp = enemyspecialright[43]
screen:blit(player.x + 30, player.y - 40, yourTemp)
elseif enemyspecialloop >= 301 and enemyspecialloop <= 310 then
yourTemp = enemyspecialright[44]
screen:blit(player.x + 20, player.y - 30, yourTemp)
elseif enemyspecialloop >= 311 and enemyspecialloop <= 320 then
yourTemp = enemyspecialright[45]
screen:blit(player.x + 10, player.y - 20, yourTemp)
elseif enemyspecialloop >= 321 and enemyspecialloop <= 330 then
yourTemp = enemyspecialright[46]
screen:blit(player.x, player.y - 10, yourTemp) end


if enemyspecialloop >= 301 and enemyspecialloop <= 330 then
yourTemp = enemyspecialleft[43]
screen:blit(player.x - 40, player.y - 40, yourTemp)
elseif enemyspecialloop >= 331 and enemyspecialloop <= 340 then
yourTemp = enemyspecialleft[44]
screen:blit(player.x - 30, player.y - 30, yourTemp)
elseif enemyspecialloop >= 341 and enemyspecialloop <= 350 then
yourTemp = enemyspecialleft[45]
screen:blit(player.x - 20, player.y - 20, yourTemp)
elseif enemyspecialloop >= 351 and enemyspecialloop <= 360 then
yourTemp = enemyspecialleft[46]
screen:blit(player.x, player.y - 10, yourTemp) end

else

enemyspecialloop = enemyspecialloop + 1

if enemyspecialloop >= 1 and enemyspecialloop <= 10 then enemy = enemyspecialright[1]
elseif enemyspecialloop >= 11 and enemyspecialloop <= 20 then enemy = enemyspecialright[2]
elseif enemyspecialloop >= 21 and enemyspecialloop <= 30 then enemy = enemyspecialright[3]
elseif enemyspecialloop >= 31 and enemyspecialloop <= 40 then enemy = enemyspecialright[4]
elseif enemyspecialloop >= 41 and enemyspecialloop <= 50 then enemy = enemyspecialright[5]
elseif enemyspecialloop >= 51 and enemyspecialloop <= 60 then enemy = enemyspecialright[6]
elseif enemyspecialloop >= 61 and enemyspecialloop <= 70 then enemy = enemyspecialright[7]
elseif enemyspecialloop >= 71 and enemyspecialloop <= 80 then enemy = enemyspecialright[8]
elseif enemyspecialloop >= 81 and enemyspecialloop <= 90 then enemy = enemyspecialright[9]
elseif enemyspecialloop >= 91 and enemyspecialloop <= 100 then enemy = enemyspecialright[10]

elseif enemyspecialloop >= 101 and enemyspecialloop <= 110 then enemy = enemyspecialright[11]
elseif enemyspecialloop >= 111 and enemyspecialloop <= 120 then enemy = enemyspecialright[12]
elseif enemyspecialloop >= 121 and enemyspecialloop <= 130 then enemy = enemyspecialright[13]
elseif enemyspecialloop >= 131 and enemyspecialloop <= 140 then enemy = enemyspecialright[14]
elseif enemyspecialloop >= 141 and enemyspecialloop <= 150 then enemy = enemyspecialright[15]
elseif enemyspecialloop >= 151 and enemyspecialloop <= 160 then enemy = enemyspecialright[16]
elseif enemyspecialloop >= 161 and enemyspecialloop <= 170 then enemy = enemyspecialright[17]
elseif enemyspecialloop >= 171 and enemyspecialloop <= 180 then enemy = enemyspecialright[18]
elseif enemyspecialloop >= 181 and enemyspecialloop <= 190 then enemy = enemyspecialright[19]
elseif enemyspecialloop >= 191 and enemyspecialloop <= 200 then enemy = enemyspecialright[20]

elseif enemyspecialloop >= 201 and enemyspecialloop <= 210 then enemy = enemyspecialright[21]
elseif enemyspecialloop >= 211 and enemyspecialloop <= 220 then enemy = enemyspecialright[22]
elseif enemyspecialloop >= 221 and enemyspecialloop <= 230 then enemy = enemyspecialright[23]
elseif enemyspecialloop >= 231 and enemyspecialloop <= 240 then enemy = enemyspecialright[24]
elseif enemyspecialloop >= 241 and enemyspecialloop <= 250 then enemy = enemyspecialright[25]
elseif enemyspecialloop >= 251 and enemyspecialloop <= 260 then enemy = enemyspecialright[26]
elseif enemyspecialloop >= 261 and enemyspecialloop <= 270 then enemy = enemyspecialright[27]
elseif enemyspecialloop >= 271 and enemyspecialloop <= 280 then enemy = enemyspecialright[28]
elseif enemyspecialloop >= 281 and enemyspecialloop <= 290 then enemy = enemyspecialright[29]
elseif enemyspecialloop >= 291 and enemyspecialloop <= 300 then enemy = enemyspecialright[30]

elseif enemyspecialloop >= 301 and enemyspecialloop <= 310 then enemy = enemyspecialright[31]
elseif enemyspecialloop >= 311 and enemyspecialloop <= 320 then enemy = enemyspecialright[32]
elseif enemyspecialloop >= 321 and enemyspecialloop <= 330 then enemy = enemyspecialright[33]
elseif enemyspecialloop >= 331 and enemyspecialloop <= 340 then enemy = enemyspecialright[34]
elseif enemyspecialloop >= 341 and enemyspecialloop <= 350 then enemy = enemyspecialright[35]
elseif enemyspecialloop >= 351 and enemyspecialloop <= 360 then enemy = enemyspecialright[36]
elseif enemyspecialloop >= 361 and enemyspecialloop <= 370 then enemy = enemyspecialright[37]
elseif enemyspecialloop >= 371 and enemyspecialloop <= 380 then enemy = enemyspecialright[38]
elseif enemyspecialloop >= 381 and enemyspecialloop <= 390 then enemy = enemyspecialright[39]
elseif enemyspecialloop >= 391 and enemyspecialloop <= 400 then enemy = enemyspecialright[40]

elseif enemyspecialloop >= 401 and enemyspecialloop <= 410 then enemy = enemyspecialright[41]
elseif enemyspecialloop >= 411 and enemyspecialloop <= 420 then enemy = enemyspecialright[42]
elseif enemyspecialloop > 420 then enemyspecialloop = 0 enemyspecialstate = 0 enemystate = 1 end


if enemyspecialloop >= 271 and enemyspecialloop <= 300 then
yourTemp = enemyspecialright[43]
screen:blit(player.x + 30, player.y - 40, yourTemp)
elseif enemyspecialloop >= 301 and enemyspecialloop <= 310 then
yourTemp = enemyspecialright[44]
screen:blit(player.x + 20, player.y - 30, yourTemp)
elseif enemyspecialloop >= 311 and enemyspecialloop <= 320 then
yourTemp = enemyspecialright[45]
screen:blit(player.x + 10, player.y - 20, yourTemp)
elseif enemyspecialloop >= 321 and enemyspecialloop <= 330 then
yourTemp = enemyspecialright[46] enemyhitstate = 1
screen:blit(player.x, player.y - 10, yourTemp) end


if enemyspecialloop >= 301 and enemyspecialloop <= 330 then
yourTemp = enemyspecialleft[43]
screen:blit(player.x - 40, player.y - 40, yourTemp)
elseif enemyspecialloop >= 331 and enemyspecialloop <= 340 then
yourTemp = enemyspecialleft[44]
screen:blit(player.x - 30, player.y - 30, yourTemp)
elseif enemyspecialloop >= 341 and enemyspecialloop <= 350 then
yourTemp = enemyspecialleft[45]
screen:blit(player.x - 20, player.y - 20, yourTemp)
elseif enemyspecialloop >= 351 and enemyspecialloop <= 360 then
yourTemp = enemyspecialleft[46] enemyhitstate = 1
screen:blit(player.x, player.y - 10, yourTemp) end
end
if enemyspecialloop == 420 and blockstate == 0 then hitstate = 1 playerH.x = playerH.x - 50 end
if enemyspecialloop == 420 then allowable = "nope" enemyspecialstate = 0
if enemyspecialloop == 420 and enemyhealth.x < 21 then enemytemp = 1 end enemyspecialloop = 0 end

if enemyspecialloop == 339 then enemyhealth.x = enemyhealth.x - 20 end
end
end



function enemykilled()

if enemykilledstate == 1 then

if lastdirection == 0 then

enemykilledloop = enemykilledloop + 1

if enemykilledloop >= 1 and enemykilledloop <= 15 then

enemy = enemykilledleft[1]
enemyplay.y = enemyplay.y - 6
enemyplay.x = enemyplay.x + 15

elseif enemykilledloop >= 16 and enemykilledloop <= 30 then

enemy = enemykilledleft[1]
enemyplay.y = enemyplay.y + 6
enemyplay.x = enemyplay.x + 15

elseif enemykilledloop >= 31 then

enemy = enemykilledleft[2]

end


else


enemykilledloop = enemykilledloop + 1
if enemykilledloop >= 1 and enemykilledloop <= 15 then

enemy = enemykilledright[1]
enemyplay.y = enemyplay.y - 6
enemyplay.x = enemyplay.x - 15

elseif enemykilledloop >= 16 and enemykilledloop <= 30 then

enemy = enemykilledright[1]
enemyplay.y = enemyplay.y + 6
enemyplay.x = enemyplay.x - 15

elseif enemykilledloop >= 31 then

enemy = enemykilledright[2]

end

end

end
end


function enemydamaged()


if enemycollision == 1 and enemyhitstate == 0 then
if punchloop == 10 or kickloop == 10 then

enemyhitstate = 1
enemystate = 0
end
end


if enemyhitstate == 1 and enemyblockloop == 0 and enemykickstate == 0 then

if lastdirection == 0 then

enemyhitloop = enemyhitloop + 1

if enemyhitloop >= 1 and enemyhitloop <= 7 then
enemy = enemyhitright[1]
enemyplay.x = enemyplay.x + 1
hit = "true"

elseif enemyhitloop >= 8 and enemyhitloop <= 14 then
enemy = enemyhitright[1]
enemyplay.x = enemyplay.x + 1

elseif enemyhitloop > 18 then
enemyhitloop = 0
enemystate = 1
enemyhitstate = 0
enemylastdirection = 1
buloy = 0
end

else

enemyhitloop = enemyhitloop + 1


if enemyhitloop >= 1 and enemyhitloop <= 7 then
enemy = enemyhitleft[1]
enemyplay.x = enemyplay.x - 1
hit = "true"

elseif enemyhitloop >= 8 and enemyhitloop <= 14 then
enemy = enemyhitleft[1]
enemyplay.x = enemyplay.x - 1

elseif enemyhitloop > 18 then
enemyhitloop = 0
enemystate = 1
enemyhitstate = 0
enemylastdirection = 0
buloy = 0
end
end
end


----- mabawasan ka .....

-- PS : Kalokohan lang ito ha!

if enemyhitstate == 1 and buloy == 0 then

enemyhealth.x = enemyhealth.x - 5
highscore = highscore + 5
--hit = "false"
buloy = 1
end

if enemyhealth.x <= 0 then

enemykilledstate = 1
enemykilled()
end

end

end

enemyiso = "true"
end




function narutoWash()

icon = nil


standleft = {}
for inc = 1, 4 do
standleft[inc] = nil
end
walkleft = {}
for inc = 1, 6 do
walkleft[inc] = nil
end

jumpleft = {}
for inc = 1, 4 do
jumpleft[inc] = nil
end

blockleft = {}

blockleft[1] = nil


retreatleft = {}

retreatleft[1] = nil
retreatleft[2] = nil


crouchleft = {}
for inc = 2, 3 do
crouchleft[inc] = nil
end

punchleft = {}
for inc = 1, 4 do
punchleft[inc] = nil
end

kickleft = {}
for inc = 1, 5 do
kickleft[inc] = nil
end

killedleft = {}
for inc = 1, 2 do
killedleft[inc] = nil
end

specialleft = {}
for inc = 1, 46 do
specialleft[inc] = nil
end

damagedleft = nil







standright = {}
for inc = 1,4 do
standright[inc] = nil
end
walkright = {}
for inc = 1, 6 do
walkright[inc] = nil
end

jumpright = {}
for inc = 1, 4 do
jumpright[inc] = nil
end

blockright = {}

blockright[1] = nil


retreatright = {}

retreatright[1] = nil
retreatright[2] = nil


crouchright = {}
for inc = 2, 3 do
crouchright[inc] = nil
end

punchright = {}
for inc = 1, 4 do
punchright[inc] = nil
end

kickright = {}
for inc = 1, 5 do
kickright[inc] = nil
end

killedright = {}
for inc = 1, 2 do
killedright[inc] = nil
end

specialright = {}
for inc = 1, 46 do
specialright[inc] = nil
end

damagedright = nil









eicon = nil

enemystandleft = {}
for inc = 1, 4 do
enemystandleft[inc] = nil
end

enemykickleft = {}
for inc = 1, 5 do
enemykickleft[inc] = nil
end


enemyjumpleft = {}
for inc = 1, 4 do
enemyjumpleft[inc] = nil
end

enemywalkleft = {}
for inc = 1, 6 do
enemywalkleft[inc] = nil
end


enemypunchleft = {}
for inc = 1, 4 do
enemypunchleft[inc] = nil
end


enemyretreatleft = {}

enemyretreatleft[1] = nil
enemyretreatleft[2] = nil



enemycrouchleft = {}

for inc = 2, 3 do
enemycrouchleft[inc] = nil
end



enemyblockleft = {}

enemyblockleft[1] = nil

enemykilledleft = {}
for inc = 1, 2 do
enemykilledleft[inc] = nil
end


enemyhitleft = {}
enemyhitleft[1] = nil


-- right


enemystandright = {}
for inc = 1, 4 do
enemystandright[inc] = nil
end

enemykickright = {}
for inc = 1, 5 do
enemykickright[inc] = nil
end


enemyjumpright = {}
for inc = 1, 4 do
enemyjumpright[inc] = nil
end

enemywalkright = {}
for inc = 1, 6 do
enemywalkright[inc] = nil
end


enemypunchright = {}
for inc = 1, 4 do
enemypunchright[inc] = nil
end


enemyretreatright = {}

enemyretreatright[1] = nil
enemyretreatright[2] = nil



enemycrouchright = {}

for inc = 2, 3 do
enemycrouchright[inc] = nil
end



enemyblockright = {}

enemyblockright[1] = nil


enemykilledright = {}
for inc = 1, 2 do
enemykilledright[inc] = nil
end


enemyhitright = {}
enemyhitright[1] = nil



collectgarbage()




end
 
P_MSG P_EMAIL P_MSN P_YIM Top
view post Posted on 23/12/2008, 16:57Quote
Avatar

Jonin

Group: Global Mod
Posts: 2132


Status: Offline: ultima azione eseguita il 25/12/2009, 21:14


Lo scarico

image




image



Perchè Sakura è bona
image


Regaluzzi *.*


1.-2.-3.-4.-5.-6.-7.-8.-9.

 
P_MSG P_EMAIL P_WEBSITE Top
view post Posted on 4/11/2009, 11:50Quote
Avatar

Chunin

Group: Member
Posts: 510


Status: Offline: ultima azione eseguita il 5/12/2009, 17:03


 
P_MSG P_EMAIL P_MSN Top
2 replies since 23/12/2008, 14:00
 
Reply

load
Fast reply

 
 
 

Enable emoticons
Clickable Smilies
Show All


Nickname:      Email:



 

 
 




Affiliati
Photobucket Mono Chrome Factor eva-bleach forum Image Hosted by ImageShack.us Image Hosted by ImageShack.us Image and video hosting by TinyPic Image Hosted by ImageShack.us Vongola Family Image Hosted by ImageShack.us Image and video hosting by TinyPic Image and video hosting by TinyPic † Uchiha Itachi Official Forum † Image and video hosting by TinyPic Anime e Manga Power Blog