public override void Load(ContentManager Content) { CharacterTexture.Add(Content.Load <Texture2D>("john_idle")); CharacterTexture.Add(Content.Load <Texture2D>("john_run")); CharacterTexture.Add(Content.Load <Texture2D>("john_idle(left)")); CharacterTexture.Add(Content.Load <Texture2D>("john_run(left)")); healthTexture = Content.Load <Texture2D>("greenbar (1)"); healthRectangle = new Rectangle(0, 0, healthTexture.Width, healthTexture.Height); }
private static void LoadHeadTextures() { headTextures = new Dictionary <CharacterTexture, List <Texture2D> >(); for (int i = 0; i < 2; i++) { CharacterTexture character = (CharacterTexture)i; List <Texture2D> temp = new List <Texture2D>(); temp.Add(Global.gContent.Load <Texture2D>(@"Textures\Characters\Head\Head_" + character.ToString())); headTextures.Add(character, temp); } }
protected void LoadSprites(CharacterTexture type) { Dictionary <CharacterState, List <Texture2D> > tmp = TextureFactory.characterTextures[type]; foreach (CharacterState state in tmp.Keys) { this.characterSprites.Add(state, new Sprite2D(tmp[state], 0, 0, 0, 0)); if (state != CharacterState.Idle && state != CharacterState.Run) { this.characterSprites[state].Repeat = false; } } }