Jeu 2D avec LWJGL - #20 - On implémente les tiles set HD
Un problème ? Passe sur le forum ;) http://veridiangames.fr/fr/forum/ Dans cette épisode: - la fonction setTile() Code source: https://github.com/Marccspro/Jeu2Dlwjgl Twitter : http://bit.ly/marccspro_twitter Live : http://bit.ly/marccspro_twitch Code de la fonction setTile : public void setTiles(boolean vr, boolean vl, boolean vd, boolean vu, boolean vur, boolean vul, boolean vdr, boolean vdl) { if (!hasTileSet) return; if (vl) { tileSprite[0] = 0; tileSprite[1] = 1; tileSprite[6] = 0; tileSprite[7] = 1; } if (vr) { tileSprite[2] = 2; tileSprite[3] = 1; tileSprite[4] = 2; tileSprite[5] = 1; } if (vu) { tileSprite[0] = 1; tileSprite[1] = 0; tileSprite[2] = 1; tileSprite[3] = 0; if (vr) { tileSprite[2] = 2; tileSprite[3] = 0; } if (vl) { tileSprite[0] = 0; tileSprite[1] = 0; } } if (vd) { tileSprite[4] = 1; tileSprite[5] = 2; tileSprite[6] = 1; tileSprite[7] = 2; if (vr) { tileSprite[4] = 2; tileSprite[5] = 2; } if (vl) { tileSprite[6] = 0; tileSprite[7] = 2; } } if (vd && vr) { tileSprite[4] = 2; tileSprite[5] = 2; } if (vd && vl) { tileSprite[6] = 0; tileSprite[7] = 2; } if (vur && !vu && !vr) { tileSprite[2] = 3; tileSprite[3] = 1; } if (vdr && !vd && !vr) { tileSprite[4] = 3; tileSprite[5] = 0; } if (vul && !vu && !vl) { tileSprite[0] = 4; tileSprite[1] = 1; } if (vdl && !vd && !vl) { tileSprite[6] = 4; tileSprite[7] = 0; } }