fork download
  1. function love.load()
  2.  
  3. -- sets up outline and shoes, which currently have no options to change, though will do eventually
  4. outline = love.graphics.newImage("/annie/outline.png")
  5. shoes = love.graphics.newImage("annie/shoes1.png")
  6.  
  7. -- sets up 4 different hair colors
  8. hair1 = love.graphics.newImage("/annie/hair1.png")
  9. hair2 = love.graphics.newImage("/annie/hair2.png")
  10. hair3 = love.graphics.newImage("/annie/hair3.png")
  11. hair4 = love.graphics.newImage("/annie/hair4.png")
  12.  
  13. -- sets up 4 different skin colors
  14. skin1 = love.graphics.newImage("/annie/skin1.png")
  15. skin2 = love.graphics.newImage("/annie/skin2.png")
  16. skin3 = love.graphics.newImage("/annie/skin3.png")
  17. skin4 = love.graphics.newImage("/annie/skin4.png")
  18.  
  19. -- sets up 4 different sleeve colors
  20. sleeves1 = love.graphics.newImage("annie/sleeves1.png")
  21. sleeves2 = love.graphics.newImage("annie/sleeves2.png")
  22. sleeves3 = love.graphics.newImage("annie/sleeves3.png")
  23. sleeves4 = love.graphics.newImage("annie/sleeves4.png")
  24.  
  25. -- sets up 4 different options for dresses
  26. dress1 = love.graphics.newImage("/annie/dress1.png")
  27. dress2 = love.graphics.newImage("/annie/dress2.png")
  28. dress3 = love.graphics.newImage("/annie/dress3.png")
  29. dress4 = love.graphics.newImage("/annie/dress4.png")
  30.  
  31.  
  32. -- sets up initial combinations
  33. hair = hair1
  34. skin = skin1
  35. sleeves = sleeves1
  36. dress = dress1
  37.  
  38. end
  39.  
  40. -- sets up values for arrow keys going up & down / left & right
  41. Colour = 1
  42. Outfit = 1
  43.  
  44.  
  45.  
  46. function state:keypressed(key)
  47.  
  48.  
  49. if key == 'right' then
  50. if Outfit == 4 then
  51. Outfit = 1
  52. else
  53. Outfit = Outfit + 1
  54. end
  55. elseif key == 'left' then
  56. if Outfit == 1 then
  57. Outfit = 4
  58. else
  59. Outfit = Outfit - 1
  60. end
  61.  
  62. end
  63.  
  64. end
  65.  
  66. function love.update(dt)
  67.  
  68. if Outfit == 1 then
  69. dress = dress1
  70. elseif Outfit == 2 then
  71. dress = dress2
  72. elseif Outfit == 3 then
  73. dress = dress3
  74. elseif Outfit == 4 then
  75. dress = dress4
  76. else
  77. print("Hello World")
  78. end
  79.  
  80. end
  81.  
  82. function love.draw()
  83. love.graphics.draw(dress, 0, 0)
  84. love.graphics.draw(outline, 0, 0)
  85. love.graphics.draw(hair, 0, 0)
  86. love.graphics.draw(skin, 0, 0)
  87. love.graphics.draw(sleeves, 0, 0)
  88. love.graphics.draw(shoes, 0, 0)
  89. end
  90.  
  91.  
Runtime error #stdin #stdout 0.01s 2492KB
stdin
Standard input is empty
stdout

Standard output is empty