Advertisement
otorp2

dictionary hairstyles

Jul 9th, 2016
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. var hairstyle_key = { #the first field, the bool, indicates if color is used
  2. 0 : [true, "short"],
  3. 1 : [true, "long"],
  4. 2 : [true, "fro"],
  5. 3 : [false, "none"],
  6. 4 : [true, "ponytail"],
  7. }
  8.  
  9. ...
  10.  
  11. func set_hair(new_hair):
  12. hair = new_hair
  13. if (hairstyle_key[hair.y])[0] == true:
  14. hairsprite.set_texture(load("res://img/player/hair/hair_" + hairstyle_key[hair.y][1] + "_" + hair_color_key[hair.x]))
  15. else:
  16. hairsprite.set_texture(load("res://img/player/hair/hair_" + hairstyle_key[hair.y][1]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement