I think i'll look now for a mean to put datas directly on the page, maybe by using the elements' array. I will see.
My idea (work, until the browser complain) was that :
When the JS create the image, add a :
Then in the turn loop, i add a waiting loop :
then the little function here do the job :
When JS put the "next turn" image on the screen, it add it an onclick calling a new "tour" function.
Then it add, on the same image, an attribute called "name" with the value "1".
When the player click on the image, the function "tour" is called, and change the image attribute "name" from 1 to 2.
BUT, in the waiting loop, a "getAttribute" read periodically for the value of "name", and put it in the "i" variable.
And what happen when i == 2 ? The while of the waiting loop is FALSE, then loop exit for the next turn of the game.
That was so cool. I'm pretty sad actually, because i that was a big work for me, and damnit that worked !
That mean creating an entire game with ONE JS is probably impossible, because browsers don't accept "long" pauses.
As i said, i will look now in storing datas directly in the page, probably in images attributes, or maybe in an hidden layer, i don't know for now.
See ya later, i need to drown myself (in movies), now.