Advertisement
Guest User

Resources.cs

a guest
Sep 5th, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.22 KB | None | 0 0
  1. using Microsoft.Xna.Framework.Audio;
  2. using Microsoft.Xna.Framework.Content;
  3. using Microsoft.Xna.Framework.Graphics;
  4. using System.Collections.Generic;
  5.  
  6. namespace Gamecodeur_JAM_1
  7. {
  8.     public class Resources
  9.     {
  10.         public static Dictionary<string, Texture2D> Images;
  11.         public static Dictionary<string, SoundEffect> Sounds;
  12.  
  13.         public static void LoadImage(ContentManager content)
  14.         {
  15.             Images = new Dictionary<string, Texture2D>();
  16.  
  17.             List<string> image = new List<string>()
  18.             {
  19.                 "player/playerWalk",
  20.                 "player/playerAttack",
  21.                 "player/playerQueen"
  22.             };
  23.  
  24.             foreach (string img in image)
  25.             {
  26.                 Images.Add(img, content.Load<Texture2D>("res/graphics/" + img));
  27.             }
  28.  
  29.         }
  30.         public static void LoadSound(ContentManager content)
  31.         {
  32.             Sounds = new Dictionary<string, SoundEffect>();
  33.  
  34.             List<string> sound = new List<string>()
  35.             {
  36.  
  37.             };
  38.  
  39.             foreach (string sfx in sound)
  40.             {
  41.                 Sounds.Add(sfx, content.Load<SoundEffect>("res/sounds/" + sfx));
  42.             }
  43.  
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement