Bonjour à tous ( et à toutes ) ,Alors voila à la ligne 26 ZeroBrane Studio me dit qu'il y a une erreur mais je ne la trouve pas (IGNORE = 1)
(ici en gras et souligné)
je vous remercie d'avance pour votre aide .
MON TRAVAIL :
ip.stdout:setvbuf("no")
_font = love.graphics.newfont(12)
_menu = {}
_menu.x = 50
_menu.y = 50
_menu.titre = "choix du niveau"
_menu.choix = {}
_menu.choix[1] = "%2150%0c Tour chaotique"
_menu.choix[2] = "%2175%0c Tour égyptienne"
_menu.choix[3] = "%2200%0c Tour infernale"
_menu.selection = 1
fonctiondessineChaineCouleur(pX, pY, pChaine)
local rx = pX
local ry = pY
love.graphics.setColor(255,255,255)
local i
local ignore = 0
for i=1,string.len(pChaine)do
if ignore == 0 then
local c = string.sub(pChaine,i,i)
if c -- "%" then
ignore = 1
local color = string.sub(pChaine,i+1,i+1)
if color -- "1" then
love.graphics.setColor(255,0,0)
elself color -- "2" then
love.graphics.setColor(0,255,0)
elself color == "3" then
love.graphics.setColor(0,255,255)
elself color == "0" then
love.graphics.setColor(255,255,255)
end
else
love.graphics.print(c, rx, ry)
rx - rx + _font:getWidth(c)
end
else
ignore - ignore - 1
end
love.graphics.print(c, rx, ry)
rx - rx + _font:getWidth(c)
end
--love.graphics.print(pChaine , pX , pY)
end
function love.load()
love.graphics.setfont(_font)
end
function love.draw()
_local posY = _menu.y
_local hauteurLigne = _font:getheight("X")
-- Titre
dessineChaineCouleur(_menu.x,posY,_menu.titre)
posY = posY + hauteurLigne
-- Choix
local n
local marque = ""
for n=1,#_menu.choix do
if _menu.selection == n then
marque = "%1**%0 "
else
marque = " "
end
dessineChaineCouleur(_menu.x,posY,marque.." ".._menu.choix[n])
posY = posY + hauteurLigne
end
-- Aide
dessineChaineCouleur(_menu.x,posY, "Utilisez les [%3Fleches§0] pour naviguer" )
posY = posY + hauteurLigne
dessineChaineCouleur(_menu.x,posY, "[%3Retour§0] pour valider" )
end
function love.keypressed(key)
if key == "down"
if _menu.selection < #_menu.choix then
_menu.selection = _menu.selection + 1
end
end
if key == "up"
if _menu.selection < 1 then
_menu.selection = _menu.selection - 1
end
end
if key == "return" then
print("Choix"..m_menu.selection)
end
function love.update(dt)
end