Hi guys!
I've been having troubles with this static context thing, I declared a two dimensional matrix in my world code :
And in an actor's code I want to change some values (the matrix is a representation of the board, and the actor ,who's a piece, has to change the values as he moved) :
But it says I cannot change from a static context. How do I do this? Adding static before declaring the matrix sure works but when I reset the values won't change back. Wich is annoying because then it doesn't represent the board at all... How do I do this?
Thanks guys
int plateau [][] = { { 8, 9, 10, 12, 11, 10, 9, 8 }, { 7, 7, 7, 7, 7, 7, 7, 7 }, { 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0 }, { 1, 1, 1, 1, 1, 1, 1, 1 }, { 2, 3, 4, 6, 5, 4, 3, 2 } } ;
Plateau.plateau[plateaux.convertir(vieuxY)][plateaux.convertir(vieuxX)]=0; Plateau.plateau[plateaux.convertir(getY())][plateaux.convertir(getX())]=3;