CONNEXION
  • RetourJeux
    • Sorties
    • Hit Parade
    • Les + populaires
    • Les + attendus
    • Soluces
    • Tous les Jeux
    • Gaming
  • RetourActu Gaming
    • News
    • Astuces
    • Tests
    • Previews
    • Toute l'actu gaming
  • RetourBons plans
    • Bons plans
    • Bons plans Smartphone
    • Bons plans Hardware
    • Bons plans Image et Son
    • Bons plans Amazon
    • Bons plans Cdiscount
    • Bons plans Decathlon
    • Bons plans Fnac
    • Tous les Bons plans
  • RetourJVTech
    • Actus High-Tech
    • Intelligence Artificielle
    • Smartphones
    • Mobilité urbaine
    • Hardware
    • Image et son
    • Tutoriels
    • Tests produits High-Tech
    • Guides d'achat High-Tech
    • JVTech
  • RetourCulture
    • Actus Culture
    • Culture
  • RetourVidéos
    • A la une
    • Gaming Live
    • Vidéos Tests
    • Vidéos Previews
    • Gameplay
    • Trailers
    • Chroniques
    • Replay Web TV
    • Toutes les vidéos
  • RetourForums
    • Hardware PC
    • PS5
    • Switch 2
    • Xbox Series
    • Switch
    • Pokemon pocket
    • FC 25 Ultimate Team
    • League of Legends
    • Tous les Forums
  • PC
  • PS5
  • Xbox Series
  • Switch 2
  • PS4
  • One
  • Switch
  • iOS
  • Android
  • MMO
  • RPG
  • FPS
En ce moment Genshin Impact Valhalla Breath of the wild Animal Crossing GTA 5 Red dead 2
Liste des sujets

Probleme ligne de code lua : Love2D

SweetTv
SweetTv
Niveau 4
19 janvier 2016 à 18:16:09

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

fatimamafemme
fatimamafemme
Niveau 5
20 janvier 2016 à 01:13:46

pourquoi "if c -- "%" then
ignore = 1"

et pas "if c == "%" then
ignore = 1

SweetTv
SweetTv
Niveau 4
21 janvier 2016 à 19:43:51

hum une erreur je vais corriger cela , merci de votre réponse :)

SweetTv
SweetTv
Niveau 4
22 janvier 2016 à 19:16:10

Encore moi donc j'ai corrigé toutes mes fautes mais il me reste un problème ...le END de fin je comprend pas pourquoi ils me le refusent

Sous forums
  • Aide à l'achat Mac
  • Création de Jeux
  • Linux
  • Programmation
  • Création de sites web
  • Internet
  • Steam Deck
  • Macintosh
  • Hardware
La vidéo du moment