/// <summary> /// Détermine le type d'animal à créer /// </summary> /// <param name="type"></param> /// <returns></returns> protected Bitmap[] DeterminerAnimal(TypeAnimal type) { Bitmap[] tab = new Bitmap[4]; switch (type) { case TypeAnimal.Licorne: //LICORNE tab[0] = TilesetImageGenerator.GetTile(TilesetImageGenerator.LICORNE_BAS); tab[1] = TilesetImageGenerator.GetTile(TilesetImageGenerator.LICORNE_HAUT); tab[2] = TilesetImageGenerator.GetTile(TilesetImageGenerator.LICORNE_GAUCHE); tab[3] = TilesetImageGenerator.GetTile(TilesetImageGenerator.LICORNE_DROITE); break; case TypeAnimal.Lion: //LION tab[0] = TilesetImageGenerator.GetTile(TilesetImageGenerator.LION_BAS); tab[1] = TilesetImageGenerator.GetTile(TilesetImageGenerator.LION_GAUCHE); tab[2] = TilesetImageGenerator.GetTile(TilesetImageGenerator.LION_HAUT); tab[3] = TilesetImageGenerator.GetTile(TilesetImageGenerator.LION_DROITE); break; case TypeAnimal.Rhino: //RHINO tab[0] = TilesetImageGenerator.GetTile(TilesetImageGenerator.RHINO_BAS); tab[1] = TilesetImageGenerator.GetTile(TilesetImageGenerator.RHINO_GAUCHE); tab[2] = TilesetImageGenerator.GetTile(TilesetImageGenerator.RHINO_HAUT); tab[3] = TilesetImageGenerator.GetTile(TilesetImageGenerator.RHINO_DROITE); break; } return(tab); }
protected bool VerifDeplacementObstacleBas(Bitmap[,] tab) { if (tab[x, y + 1] == TilesetImageGenerator.GetTile(TilesetImageGenerator.SABLE) || tab[x, y + 1] == TilesetImageGenerator.GetTile(TilesetImageGenerator.GAZON) || tab[x, y + 1] == TilesetImageGenerator.GetTile(TilesetImageGenerator.ASPHALTE)) { return(true); } else { return(false); } }
private void DrawBaseMap(int screenWidth, int screenHeight, Bitmap tuileExemple) { Bitmap tuile = TilesetImageGenerator.GetTile(0); int tuileWidth = tuile.Width; int tuileHeight = tuile.Height; for (int i = 0; i < screenHeight; i += tuileHeight) { { listeTuiles.Add(new List <Tuile>()); for (int o = 0; o < screenWidth; o += tuileWidth) { listeTuiles[i / tuileHeight].Add(new Tuile(0)); } } } }
/// <summary> /// Initialisation de mes boutons (choix) et du tableau de Bitmap qui contient les images du Mario Maker (ciel, plancher, etc.) /// </summary> private void Initialisation() { BtnNuage.BackgroundImage = TilesetImageGenerator.GetTile(4); BtnBrique.BackgroundImage = TilesetImageGenerator.GetTile(1); BtnPlancher.BackgroundImage = TilesetImageGenerator.GetTile(0); BtnCoin.BackgroundImage = TilesetImageGenerator.GetTile(3); for (int i = 0; i < tab.GetLength(0); i++) { for (int j = 0; j < tab.GetLength(1); j++) { if (j >= 14) { tab[i, j] = TilesetImageGenerator.GetTile(0); } else { tab[i, j] = TilesetImageGenerator.GetTile(2); } } } }
/// <summary> /// Évenement mouseClick, il y aura un changement sur le Form selon le choix de l'utilisateur /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_MouseClick(object sender, MouseEventArgs e) { switch (choix) { case Choix.Brique: if (tab[e.X / 32, e.Y / 32] != TilesetImageGenerator.GetTile(1)) { tab[e.X / 32, e.Y / 32] = TilesetImageGenerator.GetTile(1); Refresh(); } break; case Choix.Plancher: if (tab[e.X / 32, e.Y / 32] != TilesetImageGenerator.GetTile(0)) { tab[e.X / 32, e.Y / 32] = TilesetImageGenerator.GetTile(0); Refresh(); } break; case Choix.Nuage: if (tab[e.X / 32, e.Y / 32] != TilesetImageGenerator.GetTile(4)) { tab[e.X / 32, e.Y / 32] = TilesetImageGenerator.GetTile(4); Refresh(); } break; case Choix.Coin: if (tab[e.X / 32, e.Y / 32] != TilesetImageGenerator.GetTile(3)) { tab[e.X / 32, e.Y / 32] = TilesetImageGenerator.GetTile(3); Refresh(); } break; } }